This article show how to do single logging data with couple of tags with the same timestamp to Hyper Historian using bit register as data trigger with BridgeWorX transaction
Sample description
In this sample we have 2 machines with 3 tags each one.
Every machine have it's own trigger (bit register in their PLC) which activate the logging transaction of it's own three tags.
Trigger configuration
Configure Data Triggers for every machine. IMPORTANT - keep _1 numeration the same as for the machine e.g. machineName_1 -> triggerName_1
Hyper Historian tag configuration
Tags should be switched off from periodic (Is Collected -> off) logging cause we would like to use trigger logging.
BridgeWorX local variable configuration
Create local variable with additional column MachineNumber (string).
BridgeWorX template configuration
Create new template which will be used for logging to Hyper Historian.
Template should have 3 actions : Real Time Output, Real Time Input, Historical Upload
Real Time Output configuration
In this activity we will read the machine number retrive from the trigger name and put it in BridgeWorX local variable.
Point Name -> bwx:local@MachineNumber.Row[0].Col[1]
Row[0] cause we have only one pair of values in row 0.
Col[1] cause we would like to put data in MachineName column with index 1.
Expression -> substring({{triggerVariable:SourceName}}, indexof({{triggerVariable:SourceName}}, "_")+1, len({{triggerVariable:SourceName}})-indexof({{triggerVariable:SourceName}}, "_"))
In this expression we are looking for machine number which should be located right after "_" (low dash) character. Then we put this machine number into the local variable
In this activity block is preparing the DataSet of points which values we would like to log in Hyper Historian. We are using the local variable to create dynamic address of tag.
Historical Upload
Please notice that we have to change HDA Tag Point Name to PointName instead of default TagName.
BridgeWorX transaction configuration
Create transaction. It can have the same name as template. Enable transaction and select template to run with this transaction.
Configure triggers to run this transaction.
Our sample have 2 machines that's why we have 2 triggers respectively for every machine.
If we have more machines just create more triggers with keeping name syntax.