MakeAlarmRecordSpeechFile
(Alarm Manager module)
AlarmRecord |
Required An Alarm Record Structure to be used as the basis for voice file generation |
pVoiceFilename |
Required text. (Pointer) Holds the voice filename - Return variable. |
pVoiceLength |
Required numeric. (Pointer) Holds the length of the voice file in seconds - Return variable. |
pVoiceReady |
Required Boolean (Pointer) Set to TRUE when voice file generation is complete - Return variable. |
Template |
Optional text. Speech template. (See More Information... later in this topic) |
pError |
Optional Boolean (Pointer) Error pointer - Return variable. |
Comments: |
It also works out the length of the audio file. If the voice file fails to generate, then use the default voice file. The .wav file audibly speaks the alarm. Wait for VoiceReady to be TRUE before playing VoiceFileName |
Example:
Init [ If 1 Wait; [ \AlarmManager.MakeAlarmRecordSpeechFile(AlarmRecord, &VoiceFilename, &VoiceLength, &VoiceReady, "This alarm is in area %A" {Template}, &Error); ] ] Wait [ If VoiceReady PlayAlarm; If Error Done; ] PlayAlarm [ If TimeOut(1, VoiceLength + 0.5) Done; Play(VoiceFilename, 0b10011, TRUE); ] Done [ . . . ]
More Information: Using Alarm Templates or Control Strings with Tokens
Control the content of alarm messages by defining templates using application properties. If added to your Settings.Dynamic file, the templates are used by all alarms in the application. You can also add templates to Context tags for use by alarms within a site or other user-defined tag structure.
You can define a separate template for each of:
Template name | Used for... |
---|---|
Section 1: Alarm message templates | |
AlarmDialerTemplate | Telephone alarm descriptions. The initial greeting is not set by a template. You can set the spoken name in the greeting using the Alarms tab of the Edit Properties dialog. |
AlarmEmailTemplate | Emailed alarm descriptions. Does not apply to SMS-ready emails. |
AlarmPagerTemplate | Paged alarm descriptions. |
AlarmSMSTemplate | Descriptions of alarms when sent by SMS message including SMS-ready email. |
AlarmSpeechTemplate |
Locally spoken alarm descriptions |
Section 2: Alarm status templates. If DialOnClear is enabled, the status will be appended to the message. Does not apply to locally spoken alarms. | |
AlarmDialerStatusTemplate | Alarm status appended to telephone messages. |
AlarmEmailStatusTemplate | Alarm status appended to emailed alarms. |
AlarmPagerStatusTemplate | Alarm status appended to paged alarms. |
AlarmSMSStatusTemplate | Alarm status appended to SMS alarms, including SMS-ready emails. |
Section 3: Additional email and SMS templates | |
AlarmEmailAckTemplate | Message confirming alarm acknowledgment by email. |
AlarmEmailAckSubjectTemplate | Subject line for alarm acknowledgment by email. |
AlarmEmailAckCollisionTemplate | Emailed message to operators, informing them that the code they used acknowledged more than one alarm. |
AlarmSMSAckTemplate | Message confirming alarm acknowledgment by text. |
AlarmSMSAckCollisionTemplate | Text message to operators, informing them that the code they used acknowledged more than one alarm. |
In addition to these, you may set the subject line for alarm emails using the property, AlarmEmailSubjectTemplate.
Format control strings take the form: TemplateName = control string,
The control string can be a combination of words and the following replaceable parameters. Note that the pause can add clarity to the message by separating words that might otherwise run together when spoken.
Token |
Meaning |
---|---|
%A |
Area of the Alarm tag. |
%C |
Custom data provided by the application. (See following notes.) |
%D |
Date of the alarm |
%F | Full tag name |
%H | Short tag name |
%K |
Station number (Part of every Polling driver, and Station type. Context tags used as site must be given a property named "Stn", in which the station number may be stored.) |
%L |
Opt-out message. This is be used only with SMS and EMail templates The message is stored with the language phrase key AlarmOptOutMsg and defaults to: |
%M |
Alarm description |
%N |
New sentence for email and pager messages. |
%O | Operator |
%P |
Priority of the alarm. |
%S | Status of the alarm |
%T |
Time of the alarm |
%U |
Units of the Triggering tag. |
%V |
Alarm value (this is the value of the alarm trigger at the time that it triggered the alarm) |
%W |
Pause for ¼ second. Has no effect on email or pager messages. |
%Z | Setpoint. |
Value (%V) and Setpoint (%Z) will use the labels corresponding to these values as stored in the record where applicable. If no labels can be found, the raw numbers will be used.
The %C token in a template can only obtain numeric and text values, not complex values. If a numeric or string value that exists inside a complex value needs to be included in an alarm notification, an AlarmTemplateHookC module will need to be created that returns this value.
The Custom field can be set in a variety of ways:
- In the Commission() call via the Custom field of the Alarm Configuration record.
- In the EvaluateAlarm() call via the Custom parameter
- In any Alarm<Action>Hook module by setting the Custom field of the TransactionInfo structure.
Examples:
AlarmSpeechTemplate = %P alarm. %T, %M
Speaks (for example): "Critical alarm. 10:35 pm, Well level high"
AlarmSpeechTemplate = VTScada %P alarm in %A %W %M has reached %V at %T.
"VTScada critical alarm in zone one <pause> Holding tank level has reached eighty at eleven forty nine a. m.".