Description
Please refer to "Unsolicited Messaging Function" for the detail information of unsolicited messaging function. After calling the cnc_unsolicstart function, the parameter set by this function becomes effective.
Universal Fanuc Driver
Fanuc Focas Library CD
Declaration
Arguments : Ethernet
Specify the library handle. See "Library handle" for details.
The parameter number for unsolicited messaging. Reserved argument, so must be set to "1".
Pointer to IODBUNSOLIC structure which sets the parameters for the unsolicited messaging.
The IODBUNSOLIC structure is as follows.
typedef struct iodbunsolic {
char ipaddr[16] ;
unsigned short port ;
short reqaddr ;
short pmcno ;
short retry ;
short timeout ;
short alivetime;
short setno ;
union {
struct {
short type ;
short rdaddr ;
short rdno ;
short rdsize ;
} pmc ;
struct {
short type ;
long dummy1 ;
short dummy2 ;
} dmy ;
} rddata[3] ;
} IODBUNSOLIC ;
- ipaddr
- IP address of destination PC.
- ex.) "192.168.0.1"
- port
- TCP/UDP port number of destination PC.
- The unsolicited messaging function uses TCP and UDP of the same port number.
- If you set the firewall by this port number, you have to open the port for this port number.
- reqaddr
- PMC address type for the data transmission control. Only "R" or "E" address can be used for the transmission control, so set either "5" or "12".
-
5 : R (Internal relay) 12 : E (Extended relay) - pmcno
- PMC address number for the data transmission control.
- retry
- Number of transmission retry to observe communication board transmits data. Set the retry count that is used when there is no answer for the data transmission.
- timeout
- Timeout(sec) to observe communication board transmits data. Set the time(sec) of timeout until answering to the data transmission.
- alivetime
- The interval time(sec)of the existence signals which are transmitted while communication board operates. Set the value less than the value of the above "timeout".
- setno
- Number of the Message data to be transmitted. (1-3).
- type
- The type of the transmitted data. This is a reserved value, so set to "1".
- rdaddr
- PMC address which becomes the contents of the Message data.
-
0 : G (Signal to PMC->CNC) 1 : F (Signal to CNC->PMC) 2 : Y (Signal to PMC->machine) 3 : X (Signal to machine->PMC) 4 : A (Message demand) 5 : R (Internal relay) 6 : T (Changeable timer) 7 : K (Keep relay) 8 : C (Counter) 9 : D (Data table) 10 : M (Input signal from other devices) 11 : N (Output signal to other devices) 12 : E (Extended relay) - rdno
- Start address number of PMC data which becomes the contents of the Message data.
- rdsize
- Size(byte) of PMC data which becomes the contents of the Message data. According to the number of the Message data to be transmitted(setno), maximum number which can be set to "rdsize" varies as follows.
-
in case of setno = 1 : Max.1430 bytes in case of setno = 2 : Max.1414 bytes(total) in case of setno = 3 : Max.1398 bytes(total) - Setting example)
IP address | : | 192.168.0.1 |
Port number | : | 8196 |
PMC address | : | R2000 |
Retry number | : | 3 |
Timeout | : | 10 sec |
Transmission data | : | 2 |
1st message | : | R2100-2149 |
2nd message | : | D110-149 |
IODBUNSOLIC data; | ||
strcpy(data.ipaddr,"192.168.0.1"); | // | IP address |
data.port = 8196; | // | Port number |
data.reqaddr = 5; | // | "R" |
data.pmcno = 2000; | // | 2000 |
data.retry = 3; | // | retry count |
data.timeout = 10; | // | Timeout time(sec) |
data.alivetime = 5; | // | Alive signal time(sec) |
data.setno = 2; | // | Transmission data number |
data.rddata[0].pmc.type = 1; | // | Type of data("1") |
data.rddata[0].pmc.rdaddr = 5; | // | "R" |
data.rddata[0].pmc.rdno = 2100; | // | 2100 |
data.rddata[0].pmc.rdsize = 50; | // | 1st message data size |
data.rddata[1].pmc.type = 1; | // | Type of data("1") |
data.rddata[1].pmc.rdaddr = 9; | // | "D" |
data.rddata[1].pmc.rdno = 110; | // | 110 |
data.rddata[1].pmc.rdsize = 40; | // | 2nd message data size |
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) |
||||||||||||||||||||||||||||||||||||||||
(3) |
||||||||||||||||||||||||||||||||||||||||
(5) |
In order to get more information for this err_no return value, execute cnc_getdtailerr function. The following details status will be set onto the member, err_no of OBDERR structure.
|
|||||||||||||||||||||||||||||||||||||||
(-1) |
||||||||||||||||||||||||||||||||||||||||
(13) |
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 16i/18i/21i-B, 0i-B/C, 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 (must be set)
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 | X |
"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_rdunsolicprm cnc_unsolicstart cnc_unsolicstop cnc_rdunsolicmsg