STRING_TO_WORD

STRING (hexadecimal format) into WORD

This function converts a STRING in hexadecimal format into a value of the data type WORD.

Thereby the attached string is first converted into a value of the data type STRING[32]. Finally this is converted into a value of the data type WORD via a sub-program of approx. 270 steps that is also used in the functions STRING_TO_INT, STRING_TO_WORD, STRING_TO_DINT and STRING_TO_DWORD.

Input

Unnamed input (STRING)

input data type

Output

Unnamed output (WORD)

Conversion result

Remarks

If the required data type is supported, we recommend using the overloaded instruction TO_WORD

Permissible format: '[Space][Hexadecimal numbers][Space]' e.g. ' afFE '

Permissible characters:

The analysis ends with the first non-hexadecimal number.

Example with and without EN/ENO:

Related topics:

Modified on: 2019-01-24Feedback on this pagePanasonic hotline