5 - 85 5 - 85
5 MELSEC FUNCTIONS
5.17.25 Any data fetch in character string MIDR_M
S2[1] characters of data, starting at S2[0] of the specified character data, are acquired.
Function definition
BOOL MIDR_M (BOOL EN, STRING S1, ANY16(2) S2 , 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 acquired (character string data)
S2 [0] Position of first character
S2 IN
Position of first character
and storage destination of
characters to be acquired
(ARRAY [0..1] OF ANY16)
S2 [1] Number of acquired
characters
D
OUT Acquisition result (character string data)
Return Value
Description
BOOL Execution
condition
Example of use
(* When execution condition X0 turns ON, the data of the number of
*)
(* characters specified in StrArray [1] from the position specified in StrArray [0], *)
(* starting at the left of the character specified in sData (head of the character
*)
(* string), are stored into Result.
*)
MIDR_M (X0, sData, StrArray, Result);
Corresponding MELSEC command
MIDR (Any data fetch in character string)
5.17.26 Any data replacement in character string MIDW_M
The data of the number of characters specified in S2[1] are stored into the position, starting at S2[0], of the
specified character string data.
Function definition
BOOL MIDW_M (BOOL EN, STRING S1, ANY16(S) S2, 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 acquired (character string data)
S2 [0] Position of first character of
replacement destination
S2 IN
Position of first character and
storage destination of
characters to be acquired
(ARRAY [0..1] OF ANY16)
S2 [1] Number of acquired
characters
D
IN/OUT Data to be replaced, replacement result (character string data)
Return Value
Description
BOOL Execution
condition
Example of use
(* When execution condition X0 turns ON, the data of the number of characters *)
(* specified in StrArray [1], starting at the left of the character specified in sData *)
(* (head of the character string), are stored into the position specified in StrArray *)
(* [0], starting at the left of the character string data stored in sData2.
*)
MIDW_M (X0, sData1, StrArray, sData2);
Corresponding MELSEC command
MIDW (Any data replacement in character string)
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: ......