OPC Server Data Goes Away - FSQL still writes to DB

When I disconnect my datasource to the OPC server (i.e. pull the network cable to the plc generating the data) Kepware says ‘Device no responding’. In OPC Quick Client, the Values are ‘Unknown’ and the Quality is ‘Bad’.

In FSQL frontend it says ‘E_Fail’ for value. Yet, FSQL is still writing values to the database every 2 seconds, as I had programmed. At first, they look like the last set of values recorded in the process. Then I stop the group and restart, and they are zeros.

This is not the behaviour I expected - if the OPC server loses data, I would have thought we would stop logging, through errors, something. Can someone help me - this is a dangerous situation because I am writing junk to the database, and in the future I may not know it. It’s probably a simle check box somewhere that I have overlooked.

The application is simple datalogging - read data from field device, put in database, and analyze in FPMI.

You can check the “Store OPC Quality Code” on the group so that you can tell when the opc quality went bad. It is a simple matter of a WHERE clause on the FactoryPMI end to ensure that you filter out any bad data. 192 is the OPC quality code for “Good”.

You can find more specifics in the user manual here: inductiveautomation.com/prod … %20tab.htm

Hope this helps,

Thank you for the tip. But is there a better way - can I not even write Bad values to the database? Would that be ‘Trigger on change’? It doesn’t make sense to me to store data that is bad. I realize others may want it anyway, but for this project it would just take up space.


If you’re not currently using a trigger on the group, you can do the following:

  1. Take one of your current values in the group, copy and paste it into the same group (that is, make a copy of it).
  2. Edit the new item- make it “read-only” (so it won’t write to the database) and most importantly, change the “Property” selection to “Quality”. The datatype should now be integer. You can also change the name of the item to something better, like “trigger” or “quality”.
  3. On the trigger tab, enable the trigger. Select the item you just created.
  4. Set the trigger condition to be “>0”, or you can use “Active=192, Inactive!=192”.

And that’s it- the group will only execute when the data quality is good.