Support Forums
To operate on a bit of a word

Hello, I have a VTSCADA question to ask,thank you
Tag01 is the address of 40001 from the PLC. Now I want to set the bit2 of Tag01 to 1.
I failed to do this by setbit () ,Please tell me how to achieve it,thank you

611df4502643b

Hello, I have a VTSCADA question to ask,thank you Tag01 is the address of 40001 from the PLC. Now I want to set the bit2 of Tag01 to 1. I failed to do this by setbit () ,Please tell me how to achieve it,thank you ![611df4502643b](serve/attachment&path=611df4502643b)

Set the IO tag to be a digital tag with a read/write address of 40001/x where x is the 0-15 bit number (unless you're working in 1-16 addressing, or are backwards)

Set the IO tag to be a digital tag with a read/write address of 40001/x where x is the 0-15 bit number (unless you're working in 1-16 addressing, or are backwards)
edited Aug 20 '21 at 8:21 pm

Hi,Michael,Thank you very much for your answer.
address of 40001/x,It's going to take up too many VT Tags, and we want to save costs
I need to read and control a lot of status words from the PLC. The bit in each word mean different things so I need to break it down. Since I need to save the use of Tags, I choose to use Bit([Tag03], 0) instead of 40001/X, which is used to read Tags. Now I need to use the set Tags, and since I want to save variable points, I want to use setBit() to manipulate the variable , just like I used Bit() to set the Tag through Calc6123133c33bb3

Hi,Michael,Thank you very much for your answer. address of 40001/x,It's going to take up too many VT Tags, and we want to save costs I need to read and control a lot of status words from the PLC. The bit in each word mean different things so I need to break it down. Since I need to save the use of Tags, I choose to use Bit([Tag03], 0) instead of 40001/X, which is used to read Tags. Now I need to use the set Tags, and since I want to save variable points, I want to use setBit() to manipulate the variable , just like I used Bit() to set the Tag through Calc![6123133c33bb3](serve/attachment&path=6123133c33bb3)
85
3
1
live preview
enter atleast 10 characters
WARNING: You mentioned %MENTIONS%, but they cannot see this message and will not be notified
Saving...
Saved
With selected deselect posts show selected posts
All posts under this topic will be deleted ?
Pending draft ... Click to resume editing
Discard draft