Tag Value Changed event script source

I'm using tag event scripts to push data into a queue, to log state data to the database.

I'm curious if there is a way to know where the Value Changed event source is from? IE was the value changed in the device or was the value changed from the SCADA side? The end goal is to log the user that made the change, but also allow for changes from the PLC side that would log the change, however not the user.

I'm using the AUDIT log in other scenarios, but in this scenario, there is associated data I need to log in conjunction with the actual value.

Any ideas? Has anyone done anything similar?

1 Like

So you have 1 OPC tag, where the value could be changed by PLC logic or through an Ignition tag write? Without developing your own custom mechanism to store where it originated from and who the user was... I don't see too many options.

You could create a matching memory tag that stores a user. so prior to writing the new value to the opc tag, write the user, write to opc tag, tag event fires (looks at user tag), execute rest of event, reset the user.

If PLC changes the value, then the user tag should be blank which would indicate PLC originated...

Certainly not a perfect system.

Just thinking out loud before retiring for the night ...
How about:

  • Have a memory tag associated with each point and the HMI reads and writes to that. An onChange event forwards that value to the PLC.
  • An onChange event on the OPC tag compares the PLC to the memory tag.
    • If they're the same then the HMI must have updated the PLC.
    • If they're different then the PLC must have changed the value. (Then update the memory tag to match.)
  • The OPC tag's onChange event could then determine where the change came from.

It seems like a lot of trouble to set up.

Yeah.... I agree. A ton of trouble.

Basically the system is designed so that a bit is only turned on from the SCADA side. It can be turned off during normal operation or if the operator turns off the bypass.

Currently, we don't track who turns the bypass on or off, just that the bypass is on. We write a single record into a database table for each bypass enable event so that we can easily see which bypasses are on in a system. For a large plant, there can be 1000s of such tags. If I could correlate a timestamp with the audit log, then I could use that to figure out who did what. And I might still query into the audit log to try and track things, I'm just not sure how it'll all work at the moment.

Thanks for the ideas though.

1 Like