6 - 72 6 - 72
6 IEC FUNCTIONS
6.10.4 Acquisition from specified position of character string MID
MID_E
The specified n characters of character string data is acquired, starting at the specified position from the left of
the specified character string (head of the character string).
Function definition
STRING MID( STRING S1, INT n, INT POS );
Argument
Argument Name
IN/OUT
Description
S1
IN
Data to be acquired (character string data)
n
IN
Number of characters to be acquired (BIN 16-bit data)
POS
IN
Head position of data to be acquired (BIN 16-bit data)
Return value
Return Value
Description
STRING
Acquisition result (character string data)
Remarks: This function cannot be used with the Basic model QCPU.
Secure the area of n+1 characters as the data area that will store the
acquired character string data.
Example of use
Argument Type
ST Program
Conversion Result
Used Instruction
STRING s_ary1
:=
MID( s_ary2, i_data1, i_data2
);
LD SM400
MOV i_data1
D10239
MOV i_data2
D10238
MIDR s_ary2 s_ary1
D10238
LD,MOV,MIDR
Function definition
BOOL MID_E( BOOL EN, STRING S1, INT n, INT POS, STRING 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 acquired (character string data)
n
IN
Number of characters to be acquired (BIN 16-bit data)
POS
IN
Head position of data to be acquired (BIN 16-bit data)
D1
OUT
Acquisition result (character string data)
Return value
Return Value
Description
BOOL Execution
condition
Example of use
(*
(*
(*
When execution condition X0 turns ON, the specified number of characters
stored in iData1 are acquired, starting at the iData2 position from the head of
the character string stored in sData, and stored into Result.
M0 := MID_E( X0, sData, iData1, iData2, Result ) ;
*)
*)
*)
Содержание MELSEC L series
Страница 1: ...Programming Manual Structured Text ...
Страница 2: ......
Страница 73: ...4 33 4 33 4 ST PROGRAM EXPRESSIONS MEMO ...
Страница 297: ......