2-53
2 Instruction Descriptions
NJ-series Instructions Reference Manual (W502)
Sequence Output Instructions
2
SetBits and ResetBits
SetBits and ResetBits
z SetBits
The SetBits instruction changes the value of Size bits from the bit position Pos in the bit string InOut
to TRUE. The status of the other bits will not change.
SetBits: Changes consecutive bits in bit string data to TRUE.
ResetBits: Changes consecutive bits in bit string data to FALSE.
Instruction Name FB/FUN Graphic expression ST expression
SetBits Set Bits FUN SetBits(InOut, Pos, Size);
ResetBits Reset Bits FUN ResetBits(InOut, Pos, Size);
Variables
Name Meaning I/O Description Valid range Unit Default
InOut Bit string In-out Bit string Depends on data type.
--- ---
Pos Bit position
Input
Specified bit position 0 to No. of bits in InOut
− 1
---
0
Size Number of
bits
Number of bits 0 to No. of bits in InOut 1
Out Return
value
Output Always TRUE TRUE only --- ---
Boolean
Bit strings Integers
Real
numbers
Times, durations,
dates, and text strings
BOOL
BYTE
WORD
DWORD
LWORD
USINT
UINT
UDINT
ULINT
SINT
INT
DINT
LINT
REAL
LREAL
TIME
DATE
TOD
DT
STRING
InOut OKOKOKOK
Pos OK
Size OK
Out OK
Function
(@)SetBits
EN ENO
InOut
Pos
Size
Out
(@)ResetBits
EN ENO
InOut
Pos
Size
Out