I do get the difference between using getBit in an expression vs an action. I was just using getBit as an example of format. I could write logic to break the word into bits, set the one I want, then turn bits back to a word and write it down, but in the end, I am still writing a word, not a bit. That’s a huge difference and could be potentially dangerous.
By the time I execute my logic and write the whole word value down, the rest of the bits on the word could be stale. The PLC word value would be overwritten with my stale word value. Not good. I would want a function that I knew was only writing the bit I was intending to write.
Now, I could write a script that takes a tag, get the tag’s word address (say N19:34), create a temporary tag dynamically for the bit (N19:34/9), write the bit, then destroy the dynamic tag. That would work, albeit slowly, but seems like overkill.
Where this is stemming from is working with a PLC5 and trying to keep comms to a minimum.