Topic: DMD0017

Help File Version: 2.10.0.636

DECODE - Decode to Set Bit


The Decode to Set Bit instruction (DECO) will set the bit at the specified Bit Position Value ON, and all of the other bits will be set OFF. For example, for a Bit Position Value of 12, the Decode to Set Bit instruction would output the following bit string: 0000 0000 0000 0000 0001 0000 0000 0000. This instruction can only operate on Bit Position Values in the range of 0-31 (0-0x1F). If the Bit Position Value is greater than 31, the Output Bit Pattern will be 0 and the $OutOfRange (ST132) will be ON.

 

 


Parameters:

Note: Use the F9 key or click the 'three dot box' at the right edge of the parameter field to open the Default Element Selection Tool (the Element Picker or the Element Browser) or use the Down-Arrow key (Auto-Complete) on any parameter field to see a complete list of the memory locations that are valid for that parameter of the instruction.

 

Bit Position Value specifies the position value of the bit to turn ON. This can be any constant value in the range of 0-31 (0x0 -0x1F) or any readable numeric location containing a value in that range.

 

Output Bit Pattern specifies a memory location to store the result. This can be any writable numeric location.

 


See Also:

DECO - Decode to Set Bit

 

ENCO - Encode Bit Position

 


Related Topics:

SUMBITS - Sum Bits

 

MATH - Count If Equal

 

MATH - << (Shift Left)

 


Rung Example: