5 - 62 5 - 62
5 MELSEC FUNCTIONS
5.14.7 7-segment decode SEG_M
The lower 4 bits (0 to F) of the specified data are decoded into 7-segment display data.
Function definition
BOOL SEG_M (BOOL EN, ANY16 S1, ANY16 D);
Argument Name
IN/OUT
Description
EN IN
Execution condition (Function is executed only when the
result is TRUE)
S1
IN
Data to be decoded
D
OUT
Decode result (BIN 16-bit data)
Return Value
Description
BOOL Execution
condition
Example of use
(* When execution condition X0 turns ON, the lower 4 bits of D100 are decoded *)
(* into 7-segment display data, and the result is stored into Result.
*)
SEG_M (X0, D100, Result);
Corresponding MELSEC command
SEG (7-segment decode)
5.14.8 4-bit disconnection of 16-bit data DIS_M
The data in the lower n digits of the specified BIN 16-bit data are disconnected and stored into the lower 4 bits
of n points, starting at the specified device.
Function definition
BOOL DIS_M (BOOL EN, ANY16 S1, ANY16 n, ANY16 D);
Argument Name
IN/OUT
Description
EN IN
Execution condition (Function is executed only when the
result is TRUE)
S1
IN
Data to be disconnected (BIN 16-bit data)
n IN
Number of disconnected data (1 to 4) *0: No processing
(BIN 16-bit data)
D
OUT
Disconnection result (BIN 16-bit data)
Return Value
Description
BOOL Execution
condition
Example of use
(* When execution condition X0 turns ON, the data in the lower D200 digits
*)
(* (1 digit = 4 bits) of D100 are stored into the lower 4 bits of D200 points,
*)
(* starting at Result.
*)
DIS_M (X0, D100, D200, Result);
Corresponding MELSEC command
DIS (4-bit disconnection of 16-bit data)
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: ......