Product: | Elvis |
Version: | all |
Booth: | 2001-11-19 |
Summary
To play a sound file, an event (change in the DP value) is reacted to with PlaySound in the project properties dialog.
Details
1. Open the event processing of the operator station with operator station/events… (context menu).
2. The editor opens, where the source code can be entered.
3. Select Form (left) and DatapointChanged (right).
4a. Insert the program (plays the wav file on each alarm) (download script):
//CODE:vb:Sub Form_DatapointChanged(ByVal DP As Object, ByVal prop As String)
If DP.AlarmState = Asc("A") And prop = "AlarmState"Then
Application.PlaySound "alarm.wav", &H00020001 ' oder &H00020009 für Endloswiederholung
End If
End Sub //CODE
4b. Insert the program (only plays different wav files for certain alarm data points) (download script):
//CODE:vb:Sub Form_DatapointChanged(ByVal DP As Object, ByVal prop As String)
If DP.AlarmState = Asc("A") And prop = "AlarmState"Then
If DP.Name = "Alarm" Then
Application.PlaySound "alarm.wav", &H00020001 ' oder &H00020009 für Endloswiederholung
ElseIf DP.Name = "Alarm2" Then
Application.PlaySound "xyz.wav", &H00020001
End If
End If
End Sub //CODE
Attention, do not copy the program directly from this page (html code!), but use the download!
5. Close the editor (the program will be saved automatically).
Note: The program runs on the operator stations and does not load the server. The wav files must be located in the directory of the ElvisRun .exe.