# PLC data logging and Ignition synchronization

**URL:** <https://forum.inductiveautomation.com/t/plc-data-logging-and-ignition-synchronization/31362>\
**Category:** General Discussion\
**Created:** [January 17, 2020, 1:42pm UTC](https://forum.inductiveautomation.com/t/plc-data-logging-and-ignition-synchronization/31362 "2020-01-17T13:42:56Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![ena\_bj](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/ena_bj/32/13318_2.png) [@ena\_bj](https://forum.inductiveautomation.com/u/ena_bj)\
**Post date:** [January 17, 2020, 1:42pm UTC](https://forum.inductiveautomation.com/t/plc-data-logging-and-ignition-synchronization/31362/1 "2020-01-17T13:42:56Z")

</div>

I have lately came across an requirement that showed up in several tenders and left me a bit baffled. It can be summed up something like this:

- basic setup, several PLCs on a network connected to the SCADA server (since I’d be building a system with Ignition, this is Ignition GW)
- for simplicity, suppose Ignition GW is a standalone version, with DB installed on the same machine
- in normal operation, data from the PLC is polled and using tag historian stored stored in DB
- BUT: in case that GW goes offline, PLC should log data locally (for up to 24 h) and when the GW starts again all the locally stored data in all of the PLCs should be synchronized into the database.

Let’s suppose PLC supports data logging and has enough memory for all the tags for 24 h. We usually work with Micrologix 1400 or Siemens S7-1200, although we don’t have experience with data logging function.

Does anyone have a suggestion how to approach this problem and get historical data from PLC into Ignition and ultimately to correctly fill historical DB?

---

<div class="post-metadata">

**Author:** ![bschroeder](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/bschroeder/32/13260_2.png) [@bschroeder](https://forum.inductiveautomation.com/u/bschroeder)\
**Post date:** [January 17, 2020, 2:10pm UTC](https://forum.inductiveautomation.com/t/plc-data-logging-and-ignition-synchronization/31362/2 "2020-01-17T14:10:24Z")

</div>

I’ve done something similar to this for transaction data not specifically historical data but the concept should be the same.

You push data into a fifo, and then using a transaction group you are always looking at the top of the fifo for new data to log. When there is data, log the data and once the data is logged set a flag in the PLC to pop the fifo.

I’ve never done this with a historical group, but I assume that you could do that same thing. Only caveat is that you would need to possibly use the PLC time for the data record time if that is important to have that time stamp at the time of the data.

---

<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:** [January 17, 2020, 2:34pm UTC](https://forum.inductiveautomation.com/t/plc-data-logging-and-ignition-synchronization/31362/3 "2020-01-17T14:34:40Z")

</div>

As @bschroeder says, you create FIFO in the PLC. The PLC has to trigger its own data logging into the FIFO. Ignition has to monitor the FIFO for new data and drain it to the DB. Ignition’s tag historian has no way to do this.

I tend to script the data transfer instead of using a transaction group, mainly to have more robust handshaking.

---

<div class="post-metadata">

**Author:** ![witman](https://avatars.discourse-cdn.com/v4/letter/w/d2c977/32.png) [@witman](https://forum.inductiveautomation.com/u/witman)\
**Post date:** [January 21, 2020, 5:21am UTC](https://forum.inductiveautomation.com/t/plc-data-logging-and-ignition-synchronization/31362/4 "2020-01-21T05:21:30Z")

</div>

+1 to @bschroeder’s & @pturmel’s suggestions. You’ll need to store timestamps along with the data in the PLC FIFO buffer. If you want to use Ignition’s historian functionality, you’d use [system.tag.storeTagHistory](https://docs.inductiveautomation.com/display/DOC80/system.tag.storeTagHistory) to store the records into the historian as you drain them from the FIFO.

---

<div class="post-metadata">

**Author:** ![ena\_bj](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/ena_bj/32/13318_2.png) [@ena\_bj](https://forum.inductiveautomation.com/u/ena_bj)\
**Post date:** [January 21, 2020, 6:21am UTC](https://forum.inductiveautomation.com/t/plc-data-logging-and-ignition-synchronization/31362/5 "2020-01-21T06:21:29Z")

</div>

Thank you everybody, these are some great tips on how to start with this.

---

<div class="post-metadata">

**Author:** ![PRAMANJ](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/pramanj/32/66935_2.png) [@PRAMANJ](https://forum.inductiveautomation.com/u/PRAMANJ)\
**Post date:** [January 21, 2020, 12:17pm UTC](https://forum.inductiveautomation.com/t/plc-data-logging-and-ignition-synchronization/31362/6 "2020-01-21T12:17:13Z")

</div>

Interesting specification ! Please keep posted on the success and difficulties of It’s implementation! Ideally plc vendors should provide such a store and forward mechanism in the plcs in my opinion !

---

<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:** [September 7, 2020, 4:09pm UTC](https://forum.inductiveautomation.com/t/plc-data-logging-and-ignition-synchronization/31362/8 "2020-09-07T16:09:06Z")

</div>

Totally not applicable. I’m not entirely sure you aren’t a spammer. /:
