Anatomy of a Group
The action settings of a group define how often the group will be evaluated, as well as important settings that apply to the group as a whole.
They are found on the Action tab, the first of the tabs on the right side of the Transaction Group workspace.
The settings vary for the different types of groups, but a few setting are common to most of them:
|Execution scheduling||How often the group is evaluated. For a number of reasons, the group may not execute during the evaluation. The most common reason is the trigger, but see Execution Cycle above for more possible reasons why evaluation will exit.|
|Data source||The data connection to use for the group. Can be Default, which will use the default connection for the project.|
|Update mode||For groups that support it, sets the default for how items are compared to their targets.|
|Store timestamp||Stores a timestamp along with the data any time the group executes.|
|Store quality code||Stores an aggregate quality for the group along with the regular data. The aggregate quality is a bit-wise AND of the qualities of the items in the group.|
There are two ways to specify when the group should execute: timer and schedule mode.
In this mode, the group is evaluated regularly at the provided rate. As mentioned in the previous sections, due to trigger settings, full execution may not occur, but the trigger will at least be evaluated at this rate.
With schedule mode, you are providing a list of time (or time ranges) that the group should run at. If the pattern specified includes a time range, at rate must be provided, and the group will execute as in timer mode during that period.
The schedule pattern
The schedule is specified as a comma separated list of times or time ranges. You may use the following formats:
24-hour times. Ie. "8:00, 15:00, 21:00", for execution at 8am, 3pm, and 9pm.
12-hour with am/pm (if not specified, "12" is considered noon): "8am, 3pm, 9pm"
Ranges, "8am-11am, 3pm-5pm"
It is allowed for time ranges to span over midnight, such as "9pm - 8am"
When using ranges, the execution times will be aligned to the start time. For example, if you specify a schedule of "9am - 5pm" with a rate of "30 minutes", the group will execute at 9, 9:30, 10, etc., regardless of when it was started. This is a useful difference compared to the Timer Mode, which runs based on when the group was started. For example, if you wanted a group that ran every hour, on the hour, you could specify a 1 hour rate with a range of "0-24".
Trigger and Handshake Settings
The trigger settings determine when a group will actually execute. They are examined each time the group evaluates (according to the update rate of the group). If they pass, the group will run and perform its action against the database.
The trigger settings are the same for all group types. They are found on the second tab (labeled "Trigger"), in the right side of the Transaction Group workspace.
Only execute when value have changed (asynchronous trigger)
These settings are evaluated first. If set, the group will examine whether the values in the specified tags have changed, and if not, will exit evaluation.
It is possible to monitor all Run-Always tags in the group, or only specific ones.
Execute this group on a trigger
Enables trigger on a specific item in the group. The trigger item can be any Run-Always item, such as an OPC item, Tag reference, or an Expression item set to "Run-Always" mode.
In addition to the numeric settings that define the trigger, there are several other options:
- Only execute once while trigger is active - The group will only execute once when the trigger goes into an active state, and will not execute again until the trigger goes inactive first. If unselected, the group will execute each time the trigger conditions evaluate to true.
- Reset trigger after execution - If using the ">0" or "=0" trigger modes, the trigger can be set to write an opposite value after the group has executed successfully. This is useful for relaying the execution back to the PLC.
- Prevent trigger caused by group start - If selected, the group will not execute if the trigger is active on the first evaluation of the group. In the course of designing a group, it is common to stop and start it many times, and sometimes it is not desirable to have the group execute as a result of this. Selecting this option will prevent these executions, as well as executions caused by system restarts.
Group handshakes are also defined on the trigger tab. It is possible to specify both a success and failure handshake. The success handshake will write the specified value to the given item when the group has finished all other triggered execution without error.
The failure handshake, on the other hand, will be written when the group execution is cut short due to an error, such as an error writing to the database or an item.
Transaction groups offer several advanced settings that affect how execution occurs. These settings can be found under the Options tab for a group.
OPC Data Mode
This setting modifies how the group receives data from OPC.
Subscribe - Data points are registered with the OPC server, and data is received by the group on-change. This is the default setting and generally offers the best performance, as it reduces unnecessary data flow and allows the OPC server to optimize reads.
Bypass Store and Forward System
Only applicable to groups that insert rows into the database. Causes groups to target the database directly instead of going through the store-and-forward system. If the connection becomes unavailable, the group will report errors instead of logging data to the cache.
Override OPC Subscription Rate
Specifies the rate at which OPC items in the group will be subscribed. These items are normally subscribed at the rate of the group, but by modifying this setting it is possible to request updates at a faster or slower rate.
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.
To create a transaction group
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 Standard Group to make a new Historical Group.
Your new group, named Group will be selected. 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.
Your 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 in your table to something interesting.
Right now your group only exists in the Designer.
- Save the 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 the Query Browser ( ) button to the right of 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.