If both pressing and releasing a control element is intended to trigger an action (e.g. press » drive, release » stop), a control element is used that can pass both events to an operator station event processor (calculation that can be created for a page). In the example, a dead man switch is to be created. The content in the calculation can of course be freely adapted to the needs of the respective project if a different reaction is desired.
(Also note the new function of the State Button Control: Return button.)
To implement a dead man feature, you need to have a control element on your PC that allows a response to both pressing and releasing. I used the “Microsoft Forms 2.0 CommandButton” control element to do this. First of all, please check with Elvis (Edit>Insert Control Element…) whether you can find this Control Element on your PC.
1. Please create the data point you want to switch in the data point list (I use the data point “TotMannSchalter” in this example).
2. Insert the Microsoft Forms 2.0 CommandButton control into a page.
3. Set the name of the control element with the properties dialog>Control Element>Name (I use “TotMannKontrollelement”).
4. Open the editor for processing the event of the page (properties dialog of the page>Events…).
5. Select the control element with the name “TotMannKontrollelement” in the left-hand selection option.
6. Select the “MouseDown” event in the right-hand selection.
7. Enter the following program code there (the 1st and 3rd lines are created automatically, you only need to enter the 2nd line!):
CODE:vb:Sub TotMannKontrollelement_MouseDown(ByVal Button As Integer, ByVal Shift As Integer,ByVal X As Single,ByVal Y As Single)
Database.Datapoint(“TotMannSchalter”). NominalValue = True
End Sub //CODE
8. Select the “MouseUp” event in the right-hand selection.
9. Enter the following program code there (some parts are created automatically):
CODE:vb:Sub TotMannKontrollelement_MouseUp(ByVal Button As Integer,ByVal Shift As Integer,ByVal X As Single,ByVal Y As Single)
Database.Datapoint(“TotMannSchalter”). NominalValue = False