Applies To:
  • CitectSCADA
  • CitectHMI

Summary:
How do I implement audible alarms using DspPlaySound() function instead of using the CSV_AlarmClient event.  I want to produce various sounds based on alarms of various priorities (as per CSV_AlarmClient functionality) and I want to be able to silence the alarm sound as well.  
 

Solution:
For this example we will assume there are only two alarm priorities and hence two different sounds are used.
First create a digital type tag (let's call it 'SILENCE'). Create Cicode as per below example. Then in your Alarm Categories form in the 'ON Action' field you call the function MySound . So if you need to silence the alarm you can use this SILENCE tag.

Looking at the Cicode below, you would also already have two different sound files (high.wav and low.wav) placed directly under C directory.

So for the first alarm category, in the 'Alarm Categories' form in the 'ON Action' field...you would call the function MySound("LOW")
And for the second alarm category, in the 'Alarm Categories' form in the 'ON Action' field...you would call the function MySound("HIGH")

FUNCTION
MySound(
STRING sSoundType)

IF SILENCE <> 1 THEN

    SELECT CASE sSoundType

    CASE "HIGH"
    DspPlaySound("C:\high.wav",0);

    CASE "LOW"
    DspPlaySound("C:\low.wav",0);

    END SELECT

END

END

 

Keywords:
audible alarms, sound, DspPlaySound, CSV_AlarmClient  

Attachments