Trigger store to DB if any tag in group changes value?

Is it possible to trigger a group to store to the DB if any tag in the group changes value?

I just put together an Access interface for our production supervisors to set the schedule of the startup and shutdown of an incinerator. When they change any one of the values (it could be day of week, hour of day, or minute of hour), I want to write a new record to a table. This will be used so the maintenance department can track what values were set to what, and when.

I already have a group that updates a record that runs every 30 seconds and FactorySQL writes the new values to the PLC. That works beautifully, and I put it together in record time. It would have taken 5 times longer with RsSQL. So again, I’m a very happy customer.

Sure, just check the Only evaluate this group when a change has occurred option on the group’s Trigger tab. See inductiveautomation.com/prod … er_tab.htm for details.

And will that only trigger it to write one time to the database?

Never mind, I just tried it and answered my own question. Yes, it only writes one time.

Thank you!!! Once again, exceptional customer support.

Yes, it will write one time, until the next change occurs.

Ok now I have another question about this. If I want it to go the other direction, that is, have a group look look at the database and only trigger to write to the PLC when it sees different values in the table. When I turn that on, every time it triggers, it triggers twice. One time when the value in the DB changes, and then again when the value in the PLC changes. Why is that? Is that a big deal?

Also, when a group is set to trigger if the value in the DB changes, is FactorySQL only pinging the PLC when that value changes? Our PLC guy is always concerned about extra traffic on our PLC’s, and I’d like to be able to tell him that FSQL isn’t even looking at the PLC until it sees a change in the database values.

Hi-

You’re correct that it will trigger twice- once for the db and once for the opc change. This might seem a little strange, but I think it’s the correct action, and I don’t think it’s a big deal. Basically, some people use DB-to-OPC to always keep the plc synchronized with the database- if any value should change on the plc, they would want the group to execute and write the correct value down.

At the end of the day, however, FactorySQL compares both sides, and only writes the values which are different. So, if it triggers again, there shouldn’t be any writes to the OPC executed because both sides will be the same.

As for the PLC network traffic- even on DB-to-OPC the group is “subscribed” to the points. FactorySQL itself doesn’t explicitly request any data, it just tells the opc server what it’s interested in, and lets it decide how to read it. This lets the opc server optimize reading. Probably the easiest way to reduce read traffic without much work is to change the “OPC Update Rate %” under “Service Settings”. This affects the rate that FactorySQL sends to the OPC server (which is this percentage of the group update rate). Most of the time you can just set it to 100%, which will generally reduce the work that the opc server does.

However, as mentioned up above, FactorySQL only writes when the values are different, not every cycle.

Hope this answers your questions,

This might be out of place for me to ask, considering you don’t support Rockwell Software, but how does the traffic between FSQL and the PLC differ from the way RsSQL does it? If you know. I believe in RsSQL, whatever the scan rate of the tag is set to, that’s how often RsSQL reads it from the PLC. From what I’m gathering, FSQL fundamentally does reads and writes differently, which keeps traffic down. Is this correct?

With regards to my question, I believe you answered it. So if the update rate of the group is set to 5 seconds, the group is DB to OPC, the trigger is set to “Only evaluate when a change has occurred”, FactorySQL isn’t pinging the PLC every seconds, right? It’s looking at the database for a change, and then sending that information to the PLC when a change occurs?

Unfortunately I can’t really say how RSSQL manages its reads and how it compares to FactorySQL. In reality you would be comparing what the OPC servers do. If FactorySQL subscribes to values at 1 second, it’s up to the OPC server to decided what it needs to do to accommodate that- it could scan every second, or it could scan every 100ms, or something else. There are usually some settings in the opc server to control this behavior.

Anyhow, in terms of writing the values from the db, that’s right- it only occurs when there is a change.

Regards,