2-611
2 Instruction Descriptions
NJ-series Instructions Reference Manual (W502)
System Control Instructions
2
SetAlarm
The SetAlarm instruction generates the user-defined error that corresponds to event code Code. Event
codes are defined in the event setting table on the Sysmac Studio. The time of occurrence, event name,
event group, event code Code, event level, additional information Info1, additional information Info2, and
detailed information are stored in the user event log area that corresponds to the level of the event
code. The value for the time of occurrence is automatically obtained. The event name, event group, and
detailed information that are set from the Sysmac Studio are recorded. The event level that corresponds
to the event code is recorded. The event levels are given below. The smaller the event code is, the
higher the event level is.
The following figure shows a programming example. A user-defined error with event code 101 is gener-
ated. The values of variables abc and def are stored as attached information.
You can specify either global variables or local variables for Info1 and Info2.
• Up to 32 user-defined errors can be generated in each of the eight event levels (for up to 256 user-
defined errors total).
Function
Event code Classification: User fault level
1 to 5000 1
5001 to 10000 2
10001 to 15000 3
15001 to 20000 4
20001 to 25000 5
25001 to 30000 6
30001 to 35000 7
35001 to 40000 8
Related System-defined Variables
Name Meaning Data type Description
_AlarmFlag Error Status of User-
defined Errors
WORD These flags indicate when user-defined errors are
detected.
Bit 0 to bit 7 indicate the status of user-defined
error levels 1 to 8.
Refer to the NJ-series CPU Unit Software User's
Manual (Cat. No. W501) for details.
Additional Information
Precautions for Correct Use
SetAlarm(UINT#101, abc, def);
LD
UINT#101
abc
def
ST
SetAlarm
EN ENO
Code
Info1
Info2