F_ToASC

F_ToASC 1:

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

F_ToASC 2: 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
F_ToASC 3:

Requirements

Development environment

Target system type

PLC libraries to include (Category group)

TwinCAT v3.1.0

PC or CX (x86, x64, ARM)

Tc2_System (System)