StringToFloat
Contents

1.Description

The module expects a text at Input 1 that is to be converted to a numerical value.
A decimal separator is entered at Input 2.
If the text corresponds to an integer value (integer), i.e., the decimal separator entered at Input 2 is not contained in the text, the text converted to a number is output at Output 1.
If the text corresponds to a floating point value (float), i.e., the decimal separator entered at Input 2 is contained in the text, the text converted to a number (with decimal places) is output at Output 2.
If the conversion is not possible, a 1 is sent at Output 3. If no error occurs, the output sends a 0. An error occurs if the input text contains characters other than numbers and the defined decimal separator.
For each incoming value at Input 1 or Input 2, a calculation is carried out and outputs generated at the outputs.
Note
The documentation of this module did not correspond to its functioning and was adapted for this reason.
There is a new module called StrToNumber (17855) that behaves in the same way as the documentation for this module previously indicated.

2.Inputs

No.NameInitialisationDescription
1E1 Value"0"
Input value as text
2E2 Decimal separator"."
Decimal separator

3.Outputs

No.NameInitialisationSBCDescription
1A1 Int0s
Integer value of value 1
2A2 Float0s
Floating point value of value 1
3A3 Error0s
Error output
s = send, sbc = send by change

4.Other

Recalculation during start:No
Module is retentive:No
Internal designation:17755
Category:Converter

5.Similar functions

Status machine, 1 outp
Status machine, 8 outp
ShiftLef
ShiftRight
BitCutter
DecToHex
TextToBase64
IntToString
StringToHex
HexToString
ChrToASCII
StringToNumber
2ByteTo16Bit
4ByteTo32Bit