EXTRACTΒΆ

Inputs to this function ( The library UTIL.Library\ \) are a DWORD X, as well as a BYTE N. The output is a BOOL value, which contains the content of the Nth bit of the input X, whereby the function begins to count from the zero bit.

Examples in ST:\ \ \ \

FLAG:=EXTRACT(X:=81, N:=4);

(\* Result : TRUE, because 81 is binary 1010001, so the 4th bit is 1 \*)

FLAG:=EXTRACT(X:=33, N:=0);

(\* Result : TRUE, because 33 is binary 100001, so the bit '0' is 1 \*)