Description
Sets the parameter for unsolicited messaging to CNC. This function is available only for 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.
After calling the cnc_unsolicstart function, the parameter set by thisfunction 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 IODBUNSOLIC2 structure which sets the parameters for the unsolicited messaging. The IODBUNSOLIC structure is as follows.
typedef struct iodbunsolic2 {
char ipaddr[64];
unsigned long port;
unsigned short retry;
unsigned short timeout;
unsigned short alivetime;
char dummy1[8];
UNSOLICMSG_TYPE_PRM cntrl;
unsigned short transnum;
char dummy2[14];
UNSOLICMSG_TYPE_PRM trans[3];
} IODBUNSOLIC2;
typedef struct unsolicmsg_type_prm {
unsigned short type;
char dummy1[2];
union {
typedef {
unsigned short path;
short addr;
unsigned long no;
unsigned long size;
} pmc;
typedef {
unsigned short path;
char dummy2[2];
unsigned long no;
unsigned long num;
} macro;
} prm
} UNSOLICMSG_TYPE_PRM;
- ipaddr
- IP address or host name 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.
- Range) 5001 - 65535
- retry
- Retry count
- 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.
- Range) 1 - 32767
- timeout
- Timeout times(sec)
- Timeout(sec) to observe communication board transmits data. Set the time(sec) of timeout until answering to the data transmission.
- Range) 1 - 32767
- alivetime
- Alive signal time(sec)
- 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".
- Range) 1 - 32767
- cntrl.type
- Kind of control parameter
- This data is the kind of control parameter for the ladder program or the NC program to demand the message transmission.
-
0 : Control parameter is invalid. 1 : PMC address(Response Notice method) 2 : PMC address(Simple method) 3 : Custom macro variable(Simple method) 4 : Temporary RTM variable(Simple method)(0i-F,30i/31i/32i only) - cntrl.prm.pmc.path
- PMC unit type for control parameter
- This data is PMC unit type number for control parameter for the ladder program to demand the message transmission.
- When the value of "Kind of control parameter" is "1" and "2", this value is effective.
- Range) 1 - 3 (The range depends on an effective PMC unit type number.) When this value is 65535, the control parameter is invalid.
- cntrl.prm.pmc.addr
- PMC address for control parameter
- This data is PMC address for control parameter for the ladder program to demand the message transmission.
- When the value of "Kind of control parameter" is "1" and "2", this value is effective.
-
5 : R (Internal relay) 12 : E (Extended relay) - cntrl.prm.pmc.no
- PMC address number for control parameter
- This data is PMC address number for control parameter for the ladder program to demand the message transmission.
- When the value of "Kind of control parameter" is "1" and "2", this value is effective.
- Range) (The range depends on an effective PMC area)
- cntrl.prm.pmc.size
- unused
- cntrl.prm.macro.path
- CNC path number for control parameter
- This data is CNC path number for control parameter for the NC program to demand the message transmission.
- When the value of "Kind of control parameter" is "3" and "4", this value is effective.
- Range) 1 - 10(The range depends on an effective PMC area) When this value is 65535, the control parameter is invalid.
- cntrl.prm.macro.no
- Macro variable number for control parameter
- This data is Macro variable number for control parameter for the NC program to demand the message transmission.
- When the value of "Kind of control parameter" is "3" and "4", this value is effective.
- Range) (The range depends on an effective Macro variable)
- cntrl.prm.macro.num
- unused
- transnum
- Transmission number
- Number of transmitted messages.
- Range) 1 - 3
- trans[n].type
- Kind of transmission parameter : range of n (0-2).
-
0 : Transmission parameter is invalid. 1 : PMC address 3 : Custom macro variable 4 : Temporary RTM variable 5 : Permanent RTM variable(0i-F,30i/31i/32i only) - trans[n].prm.pmc.path
- PMC unit type number for transmission parameter : range of n (0-2).
- When the value of "Kind of transmission parameter" is "1", this value is effective.
- Range) 1 - 3 (The range depends on an effective PMC unit type number.) When this value is 65535, the transmission parameter is invalid.
- trans[n].prm.pmc.addr
- PMC address for transmission parameter : range of n (0-2).
- When the value of "Kind of transmission parameter" is "1", this value is effective.
-
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)(0i-F,30i/31i/32i only) 11 : N (Output signal to other devices)(0i-F,30i/31i/32i only) 12 : E (Extended relay) 13 : Z (System relay)(0i-F,30i/31i/32i only) - trans[n].prm.pmc.no
- PMC address number for transmission parameter : range of n (0-2).
- When the value of "Kind of transmission parameter" is "1", this value is effective.
- Range) 1 - 10(The range depends on an effective PMC area)
- trans[n].prm.pmc.size
- PMC data size for transmission parameter (bytes) : range of n (0-2).
- When the value of "Kind of transmission parameter" is "3", "4" and "5", this value is effective.
- Range) (The range depends on an effective PMC data area and transmission number.)
-
In case of transmission number is "1" : Max.2890 bytes In case of transmission number is "2" : Max.2874 bytes(total) In case of transmission number is "3" : Max.2858 bytes(total) - When the macro variable is used to the transmission parameter, the size of one macro variable is eight bytes.
- trans[n].prm.macro.path
- CNC path number of transmission parameter : range of n (0-2).
- When the value of "Kind of transmission parameter" is "3", "4" and "5", this value is effective.
- Range) 1 - 10 (The range depends on an effective CNC path number) When this value is 65535, the transmission parameter is invalid.
- trans[n].prm.macro.no
- Macro variable number for transmission parameter : range of n (0-2).
- When the value of "Kind of transmission parameter" is "3", "4" and "5", this value is effective.
- Range) (The range depends on an effective Macro variable data )
- trans[n].prm.macro.num
- Number of macro variable for transmission parameter : range of n (0-2).
- When the value of "Kind of transmission parameter" is "3", "4" and "5", this value is effective.
-
In case of transmission number is "1" : Max.2890 bytes In case of transmission number is "2" : Max.2874 bytes(total) In case of transmission number is "3" : Max.2858 bytes(total) - When the macro variable is used to the transmission parameter, the size of one macro variable is eight bytes.
- When "Kind of transmission parameter" is "3" and "Macro variable number" is 1000 or more(system variavles), this parameter can set only "1".
- Setting example)
IP address | : | 192.168.0.1 |
Port number | : | 8196 |
Control method | : | Simple method |
Control parameter | : | PMC address"1:R2000" |
Retry count | : | 3 |
Timeout time | : | 10 |
Transmission number | : | 3 |
Transmission parameter[0] | : | PMC data area"1:R2100-1:R2149" |
Transmission parameter[1] | : | Custom macro"1:3011" |
Transmission parameter[2] | : | Temporary RTM variable"1:0-1:4" |
IODBUNSOLIC2 data2; | ||
strcpy(data2.ipaddr,"192.168.0.1"); | // | IP address |
data2.port = 8196; | // | Port number |
data2.retry = 3; | // | Retry count |
data2.timeout = 10; | // | Timeout time(sec) |
data2.alivetime = 5; | // | Alive signal time(sec) |
// | Control parameter | |
data2.cntrl.type = 2; | // | - Kind(simple method) |
data2.cntrl.prm.pmc.path = 1; | // | - PMC unit type |
data2.cntrl.prm.pmc.addr = 1; | // | - PMC address |
data2.cntrl.prm.pmc.no = 1; | // | - PMC address number |
data2.transnum = 3; | // | Transmission number |
// | Transmission parameter[0] | |
data2.trans[0].type = 1; | // | - Kind |
data2.trans[0].prm.pmc.path = 1; | // | - PMC unit type |
data2.trans[0].prm.pmc.addr = 5; | // | - PMC address |
data2.trans[0].prm.pmc.no = 2100; | // | - PMC address number |
data2.trans[0].prm.pmc.size = 50; | // | - PMC data size |
// | Transmission parameter[1] | |
data2.trans[1].type = 3; | // | - Kind |
data2.trans[1].prm.macro.path = 1; | // | - CNC path number |
data2.trans[1].prm.macro.no = 3011; | // | - Custon macro variable |
data2.trans[1].prm.macro.num = 1; | // | - Number of macro variable |
// | Transmission parameter[2] | |
data2.trans[2].type = 4; | // | - Kind |
data2.trans[2].prm.macro.path = 1; | // | - CNC path number |
data2.trans[2].prm.macro.no = 0; | // | - Temporary RTM variable |
data2.trans[2].prm.macro.num = 5; | // | - Number of macro variable |
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) |
The state of the unsolicited messaging function is not "Stop" |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
(1) |
In order to get more information for this err_no return value, execute cnc_getdtailerr function. Member of ODBERR : err_no
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
(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 and err_dtno of OBDERR structure. Member of ODBERR : err_no
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
(7) |
Parameter writing is failed. 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. Member of ODBERR : err_no
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
(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 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_rdunsolicprm cnc_rdunsolicprm2 cnc_unsolicstart cnc_unsolicstop cnc_rdunsolicmsg cnc_rdunsolicmsg2