Chapter 4. Ladder Diagram (LD) Programming
GFK-2950C
February 2018
73
4.2.4
Bit Set, Bit Clear
Mnemonics
BIT_SET_DWORD
BIT_SET_WORD
BIT_CLR_DWORD
BIT_CLR_WORD
The Bit Set (BIT_SET_DWORD and BIT_SET_WORD) function sets a bit in a bit string to 1. The Bit
Clear (BIT_CLR_DWORD and BIT_CLR_WORD) function clears a bit in a string by setting the bit to 0.
Each scan that power is received; the function sets or clears the specified bit. If a variable rather than
a constant is used to specify the bit number, the same function can set or clear different bits on
successive scans. Only one bit is set or cleared, and the transition information for that bit is updated.
The transition status of all the other bits in the bit string is not affected.
The function passes power flow to the right, unless the value for BIT is outside the specified range.
Operands for Bit Set, Bit Clear
Parameter Description
Allowed Operands
Optional
Length (??) The number of WORDs or DWORDs in the
bit string. 1
Length
256.
Constants
No
IN
The first WORD or DWORD of the data to
process
All except constants, flow, and variables
located in %S
No
BIT
The number of the bit to set or clear in IN.
1
BIT
(16 × Length) for WORD.
1
BIT
(32 × length) for DWORD
All except variables located in %S - %SC
No
Example 1
Whenever input V_I0001 is set, bit 12 of the string beginning at reference
%R00040 (as specified by variable V_R0040) is set to 1.
Example 2
Whenever V_I00001 is set, %M00043, the third bit of the string beginning at
%M00041, is set to 1. Note that neither the status nor the transition value of any
of the other bits in the same byte as %M00043 (e.g., %M00041, %M00042,
%M00044, etc.) is affected by the BIT_SET function
Summary of Contents for PACSystems RSTi-EP
Page 357: ......
Page 466: ...Chapter 9 Diagnostics GFK 2950C February 2018 451 ...