Character String Search; Floating-Point Bcd Decomposition - Mitsubishi Electric MELSEC Q Series Programming Manual

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

Advertisement

5 MELSEC FUNCTIONS

5.17.27 Character string search

A searched for the specified character string data is performed, starting at the "n"th character from the left of
the specified character string data.
Function definition
5.17.28 Floating-point
The specified real number data is decomposed into the BCD type floating-point format based on the specified
fraction part digits.
Function definition
5 - 86
INSTR_M
BOOL INSTR_M (BOOL EN, STRING S1, STRING S2, ANY16 n, ANY16 D);
Argument Name
EN
S1
S2
n
D
Return Value
BOOL
Execution condition
Example of use
(* When execution condition X0 turns ON, a search for the character string
(* specified in sData1 is performed, starting at the iData character from the left of *)
(* the character string specified in sData2 (head of the character string),and the
(* search result is stored into Result.
INSTR_M (X0, sData1, sData2, iData, Result) ;
Corresponding MELSEC command
INSTR (Character string search)
BCD decomposition
BOOL EMOD_M (BOOL EN, REAL S1, ANY16 S2, ANY16(5) D);
Argument Name
IN/OUT
EN
IN
S1
IN
S2
IN
D
OUT
Return Value
BOOL
Execution condition
Example of use
(* When execution condition X0 turns ON, the real number data specified in
(* rData is decomposed into the BCD type floating-point format based on the
(* fraction part digits specified in iData, and the result is stored into Result.
EMOD_M (X0, rData, iData, Result);
Corresponding MELSEC command
EMOD (Floating-point data
IN/OUT
Execution condition (Function is executed only when the
IN
result is TRUE)
IN
Data to be searched for (character string data)
IN
Data to be searched (character string data)
Search start position (at the "n"th character from left)
IN
(BIN 16-bit data)
Search result (character position from head of character
OUT
string data specified in S2) (BIN 16-bit data)
EMOD_M
Execution condition (Function is executed only when the result is
TRUE)
Data to be decomposed (real number data)
Fraction part digit data (BIN 16-bit data)
BCD-decomposed data
storage destination
(ARRAY[0..4] OF ANY16)
BCD decomposition);
For the usable data type, refer to "3.2.2 About
ANY type".
Description
Description
Description
D[0] Sign (positive: 0, negative: 1)
D[1]
BCD 7 digits
D[2]
D[3] Exponent part sign (positive: 0,
negative: 1)
D[4] BCD exponent
Description
*)
*)
*)
*)
*)
*)
5 - 86

Advertisement

Table of Contents
loading

This manual is also suitable for:

Melsec l series

Table of Contents