How-to save a OPC value to a data series each minute
This document will go through all the step needed in order to save a value from an OPC tag to a data series.
Go to “System administration” and open “Event handling \ Observations”
Double-click the “Observation container” in order to start building the evaluation criteria if the form should be shown or not.
In this case, the event handling should occur each time the event is raised for the “Injection molding” machine. Connect the “StartCondition” with “Current producing unit”, select the “Injection molding” producing unit and then connect it with the “EndCondition”.
This way the observation will only be evaluated to be true when the minute event is raised for the “Injection molding” machine.
Now the observation criteria are completed.
The next thing to do is to define what shall happen when the observation is true, in this how-to a value from an OPC tag should be written to a data series.
Go back to the root and double-click the “Actions” container.
Now it is time to build the action part it will use three tasks:
- “Read OPC input value”
- “Convert string to double”
- “Write a value to a data series”
First the “Read OPC input value”, reads a value from an OPC input value in string data format. It needs to be configured by which input we want to read, in this case, we select an input called Temperature which will read out the current machine temperature.
As the output from the task is of type string it needs to be converted to a Double in order to add it to a data series. The next step is to add a converter for that the task “ToDouble”.
The last task that is needed is to write the value now converted from a string value to double to a Data series. Add the “Write to data serie” task and select the data series “Mold Temperature”.
Now all the logic is ready and the only thing left to do is to give the event handling a name and connect it to the “Minute changed”-event.
Now the event handling is saved and has a name, the last thing is to connect it to the “Minute changed”-event.