Hi there,
Wondering if anyone knows how or has an example of writing from Ignition to Kepware. I am currently reading tags from there. However, I need to create a new expression tag which takes in multiple tags and displays a number depending on which one goes high. For example if tagA is true and tagB and tagC are false then newTag = 1, if tagB is true newTag = 2, if tagC then = 3. I would then like to send this tag back to Kepware where it is being read by another system. Kepware is the main host of all plc communications. Anyone have any ideas how I can do this?
Put a tag change script on your expression tag.
If the target tag you want to write to in Kepware exists already in Ignition, use system.tag.writeBlocking to write the value to it on change. If not, you can write directly to it with system.opc.writeValue instead.
What if the tag doesn't exist in Kepware and I want to do something where Kepware just reads a tag out of ignition is this possible too?
Yes, Kepware has an OPC UA Client driver. You would configure it to make a connection to Ignition's OPC UA server.
You'll have to make some changes to Ignition's server settings before a connection from another host besides localhost is allowed, and enable the Exposed Tags feature.
It's probably better to make the tag in Kepware if possible because right now Ignition's Exposed Tags feature is all or nothing - you cannot configure any fine grained access control for the Clients you allow to connect. This has been implemented for Ignition 8.3.
Do you know where this exposed tag feature is?
Many Kepware polling drivers support dynamic tag addressing. If enabled, you can read & write directly to a tag in a PLC without configuring the tag in Kepware at all. If your driver supports this, I highly recommend it! This moves all of the polling configuration to Ignition…a combo that is hard to beat. Though, slightly less useful when data is being served to multiple clients…
Is it possible to avoid placing Ignition as another link in the chain for this logic?
- Any chance that TagA, TagB, & TagC are all read from the same PLC? If so, perhaps this is the place to add logic for ‘newTag’?
- Can ‘another system’ perform the same expression internally / locally?
- Kepware has an Advanced Tags bolt-on which adds the functionality you desire. Some would say this comes with an Impressive price tag…
So we just got the advanced tag plugin but everywhere I am reading I can only compare tags to return a true or false statement. Any ideas how I can do this?
You reminded me how creative one has to be to work with the Kepware expression language...
You mentioned you'd like to return 1 if tagA, 2 if tagB, etc. What should happen if two or more tags are true? Ignoring that detail, does the below output what you're after? ...untested...:
(TAG(Sim.Device.tagA)*1)
+ (TAG(Sim.Device.tagB)*2)
+ (TAG(Sim.Device.tagC)*3)
Ok I follow what you are saying ok. I can work with this thank you. Yes I will have to get creative with the fact if two go high at the same time. But something to go off of.
Would that not be,
TAG(Sim.Device.tagA) * 1
+ TAG(Sim.Device.tagB) * 2
+ TAG(Sim.Device.tagC) * 4
to create a binary encoding?
1 Like