getBit function

Good morning everybody from Italy,

I anticipate you I am not an expert about informatic, since I’m a chemical engineer.

I have a problem with the function getBit.
The two parameters in this function are the number and the postion.
Is the number the n-th bit in a word for example ? Is the position the tag path ?

I have to get a bit from a word, cause there is an alarm condition in it.

Thank you in advance for your help.

Looks like the docs could use some improving…

The number is the number you want a bit from, and position is the position of the bit in that number when it’s written in binary. For the second example in the docs (I’m going to just use 4 bits here for simplicity), the input number is 1, which is 0001 in binary. Counting from the right (least significant bit), position 0 is the 1 in 0001.

So I do not have to use it. I want simply get a bit from a word. for example DB1000,W3. From that word I want find the 1st bit (W3.1) . What I must do ?

I think I have understood, I have to put as number the tag value, and as position the bit I want to get, is it right ?