4

BSET and BCLR (WORD)

The Bit Set (BSET) function is used to set a bit in a bit string to 1. The Bit Clear (BCLR) function is used to clear a bit within a string by setting that bit to 0.

Each sweep that power is received, the function sets the specified bit to 1 for the BSET function or to 0 for the BCLR function. If a variable (register) rather than a constant is used to specify the bit number, the same function block can set different bits on successive sweeps.

A string length of 1 to 256 words can be selected. The function passes power flow to the right, unless the value for BIT is outside the range (1 BIT (16 * LEN) ). Then, ok is set OFF.

_____

(enable)(ok)

SET_

WORD

(first word) —IN

LEN 00001

(bit number of IN) —BIT _____

Parameters:

Parameter

Description

enable

When the function is enabled, the bit operation is performed.

 

 

IN

IN contains the first word of the data to be operated on.

 

 

BIT

BIT contains the bit number of IN that should be set or cleared.

 

Valid range is (1 BIT (16 * LEN) ).

 

 

ok

The ok output is energized whenever enable is energized.

 

 

LEN

LEN is the number of words in the bit string.

 

 

Note

When using the Bit Test, Bit Set, Bit Clear or Bit Position function, the bits are numbered 1 through 16, NOT 0 through 15.

4-62

Series 90-30/20/Micro Programmable Controllers Reference Manual–September 1998

GFK-0467K

Page 143
Image 143
GE 90-30/20/Micro manual Bset and Bclr Word