Problem writing Tag value for Bit in Siemens PLC via Ignition

Hello All,

I am facing some issues while I am trying to write bit value for Siemens PLC. I am having a Word Datatype in which I need the second bit value should be written via Ignition but as I am writing the value it is going in the first bit of Word so anyone please suggest how to solve this issue.

Thanks,
Kartik I

“some issues” is pretty vague. Please provide more information.

  • Ignition version
  • PLC model/version
  • Whether using an OPC connection or an Ignition driver connection (and whether you followed the white paper instructions if the latter)
  • Structure of your datatype and the element involved

{ I’m not a Siemens guy, but the ones around here will want to know. }

[quote=“pturmel, post:2, topic:54925”]

  • Ignition version - Ignition 7.9
  • PLC model/version - Siemens 1500 PLC
  • Whether using an OPC connection or an Ignition driver connection (and whether you followed the white paper instructions if the latter) - Siemens 1500 Driver
  • Structure of your datatype and the element involved - Dword Structure

Set bit:

new_tag_value = old_tag_value | (1<<bit_number)

Clear bit:

new_tag_value = old_tag_value & ~(1<<bit_number)

In case zxcslo’s brief reply confuses you, it means there isn’t support in the PUT/GET protocol to change just one bit of a word or dword. You have to write the whole value. (Which can conflict with PLC logic writing to other bits–so don’t if that would apply.)

Thanks I will check.

I used the XOR function with Left Shift Bit so its good now. But I have a another doubt regarding WString Datatype how to fetch this String Datatype in ignition.