Transaction Logger Tags

Not counted towards your tag license limit.

Transaction Logger tags can be used to record a collection of historical values as a single transaction. These are useful for material-handling applications that must record transfers of custody.

When the trigger changes to a non-zero value, all of the records in the history associated with the I/O and Calculations, Analog Status, Digital Status, and String I/O tags that are immediate children of this tag, will be read and coalesced into a structure, which will be written as a single transaction record in the Historian associated with this tag. No other tag types will be included, nor will any tag that is below the level of the immediate children of the Transaction Logger. The TransactionLogger tag will not respond to a trigger event unless the child tags use the History Address field, not the address field

The field names in this transaction snapshot will match the names of the tags being recorded, and are generated in the order of I/O and Calculations, Analog Status, Digital Status and String I/O, with the fields being alphabetically ordered within types. All field names are stored with every transaction because the child tags of the Transaction Logger may change over time.

 

The driver parameter of all the child tags of a Transaction Logger must be set to that Transaction Logger. Child tags that do not use this tag for their driver parameter will not be included in the transaction.

You are advised to use the History address of the input tags where possible, so that there will be a positive confirmation of the data being read via WriteHistory. This will avoid false positives on communication errors due to other users of the driver having comm errors concurrently with the transaction's polling.

Avoid using Polling Drivers that are attached to the same driver and that have polling intervals that result in continuous polling. Doing so could result in transactions failing to complete.

Error Status

The value of the Transaction Logger tag shows its current error status, according to the following table:

Tag Value Meaning
0 No error.
1 Communication Error.
2 For multiple-record devices (such as the ROC), the time stamps for consecutive records across all fields do not align.
3 Not all fields have the same number of records returned.
4 Driver became unavailable.

When there is an error, the I/O data corresponding to the poll attempt is written into the record, but these error records are not accessible via ODBC. In the case of the Communication Error, only one record will be written until the value becomes something other than 1. It is recommended practice to attach an alarm to each of your Transaction Logger tags.

Data Retrieval

There is a single, virtual ODBC table called TransactionLog, which presents the data for all transactions by all Transaction Logger tags. This table will be the merged columns that match the tags in the query. The table’s columns are defined by the child field tags that are present at the instant the query is made. There is a column, called TransactionLogger, that gives the associated Transaction Logger tag. Each record will have a 36-character GUID, stored in the column TransactionID.

The only method for retrieving logged transaction data is to use an SQL query. This may be done through code, calling the SQLQuery function, or through the ODBC Server. An example of an generic data retrieval query follows:

SELECT * FROM TransactionLog LIMIT 100;
 

Transaction Logger properties I/O tab

The I/O tab for the Transaction Logger tag consists of...

I/O Device

Select the communication driver tag from which data will be read.

By default, the tag will look for a parent tag that is a device driver (*Driver). If none is found, the text "--Missing--" will be displayed. The tag button to the right of the field opens the tag browser, from which you can either select an existing communication driver tag or add a new one. The X button will clear the field. Right-clicking on a tag in the field will open a dialog with which you can add or remove a Snapshot Expression or open a selected driver's properties dialog.

Trigger Condition

May be any tag or expression that will change from a zero to a one, signaling when to write the transaction record.

Acknowledge Output Destination

Must be a tag. In most cases, the PLC will need to know that the transaction has been read so that the PLC can update the registers for the next transaction that may be in the queue. The output provides that acknowledgment to the PLC.

Value to Write to Acknowledge

Provide the value that is to be written to the acknowledge output destination. This may depend upon the error status of the transaction tag, in which case an expression should be used to generate the appropriate value.

Force fields with different timestamps into separate transactions

When selected, data returned for each field does not have to have the same number of records. Time stamps that do not match will be placed in separate transaction records.

This option assumes that the time stamps are in order in tag history. The transactions will be written with the time stamps corresponding to the data times in chronological order. Should be selected for the TBox chronological data.