PUTBIT¶
The input to this function ( The library UTIL.Library\ \) consists of a DWORD X, a BYTE N and a BOOLean value B.
PUTBIT sets the N:sup:th bit from X on the value B, whereby it starts counting from the zero bit.
Example in ST:\ \ \ \
var1:=38; (\* binär 100110 \*)
var2:=PUTBIT(A,4,TRUE); (\* Result: 54 = 2#110110 \*)
var3:=PUTBIT(A,1,FALSE); (\* Result: 36 = 2#100100 \*)