News CNCnetPDM About us Support  
       
  

CNC_WRUNSOLICPRM | UNSOLIC

TOP

Description

Sets the parameter for unsolicited messaging to CNC. This function is available only for Series 16i/18i/21i, 0i and Power Mate i. 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 this function becomes effective.
MTConnect Fanuc Adapter

Universal Fanuc Driver

Fanuc Focas Library CD

Declaration

#include "fwlib32.h"

FWLIBAPI short WINAPI cnc_wrunsolicprm( unsigned short FlibHndl, short number, IODBUNSOLIC *data );

Arguments : Ethernet

FlibHndl   [ in ]

Specify the library handle. See "Library handle" for details.

number   [ in ]

The parameter number for unsolicited messaging. Reserved argument, so must be set to "1".

data   [ in ]

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
EW_FUNC
(1)
Unavailable
EW_NUMBER
(3)
The parameter number(number) for unsolicited messaging is wrong.
EW_DATA
(5)
The content of the parameter for the unsolicited messaging is wrong.
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.
0 : error except EW_DATA
1 : IP address(ipaddr) of destination PC is wrong.
2 : Port number(port) of destination PC is wrong.
3 : PMC address type(reqaddr) for the data transmission control is wrong.
4 : PMC address number(pmcno) for the data transmission control is wrong.
5 : Number(retry) of transmission retry to observe communication board transmits data is wrong.
6 : Timeout time(timeout) to observe communication board transmits data is wrong.
7 : The interval time(alivetime)of the existence signals which are transmitted while communication board operates is wrong.
8 : Number(setno) of the Message data to be transmitted is wrong.
9 : The type(type) of the transmitted data is wrong.
10 : PMC address(rdaddr) which becomes the contents of the Message data is wrong.
11 : Start number(rdno) of PMC data which becomes the contents of the Message data is wrong.
12 : Size(rdsize) of PMC data which becomes the contents of the Message data is wrong.
EW_BUSY
(-1)
The unsolicited message is being transmitted.
EW_REJECT
(13)
The message transmission is being executed with other destination PC.

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.

  • Series 16i/18i/21i, 0i, Power Mate i
    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)X E X X X X X X X E E E E E E X X
T (Turning) X E X X X - X X X E E E E E E X X
LC (Loader) - - - - - - X X X X X X X X X - -

0i-D0i-F16i18i30i-A30i-B
P (Punch press)X X X X - X
L (Laser) - - X - - X
W (Wire) - - X X X X


Power Mate i-DE
Power Mate i-HE
Power Motion i-AX

"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  

Privacy notice

This website uses cookies. By continuing to use it you agree to our privacy policy. 

https://www.inventcom.net/fanuc-focas-library/unsolic/cnc_wrunsolicprm

Fanuc Focas Library | Unsolic | cnc_rdunsolicmsg

Reads the unsolicited messaging data. This function is available only for Series 16i/18i/21i, 0i and Power Mate i. This function cannot be used with Visual Basic.... [read more]
Fanuc Focas Library | Unsolic | cnc_rdunsolicmsg

Fanuc Focas Library | Unsolic | cnc_rdunsolicmsg2

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... [read more]
Fanuc Focas Library | Unsolic | cnc_rdunsolicmsg2

Fanuc Focas Library | Unsolic | cnc_rdunsolicprm

Reads the parameter for unsolicited messaging from CNC. This function is available only for Series 16i/18i/21i, 0i and Power Mate i. This function cannot be used... [read more]
Fanuc Focas Library | Unsolic | cnc_rdunsolicprm

Fanuc Focas Library | Unsolic | cnc_rdunsolicprm2

Reads the parameter for unsolicited messaging from CNC. This function is available only for Series Series 30i/31i/32i, 0i-D/F and PMi-A. This function cannot be... [read more]
Fanuc Focas Library | Unsolic | cnc_rdunsolicprm2

Fanuc Focas Library | Unsolic | cnc_unsolicstart

Directs the starting of reception of the unsolicited messaging. The starting of reception directs by the PC that receives the unsolicited messaging. This... [read more]
Fanuc Focas Library | Unsolic | cnc_unsolicstart

Fanuc Focas Library | Unsolic | cnc_unsolicstop

Directs the termination of reception of the unsolicited messaging. When the CNC parameter No.905#4 is 1, this function can be... [read more]
Fanuc Focas Library | Unsolic | cnc_unsolicstop

Fanuc Focas Library | Unsolic | cnc_wrunsolicprm2

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... [read more]
Fanuc Focas Library | Unsolic | cnc_wrunsolicprm2

Fanuc Focas Library | Unsolic | flist_UnSolic

CNC: Function related to Unsolicited messaging function... [read more]
Fanuc Focas Library | Unsolic | flist_UnSolic
Modified: 2023-12-05