Each Item in the Transaction Group consists of several properties, but the key properties are the Value and Target Name.
- Value: The Value can be a reference to an OPC value such as a Tag in the Tag Browser. However, you can instead use a direct OPC Item Path without having to create a Tag in Ignition first. Additionally, the Value can be derived using Ignition's Expression Language.
- Target Name: In most cases, the Target Name is a column on the database table the Transaction Group is associated with. However, it is possible to have the Target Name 'Read-only'. When set to 'Read-only' the value of the item will not be tied to any columns in the database, but is still visible from the Transaction Group and can be used as a trigger.
Enabling Group Execution
In order for groups to be evaluated, they must first be enabled. This is done by selecting Enabled in the group title bar, and then saving the project. The group executing can be stopped by reversing the procedure and selecting Disabled before saving. If you want to quickly and temporarily stop the group's evaluation, toggle the Pause button. This will prevent execution until the group is enabled again, or until the system is restarted.
Transaction Groups exist in a project, but they execute in the global Gateway space. This means that once your groups are enabled, they will run even without a client open.
Editing Group Settings
Group settings may be modified at any time, regardless of whether or not the group is executing. Modifications will be applied when the project is saved, and the group will be started or stopped as required. Some changes such as modifying items may cause features like live values to appear to be incorrect. It is therefore important to note the modified icon that appears next to the group, and to save often. If you would prefer to stop the group before making edits you can simply pause the group. Execution will begin again after the project is saved.
How Groups Execute
Generally speaking, groups work on a timer. They are set to run at a certain rate, and at that rate, then check the rest of the settings. If the trigger conditions pass, the group is executed fully. The following section provides a fuller outline of the execution cycle.
All of the groups follow a similar execution cycle. The core evaluation may differ, but the general cycle is the same.
- Timer executes, group enters execution
- Is the group paused? Break execution.
- Is the Gateway part of a redundant pair? If so, is it active? If not active, break execution. Groups only execute on the active node.
- Evaluate run-always items: OPC items, Tag references, and Expression items set to ignore the trigger (or items placed in the run always section of the Configuration window).
- Is trigger set/active? If there is a trigger defined, but it is not active, break execution.
- Evaluate "triggered" expression items.
- If applicable, read values from the database.
- Execute a comparison between items and their targets.
- Execute any writes to other Tags or the database that result from execution.
- Report alerts.
- Acknowledge the trigger, if applicable.
- Write handshake value, if applicable.
If an error occurs at any stage besides the last stage, execution will break and the failure handshake will be written if configured. The group will attempt execution again after the next update rate period.
If the group errors due to a bad database connection, it will need to be manually restarted once the database connection is brought back.
Creating a Transaction Group
Transaction groups are used to store history, log events, synchronize databases tables with PLC, perform calculations, and many more data-centric tasks. Let's create a basic History Group and start logging some PLC values to your database.
- Click on the Transaction Groups in the Project Browser panel to switch the Designer's workspace to the Transaction Group workspace.
- Click on File > New > New Historical Group to make a new Historical Group. Name the group "Group".
The OPC Browser panel is now docked to the lower-left of the screen.
- Browse your OPC device and drag some OPC tags to the Basic OPC/Group Items section.
Note that the group starts out disabled by default.
- Click the Enabled button above the item tables to enable logging.
- Go to the Action tab and change the Table Name. For the example, we gave it the name "New_Test_Table."
Note that right now your group only exists in the Designer.
- Save your project to start the group.
Your group is now running and logging data to your database connection.
- To see the data, you can use the Ignition Designer's built-in database query browser. The easiest way to do this is to click on your group's Table Name field. The Query Browser is a convenient way to directly query your database connection without leaving the Ignition Designer. Of course - you can also use any query browser tools that came with your database.