How-to save a OPC value to a data series each minute
Intermediate
This document will go through all the step needed in order to save a value from an OPC tag to a data series.
đ Instructions
Go to âSystem administrationâ and open âEvent handling \ Observationsâ
Select âCreateâ
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.
All done!