Reads the detailed information of currently arising CNC alarms.
Various information is stored in "data" of ALMINFO.
This function is used for displaying the alarm numbers or messages of the currently arising alarms by the application program, etc.
When CNC falls into the system alarm, it is completely impossible to communicate data between MMC and CNC, and the alarm information cannot be acquired.
MTConnect Fanuc Adapter
#include "fwlib32.h" or "fwlib64.h"FWLIBAPI short WINAPI cnc_rdalminfo(unsigned short FlibHndl, short type, short alm_type, short length, ALMINFO *alarminfo);
Arguments
FlibHndl
[ in ]
Specify the library handle. See "Library handle" for details.
type
[ in ]
Specify the type of output format.
0
:
Alarm information 1 (without message)
1
:
Alarm information 2 (with message)
alm_type
[ in ]
Specify the type of alarm.
Series 15/15i
0
:
Background P/S
(BG)
1
:
Foreground P/S
(PS)
2
:
Overheat alarm (only Series 15)
(OH)
3
:
Sub-CPU error (only Series 15)
(SB)
4
:
Syncronized error
(SN)
5
:
Parameter switch on
(SW)
6
:
Overtravel,External data
(OT)
7
:
PMC error
(PC)
8
:
External alarm message
(EX)
9
:
(Not used)
10
:
Serious P/S
(SR)
11
:
(Not used)
12
:
Servo alarm
(SV)
13
:
I/O error
(IO)
14
:
Power off parameter set
(PW)
15
:
(Not used)
16
:
External alarm message (2) (only Series 15i)
(EX)
17
:
External alarm message (3) (only Series 15i)
(EX)
18
:
External alarm message (4) (only Series 15i)
(EX)
19
:
Macro alarm (only Series 15i)
(MC)
20
:
Spindle alarm (only Series 15i)
(SP)
Series 16/18/21, 16i/18i/21i, 0i-A/B/C, Power Mate i
0
:
P/S100
1
:
P/S000
2
:
P/S101
3
:
P/S alarm except above
4
:
Overtravel alarm
5
:
Overheat alarm
6
:
Servo alarm
7
:
(Not used)
8
:
APC alarm
9
:
Spindle alarm
10
:
P/S alarm(No.5000,..), Punchpress alarm
11
:
Laser alarm
12
:
(Not used)
13
:
Rigid tap alarm
14
:
(Not used)
15
:
External alarm message
Series 16i/18i-W
0
:
P/S alarm
1
:
Overtravel alarm
2
:
Servo alarm
3
:
(Not used)
4
:
Overtravel alarm
5
:
Stroke limit - 1
6
:
Stroke limit - 2
7
:
Edit alarm
8
:
APC alarm
9
:
(Not used)
10
:
P/S 5000 ... alarm
11
:
(Not used)
12
:
(Not used)
13
:
(Not used)
14
:
External alarm message
15
:
Reverse control alarm
Series 30i, 0i-D/F, PMi-A
0
:
Parameter switch on
(SW)
1
:
Power off parameter set
(PW)
2
:
I/O error
(IO)
3
:
Foreground P/S
(PS)
4
:
Overtravel,External data
(OT)
5
:
Overheat alarm
(OH)
6
:
Servo alarm
(SV)
7
:
Data I/O error
(SR)
8
:
Macro alarm
(MC)
9
:
Spindle alarm
(SP)
10
:
Other alarm(DS)
(DS)
11
:
Alarm concerning Malfunction prevent functions
(IE)
12
:
Background P/S
(BG)
13
:
Syncronized error
(SN)
14
:
(reserved)
15
:
External alarm message
(EX)
16
:
(reserved)
17
:
(reserved)
18
:
(reserved)
19
:
PMC error
(PC)
length
[ in ]
Specify the length of the data block(size of ALMINFO user define type)
Series 15/15i:maximum axis<=15 or Series 16/18/21, 16i/18i/21i, 0i-A/B/C, Power Mate i
N is the number of messages to be read.
Series 15/15i:maximum axis=24
Series 30i, 0i-D/F, PMi-A:
N is the number of messages to be read.
alarminfo
[ out ]
Pointer to the ALMINFO structure including the alarm information.
The ALMINFO structure is as follows.
typedef struct alminfo {
#if MAX_AXIS > 16 /* Series 15/15i : maximum axis=24 */
/* Series 30i, 0i-D/F, PMi-A */
union {
struct {
struct {
long axis ; /* Axis information */
short alm_no ; /* Alarm number */
} alm[N] ;
long data_end ; /* data end */
} alm1 ;
struct {
struct {
long axis ; /* Axis information */
short alm_no ; /* Alarm number */
short msg_len ; /* Message length */
char alm_msg[32] ; /* Alarm message */
} alm[N] ;
long data_end ; /* data end */
}alm2 ;
} u ;
#else
union {
struct {
struct {
short axis ; /* Axis information */
short alm_no ; /* Alarm number */
} alm[N] ;
short data_end ; /* data end */
} alm1 ;
struct {
struct {
short axis ; /* Axis information */
short alm_no ; /* Alarm number */
short msg_len ; /* Message length */
char alm_msg[32] ; /* Alarm message */
} alm[N] ;
short data_end ; /* data end */
}alm2 ;
} u ;
#endif
} ALMINFO ; /* N : number of messages to be read. */
axis
Axis information is stored.
The generation of the alarm of each axis is shown with ON/OFF of bit.
As for the none axis-type alarm, all bits are set 0.
When this data is '-1', the data end is shown.
Series 15/15i:maximum axis<=15 or Series 16/18/21, 16i/18i/21i, 0i-A/B/C, Power Mate i
#15
:
Always 0
#14
:
The 15th axis alarm
#13
:
The 14th axis alarm
:
#01
:
The 2nd axis alarm
#00
:
The 1st axis alarm
Series 15/15i:maximum axis=24
#24,..,31
:
Always 0
#23
:
The 24th axis alarm
#22
:
The 23th axis alarm
:
#01
:
The 2nd axis alarm
#00
:
The 1st axis alarm
Series 30i, 0i-D/F, PMi-A
#31
:
The 32th axis alarm
#30
:
The 31th axis alarm
:
#01
:
The 2nd axis alarm
#00
:
The 1st axis alarm
alarm_no
Alarm number (binary) is stored.
For Series 15/15i, The first 2 bits(#15,#14) is as follows.
#15
:
Macro alarm
#14
:
alarm for path 2 of TT system
(Alarm number can be acquired by masking these bits.)
msg_len
Message length(binary) is stored. (1 to 32)
alm_msg
Alarm message character string is stored.
The message is acquired in the following character-codes.
English
:
ASCII
Japanese
:
Shift-JIS
Simplified Chinese
:
Shift-JIS
Traditional Chinese
:
GB2312
Korean
:
Code Page 949
Cyrillic
:
Code Page 1251
Turkish
:
Code Page 1254
Others European
:
Western Europe
Note1) In CNC except Series 30i, 0i-D/F and PMi-A, messages except English and Japanese cannot be correctly acquired.
Note2) Korean cannot be correctly acquired with FOCAS2/Ethernet.(Except 30i-B, 0i-D/F and PMi-A)
data_end
(unused)
Return
EW_OK is returned on successful completion, otherwise any value except EW_OK is returned.
The major error codes are as follows.
Return code
Meaning/Error handling
EW_LENGTH (2)
Data block length error
Size of ALMINFO structure (length) is wrong.
EW_NUMBER (3)
Data number error
The type of output format (type) is wrong.
EW_ATTRIB (4)
Data attribute error
The specification of alarm type (alm_type) is wrong.