ConvertFromText('Expression', 'DecimalPoint*=0', 'Begin=0', 'End'=-1 (end of text)')
Arguments
|
'Expression' |
Name of the text signal |
|
|
'DecimalPoint*' |
Decimal point |
|
|
DecimalPoint = 0 DecimalPoint = 1 |
Period Comma |
|
|
'Begin' |
Index of the first character of the desired text, default = 0 |
|
|
'End' |
Index of the first character of the desired text, default = -1 (end of the text) |
|
Parameters ending with * are only evaluated once at the start of the acquisition.
Description
The function parses a floating comma number from the test and delivers the numeric value as an analog signal. 0 is output if there is no number in the first position of the range defined by the 'Begin' and 'End' arguments. Exception: if there are only spaces present up to the first numeric character. Otherwise the text is read up to the first non-numerical position or maximum to the 'end'. Leading zeros before a number do not need to be interrupted by spaces or non-numerical characters.
Example
Reading in a defined text
Solution
The function is: ConvertFrom Text('Text', 0,22,-1)
The content of the text signal is: Voltage target value: 6.9 V
The voltage value starts with position 22. -1 is used as the end index so that values with more preceding and/or following commas can also be acquired.
