6 - 5 6 - 5
6 IEC FUNCTIONS
6.1.3 Boolean type (BOOL) character string type (STRING) conversion BOOL_TO_STR
BOOL_TO_STR_E
Boolean type (BOOL) data is converted into character string type (STRING) data.
Function definition
STRING(2) BOOL_TO_STR ( BOOL S1 );
Argument
Argument Name
IN/OUT
Description
S1
IN
Data to be converted (bit data)
Return value
Return Value
Description
STRING (2)
Conversion result (character string data)
Remarks: When the data to be converted (bit data) is 0, the return value is "0".
When the data to be converted (bit data) is 1, the return value is "1".
Example of use
Argument Type
ST Program
Conversion Result
Used Instruction
BOOL s_ary1
:=
BOOL_TO_STR(b_data1);
LD b_data1
MOV K49 s_ary1
LDI b_data1
MOV K48 s_ary1
LD, MOV, LDI
Function definition
BOOL BOOL_TO_STR_E( BOOL EN, BOOL S1, STRING(2) D1 );
Argument
Argument Name
IN/OUT
Description
EN
IN
Execution condition (Function is executed only when the result is TRUE)
S1
IN
Data to be converted (bit data)
D1
OUT
Conversion result (character string data)
Return value
Return Value
Description
BOOL Execution
condition
Example of use
(*
(*
(*
When execution condition X0 turns ON, the Boolean type (BOOL) data in
bData is converted into the character string type, and the result is stored into
Result.
M0 := BOOL_TO _STR _E ( X0, bData, Result ) ;
*)
*)
*)
Содержание MELSEC L series
Страница 1: ...Programming Manual Structured Text ...
Страница 2: ......
Страница 73: ...4 33 4 33 4 ST PROGRAM EXPRESSIONS MEMO ...
Страница 297: ......