# Using a Transaction Group without the database

**URL:** <https://forum.inductiveautomation.com/t/using-a-transaction-group-without-the-database/7477>\
**Category:** Ignition\
**Created:** [October 28, 2013, 3:37pm UTC](https://forum.inductiveautomation.com/t/using-a-transaction-group-without-the-database/7477 "2013-10-28T15:37:29Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![george](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/george/32/14066_2.png) [@george](https://forum.inductiveautomation.com/u/george)\
**Post date:** [October 28, 2013, 3:37pm UTC](https://forum.inductiveautomation.com/t/using-a-transaction-group-without-the-database/7477/1 "2013-10-28T15:37:29Z")

</div>

Can someone advise if the following is valid (it appears to work). I’ve created a Transaction Group but I haven’t actually targeted any of the tags to anything in a database (and as such I’ve just put a dummy name in the database table dropdown).

In this scenario I’m using it to sync the clock on a PLC. I’ve setup various expression tags (using dateExtract) and when the group executes they get written into a set of PLC tags. There’s a PLC bit (in this example HMI\_SetClock) that I then need to set on to tell the PLC to read from the tags I’ve written to and set its internal clock. I’ve set this up as the handshake (I didn’t know if otherwise I could be sure that the data values would be written before the command bit is set on).

Here’s a screengrab:

[attachment=0]sync\_clock.png[/attachment]

Is there anything wrong with doing this?

And also, regarding scheduling of transaction groups, I can put in say 0:00-23:00 as a range but it won’t let me put in 0:00:01-23:00:01 Is there anyway to make it run down to a certain second?

---

<div class="post-metadata">

**Author:** ![Pat](https://avatars.discourse-cdn.com/v4/letter/p/8491ac/32.png) [@Pat](https://forum.inductiveautomation.com/u/Pat)\
**Post date:** [October 28, 2013, 5:57pm UTC](https://forum.inductiveautomation.com/t/using-a-transaction-group-without-the-database/7477/2 "2013-10-28T17:57:40Z")

</div>

I would guess that your transaction group would throw an error since the table doesn’t exist and the group is set up to not automatically create the table.

I sync all my PLC clocks with a gateway timer script -

[code]from time import localtime, strftime  
curTime = strftime("%H:%M:%S", localtime())

if curTime == “00:00:01”:  
#sync PLC clocks to server’s time  
system.tag.write(“MasterClock/SCADA/Hours”, 0)  
system.tag.write(“MasterClock/SCADA/Minutes”, 0)  
system.tag.write(“MasterClock/SCADA/Seconds”, 1)  
system.tag.write(“MasterClock/SCADA/SyncClocks”, 1)[/code]  
I also have a button to sync the PLC clocks that gets the current time from the database -

[code]#get time from database  
dbTime = system.db.runQuery("SELECT HOUR(NOW()) as hours, " +  
"MINUTE(NOW()) as minutes, " +  
“SECOND(NOW()) as seconds”)

tags = [“MasterClock/SCADA/Hours”, “MasterClock/SCADA/Minutes”,  
“MasterClock/SCADA/Seconds”, “MasterClock/SCADA/SyncClocks”]  
values = [dbTime[0][“hours”], dbTime[0][“minutes”],  
dbTime[0][“seconds”], 1]

#write time to Master Clock PLC and set SyncClocks bit  
system.tag.writeAll(tags, values)[/code]

---

<div class="post-metadata">

**Author:** ![george](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/george/32/14066_2.png) [@george](https://forum.inductiveautomation.com/u/george)\
**Post date:** [October 28, 2013, 8:58pm UTC](https://forum.inductiveautomation.com/t/using-a-transaction-group-without-the-database/7477/3 "2013-10-28T20:58:33Z")

</div>

Hi Pat - thanks for your example. That would have been my other way of doing it (gateway timer script). How frequently have you got that running - presumably every 1000ms?

The Group did fail the first time but that was when I’d left the table name blank.

I put in “dummy\_table” and did actually create a one column table in the DB with that name.

It seems to run without errors.

I did read something about using Transaction Groups to sync data between PLCs and presumed that was without a database in the middle.

---

<div class="post-metadata">

**Author:** ![Pat](https://avatars.discourse-cdn.com/v4/letter/p/8491ac/32.png) [@Pat](https://forum.inductiveautomation.com/u/Pat)\
**Post date:** [October 28, 2013, 9:57pm UTC](https://forum.inductiveautomation.com/t/using-a-transaction-group-without-the-database/7477/4 "2013-10-28T21:57:28Z")

</div>

Yes the gateway timer script is running at 1000ms. I actually have all my time based events located in this script, it makes managing time based events easier.

---

<div class="post-metadata">

**Author:** ![JordanCClark](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/jordancclark/32/83362_2.png) [@JordanCClark](https://forum.inductiveautomation.com/u/JordanCClark)\
**Post date:** [October 29, 2013, 11:20am UTC](https://forum.inductiveautomation.com/t/using-a-transaction-group-without-the-database/7477/5 "2013-10-29T11:20:23Z")

</div>

[quote=“george”]  
I did read something about using Transaction Groups to sync data between PLCs and presumed that was without a database in the middle.[/quote]

Actually, yes, you can! 😃 Unlike Pat, I sync all mine with Transaction Groups! 😆

What you have posted is very close.

At the top, where your OPC items are, the targets should be set to “Read Only”. In the Expression items, the targets should be set to the OPC tags.

Hope this helps!
