F_ToASC
This function converts STRING to ASCII Code. Only the first sign of the STRING will be converted. An empty STRING delivers a zero.
FUNCTION F_ToASC : BYTE
Inputs
VAR_INPUT
str : STRING;
END_VAR
Name | Type | Description |
---|---|---|
str | STRING | String to convert |
Sample of calling the function in FBD:
PROGRAM P_TEST
VAR
sCharacter : STRING(1) := '1';
cAsciiCode : BYTE := 0;
END_VAR

Prerequisites
Development Environment | Target platform | PLC libraries to be integrated (category group) |
---|---|---|
TwinCAT v3.1.0 | PC or CX (x86, x64, Arm®) | Tc2_System (system) |