Description
Reads the contents of the operator's message in CNC.
The operator's message is stored in "data" of "OPMSG".
Universal Fanuc Driver
Fanuc Focas Library CD
Declaration
Arguments
Specify the library handle. See "Library handle" for details.
Specify the kind of operator's message.
0 | : | 1st message |
1 | : | 2nd message |
2 | : | 3rd message |
3 | : | 4th message |
4 | : | macro message |
-1 | : | all messages |
0 | : | 1st message |
0 | : | 1st message |
1 | : | 2nd message |
2 | : | 3rd message |
3 | : | 4th message |
-1 | : | all messages |
Specify the length of the data block(size of OPMSG structure)
single message (1st - 4th message)
macro message
all messages
single message(1st - 4th message)
all messages
Pointer to the OPMSG structure including the operator's message.
typedef struct msg {
short datano ; /* Number of operator's message */
short type ; /* Kind of operator's message */
short char_num ; /* Message length */
char data[MSG_SIZE] ; /* Operator's message strings */
} OPMSG ; /* MSG_SIZE : Message length */
- datano
- The number of operator's message is stored.
- message exists
- Series 15/15i
- 0 to 999
- Series 16/18/21, 16i/18i/21i, 0i, 30i, Power Mate i, PMi-A
- number does not exist : 0
- number exist : 2000 to 2099
- message does not exist
- -1
- type
- Kind of operator's message is stored.
- Series 15/15i
- Series 16/18/21, 16i/18i/21i, 0i, 30i, Power Mate i, PMi-A
- Series 16i/18i-W
- char_num
- The operator's message length is stored.
- Series 15/15i
- Series 16/18/21, 16i/18i/21i, 0i, 30i, Power Mate i, PMi-A
- data
- The operator's message strings are stored. The '\0' is set at the end of strings.
- The message is acquired in the following character-codes.
- 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)
0 to 3 | : | 1st to 4th message |
4 | : | macro message |
0 | : | 1st message |
0 to 3 | : | 1st to 4th message |
1 to 129 | : | 1st to 4th message |
1 to 27 | : | macro message |
1 to 256 | : | operator's message |
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 |
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 |
---|---|
(2) |
Size of OPMSG structure(length) is wrong. |
(4) |
The specification of the kind of operator's message (type) is wrong. |
(6) |
Set necessary CNC option. |
(9) |
|
As for the other return codes or the details, see "Return status of Data window function"
CNC option
This function need the following CNC option.
- Series 15/15i The external data I/O function
- Series 16/18/21, 16i/18i/21i, 0i, 30i, PMi-A External message
External data input
For HSSB connection,
For Ethernet connection,
The Ethernet function and the extended driver/library function are necessary. However, in case of Series 16i/18i/21i-B, 0i-B/C/D/F, Series 30i and PMi-A, the required CNC option is as follows. When Embedded Ethernet is used,above two optional functions are not required.
When Ethernet board is used,
- only Ethernet function is required.
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.
Example(C Language)
The following program reads the operator's message and displays it.
#include "fwlib32.h"
void example( void )
{
OPMSG buf ;
cnc_rdopmsg( h, 0, 6+256, &buf ) ;
if ( buf.datano != -1 )
printf( "%04d %s\n", buf.datano, buf.data ) ;
else
printf( "No operator message.\n" ) ;
}
Example(C#)
The following program reads the operator's message and displays it.
class example
{
public void sample()
{
Focas1.OPMSG buf = new Focas1.OPMSG();
Focas1.cnc_rdopmsg(h, 0, 6 + 256, buf);
if (buf.msg1.datano != -1)
{
Console.WriteLine("{0:d4} {1}", buf.msg1.datano, buf.msg1.data);
}
else
{
Console.WriteLine("No operator message.");
}
}
}