5 - 83 5 - 83
5 MELSEC FUNCTIONS
5.17.21 BIN ASCII conversion ASC_S_MD
The specified BIN 16-bit data is converted into the hexadecimal ASCII data of the specified number of characters.
Function definition
BOOL ASC_S_MD (BOOL EN, ANY16 S1, ANY16 n, STRING D);
Argument Name
IN/OUT
Description
EN IN
Execution condition (Function is executed only when the
result is TRUE)
S1
IN
Data to be converted (BIN 16-bit data)
n
IN
Number of characters to be stored (BIN 16-bit data)
D
OUT
Conversion result (ASCII data)
Return Value
Description
BOOL Execution
condition
Example of use
(* When execution condition X0 turns ON, the BIN 16-bit data specified in
*)
(* iData1 is converted into hexadecimal ASCII, and the result is stored into the
*)
(* range of the number of characters specified in iData2, starting at the device
*)
(* number specified in sData.
*)
ASC_S_MD (X0, iData1, iData2, sData);
Corresponding MELSEC command
ASC (BIN 16-bit data ASCII conversion)
5.17.22 ASCII BIN conversion HEX_S_MD
The hexadecimal ASCII data stored in the specified number of characters is converted into BIN 16-bit data.
Function definition
BOOL HEX_S_MD (BOOL EN, STRING S1, ANY16n, ANY16 D);
Argument Name
IN/OUT
Description
EN IN
Execution condition (Function is executed only when the
result is TRUE)
S1
IN
Data to be converted (hexadecimal ASCII data)
n
IN
Number of characters to be converted (BIN 16-bit data)
D
OUT
Conversion result (BIN 16-bit data)
Return Value
Description
BOOL Execution
condition
Example of use
(* When execution condition X0 turns ON, the hexadecimal ASCII data stored
*)
(* in the number of characters specified in iData1, starting at the device number *)
(* specified in sData, is converted into a BIN value, and the result is stored into
*)
(* iData2.
*)
HEX_S_MD (X0, sData, iData1, iData2);
Corresponding MELSEC command
HEX (ASCII BIN 16-bit conversion)
For the usable data type, refer to "3.2.2 About
ANY type".
Содержание MELSEC L series
Страница 1: ...Programming Manual Structured Text ...
Страница 2: ......
Страница 73: ...4 33 4 33 4 ST PROGRAM EXPRESSIONS MEMO ...
Страница 297: ......