5 - 81 5 - 81
5 MELSEC FUNCTIONS
5.17.17 Character string BIN conversion VAL_S_MD
The specified character string is converted into BIN 16-bit data, and its number of digits and BIN 16-bit data are
obtained.
Function definition
BOOL VAL_S_MD (BOOL EN, STRING (8) S1, ANY32 D1, ANY16 D2);
Argument
Name
IN/OUT Description
EN IN
Execution condition (Function is executed only when the result is
TRUE)
S1 IN
Data to be converted (character string data)
Remarks: The number of characters in the fraction part of the character
string specified in S1 is 0 to 5 characters. Note that the character string
should be specified within the (total number of digits - 3) or less.
D1
OUT
Conversion result (number of digits) (BIN 32-bit data)
D2
OUT
Conversion result (BIN 16-bit data)
Remarks: The digits of a bit device cannot be specified in "D1".
Return Value
Description
BOOL Execution
condition
Example of use
(* When execution condition X0 turns ON, the character string specified in
*)
(* sData is converted into BIN 16-bit data, the number of digits is stored
*)
(* into dData, and the BIN data is stored into iData.
*)
VAL_S_MD (X0, sData, dData, iData);
Corresponding MELSEC command
VAL (Character string BIN 16-bit conversion)
5.17.18 Character string 32-bit BIN conversion DVAL_S_MD
The specified character string is converted into BIN 32-bit data, and its number of digits and BIN 32-bit data are
obtained.
Function definition
BOOL DVAL_S_MD (BOOL EN, STRING(13) S1, ANY32 D1, ANY32 D2);
Argument
Name
IN/OUT Description
EN IN
Execution condition (Function is executed only when the result is
TRUE)
S1 IN
Data to be converted (character string data)
Remarks: The number of characters in the fraction part of the character
string specified in S1 is 0 to 5 characters. Note that the character string
should be specified within the (total number of digits - 3) or less.
D1
OUT
Conversion result (number of digits) (BIN 32-bit data)
D2
OUT
Conversion result (BIN 32-bit data)
Remarks: The digits of a bit device cannot be specified in "D1".
Return Value
Description
BOOL Execution
condition
Example of use
(* When execution condition X0 turns ON, the character string specified
*)
(* in sData is converted into BIN 32-bit data,the number of digits is stored into
*)
(* dData1, and the BIN data is stored into dData2.
*)
DVAL_S_MD (X0, sData, dData1, dData2);
Corresponding MELSEC command
DVAL (Character string BIN 32-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: ......