Allows you to define the name of the file that contains the user alarm texts generated by application using the ALARM_SET instruction. If it is not defined the default texts (English) will be displayed.
From RTE 34.20.3 this file is also used to configure messages generated via the AH_LOG instruction (see alarm history).
Syntax |
USER_ALARM_FILE "filename" |
---|---|
filename |
Name of the file that contains the alarm texts (including the path where it is located on the flashcard) |
Diagnostics |
File open error is reported if either it does not exist or there is not enough memory or the file contents are incorrect |
WARNING: This keyword is automatically generated by project configurator.
Project Configurator --> General --> Alarms --> User Files
Example
USER_ALARM_FILE “/FA/alarm_user.txt” |
File Structs
Syntax |
nnnn iAM iB flags “text” p1k p2k p3k |
---|---|
nnnn |
User alarm number: •major: 1000-:-1999 •minor: 3000-:-3999 •warnings: 4000-:-8999 •messages: 10000-:-11999 |
iAM |
AM variable index to be used: •-1 Axis alarm, the axis number will be used as the index of AM (1÷32). If you do not want the alarm to also be stored in the AMs put index -1 in the next parameter (iB). •0 Used necessarily in the case of messages •37÷40 Major user alarms (1000÷1999) •45÷48 Minor user alarms (3000÷3999) •53÷63 User warnings (4000÷8999) |
iB |
Selection of the bit associated with the alarm: •-1 Disables alarm storage within AM. Also used necessarily in the case of messages •0÷9 If iAM=-1 (i.e., axis alarm) Bits reserved for system for major alarms (stored as such in ax_in_alarm parameter). If iAM<>-1 Bits available to user •10÷15 If iAM=-1 (i.e., axis alarm) Bits reserved for user for major alarms (stored as such in ax_in_alarm parameter). If iAM<>-1 Bits available to user •16÷23 If iAM=-1 (i.e., axis alarm) Bits reserved for minor axis alarms. If iAM<>-1 Bits available to user •24÷31 If iAM=-1 (i.e. axis alarm) Bits reserved for warnings (warnings). If iAM<>-1 Bits at user disposal |
flags |
Descriptive mask of alarm or message type (for exclusive use of alarm history). For meaning of individual bits refer to documentation of predefined variable ah_filter) |
text |
Alarm or message text. Maximum size is 60 characters; up to three variables can be specified for display (see instruction R3 alarm_set). Codes to identify variables are as follows: •%d Integer variable signed - Decimal representation •%u Integer variable unsigned - Decimal representation •%x Integer variable - Hexadecimal representation •%f Real variable •%g Real variable •%s String variable. In this case, if the string is a tabstr type, the construct must be added to the file: TABSTR_USER n ; maximum number of elements in the table. "string 1" ; this is index 0 "string 2" ; this is index 1 "string n" ; this is index n-1 ENDTAB Refer to the str_format instruction specification for more information regarding the formalism |
p1k,p2k,p3k |
Type of parameter(s) 1/2/3: (optional) •0 No parameter(s) •-1 I8 •1 U8 •-2 I16 •2 U16 •-4 I32 •4 U32 •8 Real •10 TID (internal use only ) (%s) •11 PowerSet name (%s) •12 PowerSet Axis (%d) •15 User string (TABSTR) (%s) •17 User string variable USV (%s) |
Example
; alarms_user.txt file on /FA/. 1000 37 0 0x02000100 "the value of R 10 is:[%d]" -4 1001 37 1 0x02000100 "the value of R 11 is:[%d]" -4 1002 37 2 0x02000100 "the value of R 12 is:[%d]" -4 10001 0 -1 0x01000000 "This is a message!" ;0x02000000 If re-generation of the alarm is desired if the value of the parameter is changed ;0x00000100 because user alarm ;0x01000000 because it is a message
;from program R3: alarm_set(1000,0,R(10)) ; R(10) is 123 ;from shell RDE3: command: D AL ; display alarm stack answer: 1000 the value of R 10 is:[123]
;from program R3: ah_log(10001) ;from shell RDE3: command: alh ; display alarm history answer: 19/07/17 09:43:30 <10001> '10001 This is a message!' |
Example
; alarms_user.txt file on /FA/.
TABSTR_USER 10 ; nItems maximum number of elements in the table "tortellini" ; this is index 0 "dumplings" ; this is index 1 "salad" ; this is index 2 ENDTAB ; alarms 6000 -1 -1 0x22000100 "I ate '%s' today. I am full!" 15 0 0 Note: ;0x02000000 If re-generation of the alarm is desired if the value of the parameter is changed. Note: ;0x00000100 because user alarm. ;from program R3: _if(rise(r(100).0)) alarm_set(6000,0,0) _if(rise(r(100).1)) alarm_set(6000,0,1) _if(rise(r(100).2)) alarm_set(6000,0,2)
;from shell RDE3: als Content stack alarms Visualization of 3 out of 32 alarms als( 1) ac=6000 '6000#0 I ate 'salad' today. I am full!' als( 2) ac=6000 '6000#0 I ate 'dumplings' today. I am full!' als( 3) ac=6000 '6000#0 I ate 'tortellini' today. I am full!' |