In spite of that, I happen to be a fan of those processors… they have built-in support for Ethernet/IP I/O devices, as both scanner and adapter. And my I/O driver does have support for bit-level reads and writes within its buffers. (-:
So it turns out the P2K line of PLCs does not accept the ‘MaskWriteRegisterRequest’ from the driver as Kevin had guessed.
In case anyone else is trying to do the same, this is the sudo script I wrote to accomplish flipping a single bit to a 1.
currentTag = system.tag.readBlocking(["Path/to/tag"])
setBit = 8 #Bit position to set
newValue = 1 << setBit #set bit in correct position
system.tag.writeAsync(["Path/to/tag"],[newValue | currentTag[0].value]) # OR new value to current tag value
Just be careful and aware of the race condition - if some other process writes to the value, or the PLC changes the value, in between your read and write you’ll clobber that value.
I’m writing to HR100.Bit from Ignition but it returns the illegal function code error in gateway log.
From PLC document, it supports the function code x16.