NewsCNCnetPDMAbout usSupport
  

CNC_RDUNSOLICMSG2 | UNSOLIC

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.

This function does not have the argument, library handle "FlibHndl".

MTConnect Fanuc Adapter

Universal Fanuc Driver

Fanuc Focas Library CD

Declaration

#include "fwlib32.h" or "fwlib64.h"

FWLIBAPI short WINAPI cnc_rdunsolicmsg2( short bill, IDBUNSOLICMSG2 *data2 );

Arguments : Ethernet

bill   [ in ]

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.

data   [ out ]

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.
1 : PMC data
3 : Custom macro variables
4 : Temporary RTM variables
5 : Permanent RTM variables(0i-F,30i/31i/32i only)
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)
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
EW_FUNC
(1)
Unavailable
EW_DATA
(5)
The message corresponding to the handle(bill) has not been transmitted.

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)X X E E X X X X X X X X X X X E E
T (Turning) X X E E X - X X X X X X X X X E E
LC (Loader) - - - - - - X X X X X X X X X - -

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


Power Mate i-DX
Power Mate i-HX
Power Motion i-AE

"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  

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_rdunsolicmsg2

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_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_wrunsolicprm

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

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