5 - 80 5 - 80
5 MELSEC FUNCTIONS
5.17.15 BIN character string conversion STR_S_MD
The specified BIN 16-bit data is converted into a character string with a decimal point added in the specified
position.
Function definition
BOOL STR_S_MD (BOOL EN, ANY32 S1, ANY16 S2, STRING(9) D);
Argument Name
IN/OUT
Description
EN IN
Execution condition (Function is executed only when the
result is TRUE)
S1
Total number of digits (2 to
8 digits)
S1 IN
Number of digits of
numeric value to be
converted
(BIN 32-bit data)
S1+1 Number of fraction part
digits (0 to 5 digits)
S2
IN
Data to be converted (BIN 16-bit data)
D
OUT
Conversion result (character string data)
Remarks: The digits of a bit device cannot be specified in "S1".
Return Value
Description
BOOL Execution
condition
Example of use
(* When execution condition X0 turns ON, the BIN 16-bit data specified in
*)
(* iData is converted into a character string with a decimal point added in the
*)
(* position specified in dData, and the result is stored into sData.
*)
STR_S_MD (X0, dData, iData, sData);
Corresponding MELSEC command
STR (BIN 16-bit character string conversion)
5.17.16 32-bit BIN character string conversion DSTR_S_MD
The specified BIN 32-bit data is converted into a character string with a decimal point added in the specified
position.
Function definition
BOOL DSTR_S_MD (BOOL EN, ANY32 S1, ANY32 S2 STRING(14) D);
Argument Name
IN/OUT
Description
EN IN
Execution condition (Function is executed only when the
result is TRUE)
S1
Total number of digits (2 to
8 digits)
S1 IN
Number of digits of
numeric value to be
converted
(BIN 32-bit data)
S1+1 Number of fraction part
digits (0 to 5 digits)
S2
IN
Data to be converted (BIN 32-bit data)
D
OUT
Conversion result (character string data)
Remarks: The digits of a bit device cannot be specified in "S1".
Return Value
Description
BOOL Execution
condition
Example of use
(* When execution condition X0 turns ON, the BIN 32-bit data specified in
*)
(* dData1 is converted into a character string with a decimal point added in
*)
(* the position specified in dData2, and the result is stored into sData.
*)
DSTR_S_MD (X0, dData1, dData2, sData);
Corresponding MELSEC command
DSTR (BIN 32-bit character string conversion)
For the usable data type, refer to "3.2.2 About
ANY type".
Summary of Contents for MELSEC L series
Page 1: ...Programming Manual Structured Text ...
Page 2: ......
Page 73: ...4 33 4 33 4 ST PROGRAM EXPRESSIONS MEMO ...
Page 297: ......