Writing multiple bits of Integer OPC tag at same time

Hello everyone,

I’m trying to create a faceplate that works perfectly with our standardized PLC components in TIA portal. To prevent the need of a lot of communication tags with the HMI and other SCADA systems, all bits are merged into Dword & Word tags in the PLC DB’s.

Within Ignition I also want to prevent the need to create an OPC-tag for each individual bit, so I’m using derived tags top map the Word to individual bits as follow;

This gets bit 4 of OPC tag “PARdw”.

Writing and reading 1 single bit works perfectly with the configured Read/Write expressions of the derived tag.
However, this will not work properly if I want to set 2 derived tags at (nearly) the same time. 1 of the tags will immediately be reset again after the 2nd tag is set. My guess is this is because of the bit shift operands.

Does anyone have a solution for this, or have any other ideas to make it possible to write multiple bits at the same time?

Or am I wrong in assuming the needed workload for OPC-tags is much higher than for Derived-tags, and should therefore just create an OPC-tag for every bit? But his would result in 80-ish more OPC-tags for 1 motor for example. So this could lead up to a lot of OPC-tags for a project.

P.S. I’m using the new Enhanced Siemens Driver for symbolic addressing.

Thank you very much in advance for any assistance.

These tags need to be in a Tag Group with the "Optimistic Writes" setting enable if you don't want these bit masking operations in quick succession to clobber each other on the Ignition side.

Thank you for quick, and helpful response Kevin. This seems to work perfectly. Need to be carefull with assuming the new value is actually written now, but thats up to me to handle properly everywhere.

FWIW, I always create all tags that I need directly from PLC (never used derived tags in 14 years).

The Ignition Siemens driver is more than capable running many many thousand tags (my max was cca. 35.000 tags, but people has reported also over 100.000).

But it’s also true, that I (or my colleagues for PLC programming) are never using ‘standard’ templates or blocks or DB’s from Siemens.

They are tend to be very ‘hungry’ and bloated…

We‘re always writing ours own functions and UDTs in Siemens PLC.

But, that’s just (old school) me… :innocent:

1 Like

Forgot to mention that I also simply can not use OPC-tags to directly access the bits in the DB as the “Accessible form…” and “Writable from…” columns are unchecked in our custom PLC Datatypes for the bits. So I have no other option than using the Word-tags as bit addressing (“tag.0”) is also not possible with the new Siemens Enhanced Driver.

But thanks for your information, we’re not as experienced with Ignition as you so its good to know about the capabilities of the Siemens Driver :wink:

Be aware that the optimistic writes setting on a tag group will solve the problem of multiple quick writes from Ignition clobbering each other, but will not solve the problem of Ignition clobbering writes that the PLC makes. It is vital when performing read-modify-write operations that you use separate words for bits set from Ignition (input to PLC) versus bits set from the PLC (output to Ignition).