Description
Reads the unsolicited messaging data. This function is available only for Series Series 30i/31i/32i, 0i-D/F and PMi-A. This function cannot be used with Visual Basic. Please use Visual C++ for making your application.
Please refer to "Unsolicited Messaging Function" for the detail information of unsolicited messaging function.
Universal Fanuc Driver
Fanuc Focas Library CD
Declaration
Arguments : Ethernet
Handle for the Message data reading. Specify the value acquired by the cnc_unsolicstart or the value notified by the argument(lParam) of the message reception function.
Pointer to IDBUNSOLICMSG2 structure in which the unsolicited messaging data will be stored.
The IDBUNSOLICMSG2 structure is as follows.
typedef struct idbunsolicmsg2 {
unsigned short getnum;
char dummy[2];
UNSOLICMSG_TYPE_MSG get[3];
} IDBUNSOLICMSG2 ;
typedef struct unsolicmsg_type_msg {
unsigned short type;
char dummy1[2];
union {
typedef {
unsigned short path;
char dummy2[2];
unsigned long size;
void *data;
} pmc;
typedef {
unsigned short path;
char dummy3[2];
unsigned long num;
void *data;
} macro;
} msg;
} UNSOLICMSG_TYPE_MSG ;
- getnum
- Acquired message number
- Number of the Message data which was acquired by the unsolicited messaging.
- Range) 1 - 3
- get[n].msg.type
- Kind of the unsolicited messaging data.
- get[n].msg.pmc.path
- Unit type number of PMC
- When the value of "Kind of the unsolicited messaging data" is "1", this value is effective.
- Range) 1 - 3 (The range depends on an effective PMC unit type number.)
- get[n].msg.pmc.size
- The size of PMC data (bytes)
- When the value of "Kind of the unsolicited messaging data" is "1", this value is effective.
- Range) (The range depends on an effective PMC area and transmission number.)
- get[n].msg.pmc.data
- Pointer to the buffer where PMC data is stored.
- The size specified by "PMC size of the parameter for the transmission (byte)" of cnc_wrunsolicprm2 function is necessary for the size of this data.
- When the value of "Kind of the unsolicited messaging data" is "1", this value is effective.
- get[n].msg.macro.path
- Path number of CNC
- When the value of "Kind of the unsolicited messaging data" is "3", "4" and "5", this value is effective.
- Range) 1 - 3 (The range depends on an effective PMC unit type number.)
- get[n].msg.macro.num
- Number of Macro variable data
- When the value of "Kind of the unsolicited messaging data" is "3", "4" and "5", this value is effective.
- Range) (The range depends on an effective Macro variable data and transmission number.)
- get[n].msg.macro.data
- Pointer to the buffer where Macro variable data is stored.
- The size specified by "Number of macro variables of the parameter for the transmission" of cnc_wrunsolicprm2 function is necessary for the size of this data.
- When the value of "Kind of the unsolicited messaging data" is "3", "4" and "5", this value is effective.
- Setting example)
1 | : | PMC data |
3 | : | Custom macro variables |
4 | : | Temporary RTM variables |
5 | : | Permanent RTM variables(0i-F,30i/31i/32i only) |
IP address | : | 192.168.0.1 |
Port number | : | 8196 |
Control method | : | Simple method |
Conterl parameter | : | PMC address"1:R2000" |
Retry number | : | 3 |
Timeout | : | 10 sec |
Transmission number | : | 3 |
Parameter for transmission[0] | : | PMC area"1:R2100-1:R2149" |
Parameter for transmission[1] | : | Custom macro variables"1:3011" |
Parameter for transmission[2] | : | Temporary RTM variables"1:0-1:4" |
IDBUNSOLICMSG2 data2; char msg1[50]; // stored buffer for msg1 double msg2[2]; // stored buffer for msg2 double msg3[5]; // stored buffer for msg3 |
data2.get[0].msg.pmc.data = msg1; | // | Contents of 1:R2100-1:2149 |
data2.get[1].msg.macro.data = msg2; | // | Contents of 1:3011 |
data2.get[2].msg.macro.data = msg3; | // | Contents of 1:0-1:4 |
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) |
|
(5) |
As for the other return codes or the details, see "Return status of Data window function"
CNC option
For Ethernet connection,
The Ethernet function and the extended driver/library function are necessary. However, in case of Series 0i-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 not related to CNC parameter.
This function is related to the following CNC parameter.
See the manual of FAST Ethernet for details.
No.904#4=1 : Unsilocited messaging function(must be set)
No.904#5 : If you use the DNS function, set "1".
No.14880#4=1 : Unsilocited messaging function(Embedded Ethernet(Built-in port))
No.14880#5 : If you use the DNS function, set "1".(Embedded Ethernet(Built-in port))
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 | E |
"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_wrunsolicprm cnc_wrunsolicprm2 cnc_rdunsolicprm cnc_rdunsolicprm2 cnc_unsolicstart cnc_unsolicstop