Acquisition From Specified Position Of Character String - Mitsubishi Electric MELSEC Q Series Programming Manual

Structured text
Hide thumbs Also See for MELSEC Q Series:
Table of Contents

Advertisement

6 IEC FUNCTIONS

6.10.4 Acquisition from specified position of character string

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
Function definition
6 - 72
STRING MID( STRING S1, INT n, INT POS );
Argument
Argument Name
IN/OUT
S1
IN
n
IN
POS
IN
Return value
Return Value
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
STRING
s_ary1 :=
MID( s_ary2, i_data1, i_data2
);
BOOL MID_E( BOOL EN, STRING S1, INT n, INT POS, STRING D1 );
Argument
Argument Name
IN/OUT
EN
IN
S1
IN
n
IN
POS
IN
D1
OUT
Return value
Return Value
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 ) ;
MID
MID_E
Data to be acquired (character string data)
Number of characters to be acquired (BIN 16-bit data)
Head position of data to be acquired (BIN 16-bit data)
ST Program
Conversion Result
LD
MOV
MOV
MIDR
Execution condition (Function is executed only when the result is TRUE)
Data to be acquired (character string data)
Number of characters to be acquired (BIN 16-bit data)
Head position of data to be acquired (BIN 16-bit data)
Acquisition result (character string data)
Description
Description
Used Instruction
SM400
LD,MOV,MIDR
i_data1
D10239
i_data2
D10238
s_ary2
s_ary1
D10238
Description
Description
*)
*)
*)
6 - 72

Advertisement

Table of Contents
loading

This manual is also suitable for:

Melsec l series

Table of Contents