Wonderware Playsound based on priority

djcarter

Member
Join Date
Sep 2014
Location
Tennessee
Posts
21
Hello, Im trying to modify the script for our alarm playsound file to only play when priority of an alarm is 1-3 and not whent he priority is 4. We are using a Condition Script with the condition box (Evaporators.Unack OR Steam.UnAck) AND AlarmArea == "Evap. with the script being PlaySound("C\\soundfile.wav", 1);

I want a IF priority = 1,3 Then Playsound("C\\soundfile.wav",1);

What is the language for choosing the priority? When I click validate it keeps asking to define priority. There has to be a way to choose priority for the Unack file right?

Thanks in advance for your time,

version 10.5 windowmaker

DJ
 
Last edited:
Short of doing the work for you i will point you in the right direction.You need to return the .AlarmPri number through a getproperty script.

Search the following in the intouch documentation

GetPropertyM()
.AlarmPri

The line should look something like this.(From Intouch Help file)

If used in a Touch Pushbutton QuickScript, this statement returns the alarm priority to the almPrilvl tag.

GetPropertyM("AlmObj_1.AlarmPri",almPrilvl);

Where AlmObj_1 is the name of the Distributed Alarm Display object and almPrilvl is a memory message tag containing the priority level of the tag associated with the selected alarm.

This should give you a value to compare to in an IF..then statement.

To open a random file you can use the StartApp() function.

Replace the <> with your relevant execution data.

RunAppl = "<media player .exe> <filelocation>";
StartApp RunAppl;

Keep in mind it will keep it open in the background you may need to look at closing the Application in a controlled fashion as well.

For that you can look into the WWControl() function.

Good luck and be sure to post your script back here so we can try and help.
 
I have been looking over this and short of re-programming what is already there I do not know how else to tweak it to do what I want. We are currently using a conditional script as following:

Condition: (Evaporators.Unack OR Sewer.UnAck OR Steam.UnAck) AND AlarmArea == "Evap"

Comment: Audible Alarm

Script: PlaySound("C:\Windows\Media\AlarmSound3.wav",1);


We have 4 alarm priorities set to our tags. 1 being highest priority and 4 least priority. We want the priority 4 alarms to only show on a status screen which I have created and we do not want an audible alarm for these low priority alarms. Originally when the system was programmed we did not have these priorities set. Now after the alarms have been rationalized we would like to implement the changes. I understand somewhat of Rhienhardts reply. But since we do not use a pushbutton for this script I assume I could make the getproperty execute via a condition? If the unack alarm is true then both conditions would happen at the same time. I need a condition script that executes before my .unack condition takes place I assume. I may need to just scrap the original conditonal script all together. What do you folks think?
 
Still digging into the InTouch help files. Im hoping there is a way to create a discrete value from the alarm priority to create another tag to use. Question though is what if you have 2 alarms with different priorities that occur simultaneously. So if I was to use GetPropertyI("AlmObj_1.PriFrom",MinPri); and define this MinPri as a memory integer then I could possibly feed an IF MinPri < 4 THEN playsound...... This is only for the current query though. Ugh I know the answer is so easy. I will figure this thing out.
 
I am back. I still haven't been able to figure out how to get a script for what I am wanting this to do. I had read another post that had set up a different alarm group for low priority alarms. The only issue with this is that I have super tags with more than 1 priority assigned to tags under them. For example: a pressure transmitter with hihi hi lo lolo. Cant assign them seperate from the supre tag alarm group I dont think. This would be epic if that was allowable.

Anyone out there have some more insight on a script based on the condition of a unack alarm? I am thinking if I can get a discrete value from the .unack alarm condition then I can include it in the condition for playsound. The only built in script I see for getting priorities is only for alarm_Obj, which is a getproperty. But this is only ran when you click a button to return a priority off of a alarm viewer.
 
Hi i tried this playsound. but it freezes the screen during runtime. I checked my cpu and ram usage but they are not on peak value.
 

Similar Topics

need help Playsound() command freeze during runtime. Or is there any alternative solution to play sound from a player like Windows media player or...
Replies
1
Views
4,523
Hi guys, I have experience with PLC to Excel etc...just starting on using intouch scada screens. I have an Excel sheet that uses mainly...
Replies
1
Views
121
Hello everyone, Recently, my Archestra IDE shut down while I was editing. After restarting the IDE, I noticed warning symbols under my opened...
Replies
1
Views
94
Good morning all. I'm working on a rehab where they had a standalone InTouch 2014 HMI that they called a SCADA, but it's really basic stuff. The...
Replies
4
Views
165
Hi, We are setting up an Aveva Plant SCADA node with the intention to connect it to a Wonderware Historian node. Everywhere I look online I see...
Replies
1
Views
156
Back
Top Bottom