Tag values not changing correctly in response to input

I’m currently having an issue where it seems that when I turn certain switches on the MicroLogix PLC from off to on or when I press certain pushbuttons, the inputs do not change correctly. For example, in this image, when I press a different switch(I:0/1), that will change the input value of I:0/0 to 10 and the value corresponding to I:0/1 will not change. If I press the switch corresponding to I:0/0, then the value will increase from 8 to 9 as it should. Additionally, some of the output values do not change even though they are very clearly lighting up on the MicroLogix PLC.

In general when I’ve had this kind of issue in ignition, it turned out that I wasn’t binding something correctly. Can you give some more information about:

  • the type of ignition object you’re clicking which is supposed to change the tag value
  • the intended functionality in terms of how it is supposed to change the tag value
  • the bindings or scripts you’ve added to that object in order to make it do what you want

(e.g: The Momentary Button labeled “Green PB” is supposed to set the I:0_3 tag value to 5 when the button is held, and 0 when the button is released, so I added a bidirectional tag binding on “Control Value” to I:0_3, and set the “On Value” to 5 and the “Off Value” to 0).

and the equivalent information about your indicators.

Or, maybe you could post a project backup containing only this display, and describe the intended functionality of the buttons and indicators.

Thanks!

I’m not clicking any ignition value that is supposed to change the tag value. I am clicking buttons or flipping switches on the PLC that should change values in the tag. I have indicators shown in my window that will change color and do other things with respect to how those tag values change. Am I incorrect in my assumption that if I press a button on the PLC itself, the ignition value corresponding to that input button should change from 0 to 1?

Oh I see what you’re saying. I misunderstood earlier. In that case, help me narrow down where the problem is. Here’s my thought process:

  • If you’re able to see the values change in the Tag Browse tree, but not in your display objects, then the issue is in the bindings.
  • If you’re able to see the values change in the OPC Quick Client (which is on the gateway webpage, and you would click “[r]” to refresh the read value on a selected tag), but not in the tag browse tree, then the problem might be in your OPC tag configuration. For example, have you made any changes to the scan class? (If you haven’t, I expect the default scan class to work in most cases).
  • If you’re able to see the value change in the PLC but not in the OPC quick client, then I would look at the connection to the PLC, and the device configuration for the PLC.

In any case, I’m not aware of any known ignition bugs specific to that controller type, so I expect there to be a resolvable issue somewhere between the physical button and the graphical display.

I tested it in the OPC Quick Client and in my tag browse tree and they seem to behave the same way. When I turn my two switches and two buttons on or off, those changes are all associated with one input value as opposed to the inputs corresponding to their own input values. For example, when I press inputs 1, 2, 3, or 4. Only the value associated with input 1 changes. The same goes for my outputs as well.

OK, now I’m maybe understanding the issue some more. So, you’ve got several physical digital inputs, and whenever you toggle any of them, it changes an integer value associated with your first input channel?

Correct me if I’m wrong… (I haven’t personally used ignition with RSLogix 500 controllers before), but shouldn’t I:0/0 be a binary value instead of an integer, since it’s associated with a digital input?

If that’s the case, it sounds like ignition is reading the whole register I:0 and putting it into I:0_0. Could you open the properties for that tag and copy the OPC path and paste it in here? (maybe leave out the IP address if it’s public facing).

OK, I just tried it with a SLC, which I think has similar register naming conventions. I:0.0 is a DINT 0, representing 16 input bits I:0.0/0 - I:0.0/15.

So if that’s the case, then your physical switches are toggling the bits in that first register according to their bit position.

I:0.0/0 will add 1 to the value of I:0.0
I:0.0/1 will add 2 to the value of I:0.0
I:0.0/2 will add 4 to the value of I:0.0
…and so on.

I won’t be at my PC until tomorrow, but how would I remedy this?

I see that your tags for the outputs and outputs are set up as Int2, try changing them to Boolean.

Sorry for the delayed response. I’m pretty sure there are functions to get individual bits out of DINTs in Ignition’s expression language, so you can make expression tags and bind them to the bits in the tag for a read-only value, and then whenever you need to change the bit you would have to write a script that either changes the bit using jython’s bit functions and write back to the tag, or add the correct value to the tag and then write back to it.

CogenCon’s solution might also work. Definitely worth a try.

Good luck! Be sure and post your workaround when you’re done, so that other people will not have this issue in the future (and maybe IA will patch their driver to smooth this out if it’s a repeatable issue.)