system.opc.writeValue -- Bad_TypeMismatch


We are experiencing a weird issue, most likely this is something simple but I cannot figure it out.

We are using Ignition 8.1.26 and Kepware 6.10.623, ControlLogix PLC 1756-L85E/B Fw 32.014. Not sure if its important, but we are using kepware in passthru mode, which means we have no tags defined but just channel/device and from Ignition side we handle the opcItemPath. By customer request all comms to PLCs go thru kepware (they have a large variety of brands/types).

For some reason when we use system.opc.writevalue some tags return a "Bad("Bad_TypeMismatch: The value supplied for the attribute is not of the same type as the attribute's value.")" I have not been able to identify whats the issue

As part of the troubleshooting I identified 2 tags that are the same type, one works and the other doesn't, both the tags below are float. I have tried different variations of how to pass the value to the one that fails, but have not found any way to make it work.

If I go to kepware and add those tags using the AutoTag Generation tool I get these, both of them are float. If I write using the OPC QuickClient tool (Kepware) it works without issues.

I enabled some traces to see if I could spot somehting but nothing that jumps at me.

No errors shown on the Kepware Logs.

Any ideas of what path to go for troubleshooting?

Wireshark logs at this time will not be easy as we are connected remotely to this site, I am planning to replicate this in our lab, but I wont be able to do it until the 17th when I am back at office and I would like this resolved earlier.


If you generate the tags in Kepware and bring them into Ignition can they be written to then?

edit: it's going to be tough to prove/track this down, but I saw a similar Kepware bug with another customer where the datatype was "stuck" in Kepware via its OPC UA interface as the wrong type. \

edit2: although in that case, it was more about a float value coming in as a non-float... so maybe not the same.

I added both tags to Kepware and bring them into ignition. I wrote to it directly on the designer and it works.

What would be possible workarounds?

In our current design we have a need to update some specific tags on different PLCs, but currently via scripting we dynamically generate the opcItemPath and write to them on the fly, we don't have them mapped to any tag in tagProvider.

I don't know, it's a Kepware bug. I can prove it with a Wireshark capture, but it's already clear from your logs that when it fails via the dynamic OPC Item Path you're already writing a float value.

It seems that as a work around you'll need to use the generated tags or talk to Kepware support.

In case this may be helpful, I did another test, I created a new float OPC tag and added the opcItemPath as generated by the script and it works from the designer, what would be the difference in this case?

There's no difference on the Ignition side, you're just poking at Kepware in ways that are opaque to us.

1 Like