AdvancedHMI Software
General Category => Tips & Tricks => Topic started by: Archie on June 27, 2013, 07:07:52 PM
-
The MessageDisplayByValue has a property named SpeakMessage. If this is set to true, then each time there is a new message, it will be spoken through the PC speakers. If you wish to get creative, you can find various voices for download on the internet.
-
Does this control allow the adding of alarms from a file at runtime?
-
The MessageDisplayByValue has a property named INIFileName that is used to set up alarms from a text file. This is an example of how the file is formatted:
0,CONTROL OFF
1,20F6/ 24VDC SUPPLY POWER OFF
2,20F8/ 24VDC SUPPLY POWER OFF
3,EMERGENCY STOP
4,46Q1/ CIRCUIT BREAKER FEEDER
This is how I typically use the file feature:
1) Add a text file to the project and name it Alarms.txt
2) Type in the alarms as shown above
3) Set the INIFilename to .\alarms.txt
4) Then set the property "Copy to output directory" of the text file to Copy if Newer
-
Thanks Archie, that works nicely.
I also added the code from another thread to log the alarms on a text change event and for some reason it logs data almost continuously. Any ideas why the textchange event would trigger without the text changing?
-
I also added the code from another thread to log the alarms on a text change event and for some reason it logs data almost continuously. Any ideas why the textchange event would trigger without the text changing?
I found a problem with the way it built the message that caused the event to fire every time data was returned from the PLC. I put in a fix for the next release.
-
I realize this thread is a couple months old but was wondering if I am doing something wrong.
I have the message speaking to me, but.. it appears that it is storing triggers each time it gets data from the plc (using modbustcp if that makes any difference) and will repeat the same message as long as it takes to speak it as many times as it was triggered from the plc even though the plc may have changed the value and a new message is now supposed to be heard.
The text for the message changes instantly as it should but it continues to speak the old message until it goes through the number of times it received it from the plc then starts speaking the new message the number of times it was received! I can see where in a very short time it could take forever to go through the numbers of triggers that are stored... Any ideas?
Fun stuff!!
-
I have the message speaking to me, but.. it appears that it is storing triggers each time it gets data from the plc (using modbustcp if that makes any difference) and will repeat the same message as long as it takes to speak it as many times as it was triggered from the plc even though the plc may have changed the value and a new message is now supposed to be heard.
The text for the message changes instantly as it should but it continues to speak the old message until it goes through the number of times it received it from the plc then starts speaking the new message the number of times it was received! I can see where in a very short time it could take forever to go through the numbers of triggers that are stored... Any ideas?
I'm not sure if there is a way around this. The voice messages run asynchronously and cued up, so if your messages change faster than they can be spoke, it will become an issue.
I will test some things out to see if I can resolve this
-
how to use the speak thing?
how to set it up ?
-
how to use the speak thing?
how to set it up ?
All you really need is this:
Private Sub Alarm_Speech()
Dim SAPI = CreateObject("SAPI.spvoice")
SAPI.Speak(alarmName)
End Sub
"AlarmName" is the string/text
-
In the MessageDisplayByValue, set the SpeakMessage property to True.
-
I set it to true
Now i have file alarm1.mp3 i want it to play when alarm value is 1
How should i write the code?
-
You want the SoundPlayer component. That plays a file on a bit to trigger it.