Description
Reads the operation history data.
Please use this function instead of cnc_rdophistry function for Series 30i, 0i-D/F and PMi-A.
The structure of the operation history data is different according to the kind of the record.
The operation history data and the alarm history data are automatically recorded on the CNC.
Kind of these data are accessed, it is necessary to temporarily stop sampling on the CNC.
Therefore, it is necessary to execute "Stop logging operation history data"(cnc_stopophis) before this function is used.
The start/end record number means the relative number used at reading the operation history data.
These record numbers are valid only at the period from the execution of "Stop logging operation history
data"(cnc_stopophis function) until the execution of
"Restart logging operation history data"(cnc_startophis function).
Universal Fanuc Driver
Fanuc Focas Library CD
Declaration
Arguments
Specify the library handle. See "Library handle" for details.
Specify the start record number.(more than 1)
Specify the pointer to the end record number.(more than 1)
The last record number which was read actually is returned.
Specify the data block length which is enough to store the
specified operation history data.
One operation history data is set in the ODBOPHIS4 structure and
the size of the structure is represented by rec_len.
This structure is lined up in order of number of operation history data.
So, specify the sum of rec_len of these structures.
When the plural data is acquired, the second or later data is acquired just behind the previous data as follows. (It is not the order of the array of a structure.)
When you read the second or later data, calculate the pointer which adds data length (rec_len) to the top pointer of data immediately before.
Because the size of data which was read actually is returned,
it is possible to specify the length more than the actual size.
Using the ODBOPHIS4 structure can refer each operation history data.
typedef struct odbophis4 {
short rec_len; /* Length */
short rec_type; /* Record type */
union {
struct {
char key_code; /* Key code */
char pw_flag; /* Power-on flag */
short pth_no; /* Path number */
short ex_flag; /* External MDI key flag*/
short hour; /* Hour */
short minute; /* Minute */
short second; /* Second */
} rec_mdi; /* MDI */
struct {
short sig_name; /* Signal name */
short sig_no; /* Signal number */
char sig_old; /* Bit pattern before transition */
char sig_new; /* Bit pattern after transition */
short pmc_no; /* PMC number */
short hour; /* Hour */
short minute; /* Minute */
short second; /* Second */
short dummy;
} rec_sgn; /* Signal */
struct {
short alm_grp; /* Alarm type */
short alm_no; /* Relative axis number in the path or Relative spindle number in the path */
short axis_no; /* Axis number */
short year; /* Year */
short month; /* Month */
short day; /* Day */
short hour; /* Hour */
short minute; /* Minute */
short second; /* Second */
short pth_no; /* Path number */
} rec_alm; /* Alarm */
struct {
short evnt_type; /* Event type */
short year; /* Year */
short month; /* Month */
short day; /* Day */
short hour; /* Hour */
short minute; /* Minute */
short second; /* Second */
short dummy;
} rec_date; /* Date/Time */
struct {
short alm_grp; /* Alarm type */
short alm_no; /* Alarm number */
short axis_no; /* Absolute axis number or Absolute spindle number */
short year; /* Year */
short month; /* Month */
short day; /* Day */
short hour; /* Hour */
short minute; /* Minute */
short second; /* Second */
short pth_no; /* Path number */
short sys_alm; /* unused */
short dsp_flg; /* Flag for displaying */
short axis_num; /* Total axis number */
long g_modal[10];/* Modal data of G code */
char g_dp[10]; /* #7=1 There is a command in the present block. */
/* #6~#0 place of decimal point */
long a_modal[10];/* Modal data of B,D,E,F,H,M,N,O,S,T code */
char a_dp[10]; /* #7=1 There is a command in the present block. */
/* #6~#0 place of decimal point */
long abs_pos[32];/* Absolute position in alarm occurring */
char abs_dp[32]; /* Absolute position place of decimal point in alarm occurring */
long mcn_pos[32];/* Machine position in alarm occurring */
char mcn_dp[32]; /* Machine position place of decimal point in alarm occurring */
} rec_ial; /* Additional information alarm */
struct {
short alm_grp; /* Alarm type */
short alm_no; /* Alarm number */
short axis_no; /* Absolute axis number or Absolute spindle number */
short year; /* Year */
short month; /* Month */
short day; /* Day */
short hour; /* Hour */
short minute; /* Minute */
short second; /* Second */
short pth_no; /* Path number */
short sys_alm; /* unused */
short dsp_flg; /* Flag for displaying */
short axis_num; /* Total axis number */
char alm_msg[64];/* Alarm message */
long g_modal[10];/* Modal data of G code */
char g_dp[10]; /* #7=1 There is a command in the present block. */
/* #6~#0 place of decimal point */
long a_modal[10];/* Modal data of B,D,E,F,H,M,N,O,S,T code */
char a_dp[10]; /* #7=1 There is a command in the present block. */
/* #6~#0 place of decimal point */
long abs_pos[32];/* Absolute position in alarm occurring */
char abs_dp[32]; /* Absolute position place of decimal point in alarm occurring */
long mcn_pos[32];/* Machine position in alarm occurring */
char mcn_dp[32]; /* Machine position place of decimal point in alarm occurring */
} rec_mal; /* Additional information and message alarm */
struct {
short dsp_flg; /* Flag for displaying */
short om_no; /* Message number */
short year; /* Year */
short month; /* Month */
short day; /* Day */
short hour; /* Hour */
short minute; /* Minute */
short second; /* Second */
char ope_msg[256];/* Message */
} rec_opm; /* External operator's message */
struct {
short ofs_grp; /* Tool offset data type */
short ofs_no; /* Tool offset number */
short hour; /* Hour */
short minute; /* Minute */
short second; /* Second */
short pth_no; /* Path number */
long ofs_old; /* Tool offset data before transition */
long ofs_new; /* Tool offset data after transition */
short old_dp; /* Tool offset data place of decimal point before transition */
short new_dp; /* Tool offset data place of decimal point after transition */
} rec_ofs; /* Tool offset transition */
struct {
short prm_grp; /* Parameter data type */
short prm_num; /* Parameter number */
short hour; /* Hour */
short minute; /* Minute */
short second; /* Second */
short prm_len; /* Parameter data length */
long prm_no; /* Parameter number */
long prm_old; /* Parameter data before transition */
long prm_new; /* Parameter data after transition */
short old_dp; /* Parameter data place of decimal point before transition */
short new_dp; /* Parameter data place of decimal point after transition */
} rec_prm; /* Parametertransition */
struct {
short ofs_grp; /* Work offset data type */
short ofs_no; /* Work offset number */
short hour; /* Hour */
short minute; /* Minute */
short second; /* Second */
short pth_no; /* Path number */
short axis_no; /* Axis number */
short dummy;
long ofs_old; /* Work offset data before transition */
long ofs_new; /* Work offset data after transition */
short old_dp; /* Work offset data place of decimal point before transition */
short new_dp; /* Work offset data place of decimal point after transition */
} rec_wof; /* Work offset transition */
struct {
short mac_no; /* Custom macro common variable number */
short hour; /* Hour */
short minute; /* Minute */
short second; /* Second */
short pth_no; /* Path number */
long mac_old; /* Common variable data before transition */
long mac_new; /* Common variable data after transition */
short old_dp; /* Common variable data place of decimal point before transition */
short new_dp; /* Common variable data place of decimal point after transition */
} rec_mac; /* Custom macro common variable transition */
struct {
long mac_no; /* Custom macro common variable number(Extension) */
short hour; /* Hour */
short minute; /* Minute */
short second; /* Second */
short pth_no; /* Path number */
long mac_old; /* Common variable data before transition */
long mac_new; /* Common variable data after transition */
short old_dp; /* Common variable data place of decimal point before transition */
short new_dp; /* Common variable data place of decimal point after transition */
} rec_mac2; /* Custom macro common variable transition */
struct {
short scrn_old; /* Old screen number */
short scrn_new; /* New screen number */
short hour; /* Hour */
short minute; /* Minute */
short second; /* Second */
} rec_mac2; /* Change of screen(number) */
} u;
} ODBOPHIS4 ;
- rec_len
- Length of the ODBOPHIS4 structure
- rec_type
- Record type
0 : MDI key 1 : Signal 2 : Alarm 3 : Date/Time 4 : Custom macro common variable transition 5 : Parameter transition 6 : External operator's message 7 : Tool offset transition 8 : Work offset transition 9 : Additional information alarm 10 : Additional information and message alarm 11 : Custom macro common variable(Extension) transition 12 : Change of Screen(number) -1 : History data of unsupport - key_code
- Key code
- pw_flag
- Power-on flag
1 : For power on 0 : Usually, 0 is stored - ex_flag
- External MDI key flag
1 : External MDI key 0 : Usual MDI key - sig_name
- Signal name
1 : X 2 : G 3 : Y 4 : F - sig_no
- Signal number
X : 0,..,127 G : 0,..,767 Y : 0,..,127 F : 0,..,767 - sig_old
- Bit pattern before transition
- sig_new
- Bit pattern after transition
- alm_grp
- Alarm type
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 : Synchronized error (SN) 14 : (reserved) 15 : External alarm message (EX) 19 : PMC error (PC) 20 to 31 : (Not used) - alm_no
- Alarm number
- axis_no
-
- rec_type 2(Alarm), rec_type 9(Additional information alarm) and rec_type 10(Additional information and message alarm)
- The relative axis number(1,..,max controlled axes) in the path or the relative spindle number(1,..,max spindle number) in the path is set in this variable.
- When the flexible path axis assignment function is valid, the absolute axis number + 1000(1001,..,max controlled axis number + 1000) or the relative spindle number(1,..,max spindle number) in the path is set in this variable.
- (Absolute axis number or absolute spindle number 0 is stored for an unrelated alarm to the axis and the spindle.)
- rec_type 8(Work offset transition)
- The relative axis number(0,..,max controlled axes - 1) in the path is set in this variable.
- When the flexible path axis assignment function is valid, the absolute axis number + 1000(1001,..,max controlled axis number + 1000) is set in this variable.
- year
- Year (1995,..,2094)
- month
- Month (1,..,12)
- day
- Day (1,..,31)
- hour
- Hour (0,..,23)
- minute
- Minute (0,..,59)
- second
- Second (0,..,59)
- evnt_type
- Event type
0 : Power off 1 : Power on 2 : Change date 3 : Time stamp 4 : Erase history data - pth_no
- Path number(1,..,10)
- pmc_no
- PMC number(1,..,3)
- axis_num
- Total axis number(1,..,32)
- g_modal
- Modal G code of specified G code group at alarm occurring (nonexistence -1)
- Modal G code group number is specified by the parameter from No.12990 to No.12999.
- g_dp
- Place of decimal point of Modal G code (nonexistence -1)
-
#7=1 There is a command in the present block.
#6~#0 place of decimal point -
#7=0 There is not a command in the present block.
=1 There is a command in the present block. -
g_modal[0] ,g_dp[0]=parameter12990 : : g_modal[9] ,g_dp[9]=parameter12990 - a_modal
- Modal data of 2nd auxiliary function(prm3460),D,E,F,H,M,N,O,S,T code in alarm occurring(nonexistence -1)
-
a_modal[0] ,a_dp[0]=2nd auxiliary function code ,a_modal[1] ,a_dp[1]=D code a_modal[2] ,a_dp[2]=E code ,a_modal[3] ,a_dp[3]=F code a_modal[4] ,a_dp[2]=H code ,a_modal[5] ,a_dp[3]=M code a_modal[6] ,a_dp[2]=Sequence number ,a_modal[7] ,a_dp[3]=Promgam number or Program Name Note) a_modal[8] ,a_dp[2]=S code ,a_modal[9] ,a_dp[3]=T code -
Note) In case of program name, specify 5 charactors of head.
- a_dp
-
#7=1 There is a command in the present block.(nonexistence -1)
#6~#0 place of decimal point -
#7=0 There is not a command in the present block.
=1 There is a command in the present block. - abs_pos
- Absolute position in alarm occurring
- abs_dp
- Absolute position place of decimal point in alarm occurring
- mcn_pos
- Machine position in alarm occurring
- mcn_dp
-
Machine position place of decimal point in alarm occurring
*More than axis number is unused. - alm_msg
- Alarm message
- dsp_flg
-
Flag for message displaying
In case of the Macro alarm(alm_grp=8), the state of 6008#1 can be acquired.
In case of the External alarm message(alm_grp=15), the state of 6301#0 can be acquired.
In case of the External operator's message, the state of 6301#1 can be acquired.
* The status of a point at alarm occurring can get.
- om_no
- Message number
- ope_msg
- Message( null(\0) end)
- ofs_grp
-
Tool offset data type
- rec_type:7 In case of tool offset transition.(Kind of tool offset is set.)
-
0 : Tool offset (M series Memory A) 1 : Geometry offset 2 : Wear offset (M series Memory B) 3 : Tool length offset(geometry) 4 : Tool length offset(wear) (M series Memory C) 5 : Tool cutter radius offset(geometry) 6 : Tool cutter radius offset(wear) (M series Memory C) 7 : X-axis tool offset 8 : Z-axis tool offset (T series Memory A) 9 : X-axis tool offset(geometry) 10 : X-axis tool offset(wear) (T series Memory B) 11 : Z-axis tool offset(geometry) 12 : Z-axis tool offset(wear) (M/T series Memory B) 13 : Tool nose radius offset (M/T series Memory A) 14 : Tool nose radius offset(geometry) 15 : Tool nose radius offset(wear) (M/T series Memory A) 16 : Y-axis tool offset (T series Memory A) 17 : Y-axis tool offset(geometry) 18 : Y-axis tool offset(wear) (T series Memory B) 19 : Direction of tool nose (Common :M/T series(M series PRM5009#5=1)) 20 : X-axis second geometry offset 21 : Z-axis second geometry offset (T series ) 22 : Y-axis second geometry offset -
- rec_type:8 In case of work offset transition(Kind of work offset data is set.)
0 : Work offset(EXT,G54~G59) 1 : Work offset extension(G54.1P1~G54.1P300) 2 : Volume of work shift(Only T series) - ofs_no
-
Offset number
- rec_type:7 In case of tool offset transition, tool offset number(1,..,9999)
- rec_type:8 In case of work offset transition, work offset is as follows.
ofs_grp = 0 : 0=EXT,1=G54,2=G55,3=G56,4=G57,5=G58,6=G59 = 1 : 1,..,300 = 2 : Invalid - ofs_old
- Tool/Work offset data before transition.
- ofs_new
- Tool/Work offset data after transition.
- old_dp
- Place of decimal point before transition(*1)
- new_dp
- Place of decimal point after transition(*1)
- (*1) Data type is tool/work offset, parameter and custom macro common variable. When the variable value is custom macro common variable, refer to the "Note) In case of custom macro common variable".
- mac_old
- Custom macro common variable data before transition
- mac_new
- Custom macro common variable data after transition note) In case of custom macro common variable, shows data format=M*10**(-E)).
-
mac_old,mac_new : value of variable(=M) old_dp,new_dp : number of places of decimals(=E) (-128(0x80)~127(0x7f)) - When the variable value is 12.345, each variables are read as follows.
tdmcr_val = 1234500000 dec_val = 8 ? 1234500000*(10**(-8)) = 12.345 - When the variable value is 123456789012345, each variables are read as follows.
mcr_val = 1234567890 dec_val = -5 ? 1234567890*(10**5) = 123456789000000 - In case of "vacant":
mac_old,mac_new = 0?old_dp,new_dp = -1(0xff) - In case of overflow:
mac_old,mac_new = -1?old_dp,new_dp = -1(0xff) - prm_grp
-
Paramter data type(Kind of parameter data is set.)
1:Axis type, 2:Spildle type, 3:Path type, 4:Machine group type, 0:Other - prm_num
-
Parameter data type(prm_grp) is valid range from 1 to 4.
prm_grp=1 : Absolute number(1,..,MAX32)
prm_grp=2 : Absolute spindle number(1,..,MAX8)
prm_grp=3 : Path number(1,..,10)
prm_grp=4 : Machine group number(1,..,3) - prm_len
-
Parameter data length
0: BIT, 1:INT8, 2:INT16, 3:INT32, 4:REAL64 - prm_no
- Parameter number(0,..,99999)
- prm_old
- Paramter data befor transition
- prm_new
- Paramter data after transition
0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | |
---|---|---|---|---|---|---|---|---|
0 | SP | 0 | @ | P | ` | |||
1 | ! | 1 | A | Q | ||||
2 | " | 2 | B | R | ||||
3 | # | 3 | C | S | ||||
4 | $ | 4 | D | T | ||||
5 | % | 5 | E | U | ||||
6 | & | 6 | F | V | ||||
7 | ' | 7 | G | W | ||||
8 | ( | 8 | H | X | ||||
9 | TAB | ) | 9 | I | Y | |||
A | EOB | * | : | J | Z | |||
B | + | ; | K | [ | { | |||
C | , | < | L | \ | | | |||
D | - | = | M | ] | } | |||
E | . | > | N | ~ | ||||
F | / | ? | O | _ |
8 | 9 | A | B | C | D | E | F | |
---|---|---|---|---|---|---|---|---|
0 | RESET | [SKV9] | [F1] | |||||
1 | [SKV8] | [F2] | ||||||
2 | [SKV7] | [F3] | ||||||
3 | [SKV6] | [F4] | ||||||
4 | SHIFT | INSERT | [SKV5] | AUX | [F5] | |||
5 | DELETE | [SKV4] | [F6] | |||||
6 | CAN | ALTER | [SKV3] | [F7] | ||||
7 | ALT | [SKV2] | [F8] | |||||
8 | ? | INPUT | [SKV1] | POS | [F9] | |||
9 | ? | CALC | PROG | [F10] | ||||
A | ? | HELP | OFFSET SETTING | |||||
B | ? | CTRL | SYSTEM | |||||
C | ABC/abc | MESSAGE | ||||||
D | GRAPH | |||||||
E | Page? | CUSTOM | [FR] | |||||
F | Page? | CUSTOM2 | [FL] |
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 |
---|---|
(1) |
|
(2) |
Size of area to store the operation history data(length) is wrong. |
(3) |
The specification of the record number (s_no, e_no) is wrong. |
(6) |
The extended driver/library function is necessary. |
As for the other return codes or the details, see "Return status of Data window function"
CNC option
For HSSB connection,
This function needs the extended driver/library function.
CNC parameter
This function is related to the following CNC parameter.
See the manual of CNC parameter for details.
CNC mode
This function can be used in any CNC mode.
Available CNC
0i-A | 0i-B/C(Note) | 0i-D | 0i-F | 15 | 15i | 16 | 18 | 21 | 16i-A | 18i-A | 21i-A | 16i-B | 18i-B | 21i-B | 30i-A | 30i-B | |
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
M (Machining) | |||||||||||||||||
T (Turning) | - | ||||||||||||||||
LC (Loader) | - | - | - | - | - | - | - | - |
0i-D | 0i-F | 16i | 18i | 30i-A | 30i-B | |
---|---|---|---|---|---|---|
P (Punch press) | - | |||||
L (Laser) | - | - | - | - | ||
W (Wire) | - | - |
Power Mate i-D | |
Power Mate i-H | |
Power Motion i-A | O |
"O" | : | Both Ethernet and HSSB | |
"E" | : | Ethernet | |
"H" | : | HSSB | |
"X" | : | Cannot be used | |
"-" | : | None |
Note) 0i-C does not support the HSSB function.
See Also
cnc_stopophis cnc_startophis cnc_rdophisno cnc_clearophis