Linking tags and SQL data - looking for suggestions

I am manual entering test data into memory tags where it is being historized and displayed on charts/trends. I have quality limits I'm pulling from a database and I am looking for some best practice ways to link the two together.

The goal would be to have the data entered checked against the min/max upon entry and control limits upon insertion to the database.

I am debating using the tag engineering limits but I'm still short the control limits (which I could add as custom params). But that has me thinking I could do a UDT with all of the required limits, query the db upon tag creation and then I would only have to update when (or if) the limits change.

right now I just have tags and I am querying the database when i need to check against the limits but im looking to streamline it.

Does anyone have any other suggestions I'm not thinking of? On the entry screen I do display an analog indicator so the user can see where they are in terms of limits. Thanks

I would plot limits directly from your recipe tables, as long as they have timestamps and change history (they should). If you can, make the PLC enforce the bounds that you write to it on recipe changes.

I don't have a PLC unfortunately, its just manual entry from a keyboard wedge type device.

I ended up making tags with the same name as the test type. I query the database and use a flex repeater, the limits are returned in the query and I use an indirect tag binding to build the value based on the name. They scan the value in and it goes to the tag and is tested against the control limits.

It works but I could be convinced to change it if you have a better idea. Thanks!

Check it's within the limits before you write to the tag.

If you don't then you've got a problem to reverse out of somehow. You'll have lost the previous value and now all you've got is a wrong value and the limits. What are you going to do? Write the minimum, maximum or midpoint?

I'm using min/max to make sure the value is within bounds, if its within bounds, the entry gets written to the tag and I display the control limits with an analog indicator. I'm debating using built in history or sql tables for historical display