
6 BASIC INSTRUCTIONS
6.4 Bit Processing Instructions
237
6
Performing a 16-bit test
TEST(P)
These instructions take bit data at position specified by (s2) from device specified by (s1) and write to bit device specified by
(d).
Setting data
■
Descriptions, ranges, and data types
■
Applicable devices
Processing details
• These instructions take bit data at position specified by (s2) from device specified by (s1) and write to bit device specified
by (d).
• If relevant bit is "0", device specified by (d) is turned OFF, and if it is "1", device is turned ON.
• For (s2) specify the bit position (0 to 15) of word data. If 16 or more is specified for (s2), the value of the remainder of
(s2)
16 is the bit position.
Ex.
For (s2) = 18, the remainder for 18
16 is "2", so it becomes data of b2.
Operation error
There is no operation error.
Ladder diagram
Structured text
ENO:=TEST(EN,s1,s2,d);
ENO:=TESTP(EN,s1,s2,d);
Operand
Description
Range
Data type
Data type (label)
(s1)
Device number where bit data to be extracted is stored
16-bit signed binary
ANY16
(s2)
Position of bit data to be extracted
0 to 15
16-bit unsigned binary
ANY16
(d)
Bit device number where extracted bit data is to be stored
Bit
ANY_BOOL
Operand
Bit
Word
Double word
Indirect
specification
Constant
Others
X, Y, M, L,
SM, F, B, SB
U
\G
T, ST,
C, LC
T, ST, C, D,
W, SD, SW, R
U
\G
Z
LC
LZ
K, H
E
$
(s1)
(s2)
(d)
(s1)
(s2)
(d)
(s1)
···
···
b15
b5
b0
(d)
(s2) bit (When (s2)=5)
Summary of Contents for MELSEC iQ-F FX5 series
Page 1: ...MELSEC iQ F FX5 Series Programming Manual Instructions Standard Functions Function Blocks ...
Page 2: ......
Page 21: ...19 PART 1 PART 1 OVERVIEW Part 1 consists of the following chapter 1 OVERVIEW ...
Page 98: ...96 4 STANDARD FUNCTIONS FUNCTION BLOCKS 4 2 Standard Function Blocks MEMO ...
Page 840: ...838 23 TIME DATA FUNCTIONS 23 4 Division MEMO ...
Page 887: ......