Hello and welcome to the new quick start guide on how to best use Movicon.NExT™.
In this technote we will show you how to associate a command to state of an alarm associated to a tag.
It is possible to associate an action in Movicon.NExT to be performed
by the system according to the value obtained by the alarm associated
to a tag.
This can be achieved by means of using the Commands section located
in the properties’ panel once the tag has been selected from the I/O
Data Server's Alarms tab.
The Command section offers five options:
We will now create an example to show you how this works.
Once you have started the software's editor and loaded, do as follows:
Name | boolTest |
Model Type | Variable |
Data Type | Boolean |
We shall now create an alarm:
Name | boolTestAlarm |
Alarm Type | Trip Alarm |
Activation Condition | Equals |
Activation Value di Attivazione | 1 |
Now that the tag and alarm have been created and configured, we shall associate the two elements:
At this point we will need to create a screen:
Now that the screen has been created, we can modify the project properties by entering the screen as the project's startup window. Therefore:
Once you have configured the project startup, click the 'Save All' button on the top toolbar to save the project.
Make sure that the Main screen is open, and click on the Toolbox
tab on the right of the editor, next to the Properties window, to
open the Toolbox library provided by Movicon.NExT.
Drag the Vertical Switch, which is found in the Toggle Switches folder
in the Switches folder, on screen. Associate the boolTest tag
to the object by dragging the tap onto the object.
Open the Toolbox library once again and drag and drop the Alarm Window
control, which is found in the Alarm Viewers folder, onto the Alarms
screen.
Expand the Scripts section in the project's structure presented
in the Project Explorer window. In this part of the application, we
will create VB.NET scripts and associate them to the alarm's states
so that they can be executed.
After having expanded and selected the Script option, right click and
select New to create a script.
Rename the script with Alarm On and double click it to start writing
code.
Once run, the script will display a popup showing a message that reflects
the action associated to the alarm state. When Alarm On, the script
will be:
Sub Main Handles .Main
MsgBox("boolTestAlarm ON")
End Sub
Once finished the script editing, return to the I/O Data Server
and select the boolTest tag associated to the boolTestAlarm alarm
in the Alarms section.
Click the three dots between the brackets corresponding to the ‘Commands
when On’ option in the properties window to configure the action to
be executed.
In the Commands pane, which shows at the bottom of the editor, select
Run Script from those available in the list and associate the Alarm
On script to the Script Name field by clicking on the dots and selecting
it from the folder that shows.
Save the project by clicking on the Save All icon found in the toolbar at the top of the Movicon.NExT editor.
We
will now test what we created above in runtime by clicking on the
Start Runtime icon.
Once the application has started up showing the screen, it is possible
to click on the switch to change the boolTest tag value from 0 to
1. In this condition, the alarm associated to the tag will activate
and consequently the Message Box associated to the On command configured
in the Alarm On script should appear.