I have a fear that the answer is going to be one of those ones where I sorta shrink down in my chair and mutter…“oh right”.
One aspect of the overall design of a particular project is I am using Ignition as a “settings” interface to a plc. One where a new/replacement PLC can be installed in the machine, the ladder logic loaded, then the PLC brought online with Ignition at which point the tags that contained specific machine level settings would NOT read, but rather only write themselves to the PLC, thus making the new PLC the same as the PLC that was in the machine before (sorta like recipe’s I guess?).
The settings would be things like “Pump 2 in Rotation”, “Pressure Setpoint”, “min/max RPM allowed”.
I guess after asking, my question really does sound like recipe management. I was hoping to see a “write only” option in the tag definition where it doesn’t really care what the PLC addresses value is, it just writes a replacement value if they don’t match.
If you’re doing this within a transaction group, you can set the items to DB-to-OPC. This is what I currently do for recipe-type applications.
Whoops! I shoulda read a little deeper… Don’t think you can do it an an OPC tag itself, but you do up an expression tag with the value you want, and feed it back to an OPC Tag (There’s an option toward the bottom, underneath the spot where your tag would go…)
see here where I’ve asked for this same thing before.
There is such a thing as a write-only OPC tag. Kepware OPC servers support this by adding a ‘W’ to the item name. Why would you want a write only tag? If you have 50 or 100 sites multi-dropped devices on a radio, telco circuit, or RS485 you want may want to write to a specific discrete without including it in the round-robin read cycle - push-to-start or alarm acknowledge, for example. The PLC will always clear the bit, no need to read it back.
In your example I think you want to create memory tags that hold the setpoints and flags in addition to the same OPC tags. Mem tags are permanent in Ignition. You can place a button on one of your screens to copy the mem tags to the OPC tags if you need to reinitialize these PLC values. Or you could program the PLC to let your Ignition app know that it’s doing first scan and automate the transfer.
Has there been a resolution to this problem?
Currently I have a piece of equipment that has a modbus RTU address for read and a separate for write.
For example Start_Read is address 1 and Start_Write is address 2. if you use a regular OPC tag (automatically does Read/write) on the Start_Write bit this breaks the whole modbus map because it is RTU and everything needs to line up.
If there isn’t a built in way to do this does anyone have a work around?
What breaks? Does the device stop responding to the requests or what?
You can always just use an OPC tag for the read address and then trigger
system.opc.writeValue from scripting pointed at the write address whenever needed.
this is the script I have setup for System.opc.writeValue
newValue = 2
system.opc.writeValue(“Ignition OPC-UA Server”, “ns=1;s=[DCA1].1.HR53623”, newValue)
I get an error configuration when I run this in the script console and nothing happens to the HR when I run this as a script within the Tag Event Scripts “Value Changed”
Is there and issue with my script or where I am running it?
You have an extra “.” in the OPC Item Path. Try this:
newValue = 2
system.opc.writeValue("Ignition OPC-UA Server", "ns=1;s=[DCA1]1.HR53623", newValue)
and make sure your script doesn’t actually have those “smart” quotes instead of regular ones.
This does not seem to be writing to HR. I testing this in the script console and it still says it has an Error config. I ran a “write to tag script” along with the “OPC_WriteValue script”. the “write to tag script” executed which means there is something sill wrong with OPC.writeValue script. The path is correct because when i test the Path in an OPC tag it work fine (I am testing with a read write tag as this is easier than a read only tag)
Just to make sure you are able to run this OPC script in the scripting section of a memory tag correct?
One other approach that you could also look at with more recent Ignition versions is utilizing a Derived Tag. See the example
Baz derived tag that receives input/read values from
Bar and sends outputs/write values to
Note: in this example, I have
Bar still R/W so I could simulate new values, but you could make it RO for your application.