# Validation between PLC Data and HMI/SQL Data

**URL:** <https://forum.inductiveautomation.com/t/validation-between-plc-data-and-hmi-sql-data/69639>\
**Category:** Ignition\
**Tags:** scripting, perspective\
**Created:** [February 9, 2023, 5:05pm UTC](https://forum.inductiveautomation.com/t/validation-between-plc-data-and-hmi-sql-data/69639 "2023-02-09T17:05:26Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![CMuecke](https://avatars.discourse-cdn.com/v4/letter/c/df705f/32.png) [@CMuecke](https://forum.inductiveautomation.com/u/CMuecke)\
**Post date:** [February 9, 2023, 5:05pm UTC](https://forum.inductiveautomation.com/t/validation-between-plc-data-and-hmi-sql-data/69639/1 "2023-02-09T17:05:26Z")

</div>

I have a Batch System that is tied to a SQL DB.

My biggest concern is the integrity of data and to make sure it is the same between PLC and SQL DB.

It looks like there are two possible options and want to know if either way is preferred over the other.

Currently, after an Operator sets up a Run, they click a button to perform a download of the information. Information gets sent to the SQL DB and PLC. Is there a way I can check the data in the PLC before I commit information to the DB?

Second option, I do checks for valid data before the download button appears. When operator clicks on the Download button, I send the info to the DB and have the Transaction Groups do the validation check between the PLC and SQL DB.

---

<div class="post-metadata">

**Author:** ![pturmel](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/pturmel/32/3295_2.png) [@pturmel](https://forum.inductiveautomation.com/u/pturmel)\
**Post date:** [February 9, 2023, 5:30pm UTC](https://forum.inductiveautomation.com/t/validation-between-plc-data-and-hmi-sql-data/69639/2 "2023-02-09T17:30:21Z")

</div>

You'll probably have to give up your transaction groups. They don't really do race-free handshaking. Script your data transfer instead. On top of that, you will want to use the `system.opc.read*()` function(s) after your trigger to ensure the data from the PLC is actually the data from **after** the trigger. (OPC tags won't guarantee this for you.)

---

<div class="post-metadata">

**Author:** ![CMuecke](https://avatars.discourse-cdn.com/v4/letter/c/df705f/32.png) [@CMuecke](https://forum.inductiveautomation.com/u/CMuecke)\
**Post date:** [February 20, 2023, 3:11pm UTC](https://forum.inductiveautomation.com/t/validation-between-plc-data-and-hmi-sql-data/69639/3 "2023-02-20T15:11:55Z")

</div>

What should the transaction groups be used for?
