AdvancedHMI Software
General Category => Feature Request => Topic started by: sts69 on September 22, 2013, 08:18:48 PM
-
Hallo,
can play a Sound like "Alarm.wav" if the value from modbus tcp tag = 1 ?
I need this for audible Alert .
thank you
-
One way to do this is to add a DataSubscriber to the form and set the PLCAddressValue. Double click the DataSubscriber and add this code:
if DataSubscriber1.Value="1" then
My.Computer.Audio.Play("c:\alarm.wav")
End if
-
Ohh, very fast :-)
i will test this tomorrow.
Thank You
-
Hallo Archie,
i have tray this:
Private Sub DataSubscriber1_DataChanged(sender As Object, e As Drivers.Common.PlcComEventArgs) Handles DataSubscriber1.DataChanged
If DataSubscriber1.Value = "1" Then
My.Computer.Audio.Play("c:\Advanced HMI 2\AdvancedHMI\Resources\Alarm.wav")
End If
End Sub
but is no Sound playing after change the value from 0 to 1 :-(
THX
Steffen
-
Put a break point at the first line "If DataSubscriber...." by clicking in the margin to the left. You will get a red dot to indicate the breakpoint. The run the application to see if the event fires.
-
can you hereby do something?
-
It is definitely firing the event. When it reaches the breakpoint, hover the mouse over .Value and see what it equals at that point.
Then step through the code (F8 or F11 depending on your Visual Studio version) to see if it executes the play.
-
yes thank you. the tip was great :-)
the value is retrieved correctly ("True" or "False"). I have modified then the value from "1" to "True", this Make it work. Simple!
many thanks again
Steffen