In the Fast Ethernet unsolicited messaging function, the Message can be voluntarily notified from CNC to the personal computer according to the instruction of the ladder program or the NC program Note1). So, in the PC application, the state of CNC can be observed without the polling process. Arbitrary data of PMC or Macro variables Note1) can be transmitted as the Message. In the PC application, the polling process to inquire the state of CNC regularly becomes unnecessary by using this function.
The unsolicited messaging issues the window message to the PC application internally and notifies the Message. So, Visual C++ is necessary for making the application.
Note1) NC program and Macro variable can be used only by 30i/31i/32i.
Setting to use the unsolicited messaging
The following items are necessary to use the unsolicited messaging function.
- CNC control software : to be registered onto FROM of CNC.
16i
B0F4/12(M) or later
B0F4/07(T) or later
B0H1/17(M) or later
B1H1/17(T) or later
18i
BDF4/12(M) or later
BEF4/07(T) or later
BDH1/17(M) or later
BEH1/17(T) or later
21i
DDF4/12(M) or later
DEF4/07(T) or later
DDH1/17(M) or later
DEH1/17(T) or later
0i
D4A1/01(M) or later
D6A1/01(T) or later
PMi
88E0/21 or later
88F2/04 or later
88F1/12 or later
30i
G002/19.9 or later
G012/19.9 or later
G022/19.9 or later
G032/19.9 or later
31i
G101/19.9 or later
G111/19.9 or later
G121/19.9 or later
G131/19.9 or later
32i
G201/19.9 or later
- CNC side(Fast Ethernet firmware) : to be registered onto F-ROM of CNC.
6567/06 or later(16i/18i/21i,Power Mate i)6567/07 or later(0i)6569/19 or later(30i/31i/32i)
- CNC side(Net control application software) : to be registered onto F-ROM of CNC.
656F/11 or later(30i/31i/32i)
- PC side(Ethernet library) : to be copied onto a suitable folder of the PC. (System32 etc.).
Fwlib32.dll :
FANUC Open CNC FOCAS1/Ethernet Libraries(A02B-0207-K732) 1.7 or later(16i/18i/21i,Power Mate i)
FANUC Open CNC FOCAS1/Ethernet Libraries(A02B-0207-K732) 1.8 or later(0i)
FANUC Open CNC FOCAS1/2 Libraries(A02B-0207-K737) 2.5 or later(30i/31i/32i)
Fwlibe1.dll :
FANUC Open CNC FOCAS1/Ethernet Libraries(A02B-0207-K732) 1.7 or later(16i/18i/21i,Power Mate i)
FANUC Open CNC FOCAS1/Ethernet Libraries(A02B-0207-K732) 1.8 or later(0i)
FANUC Open CNC FOCAS1/2 Libraries(A02B-0207-K737) 2.5 or later(30i/31i/32i)
- PC side(Unsolicited messaging server) : to be installed into the PC.
UMsgServ.exe :FANUC Open CNC FOCAS1/Ethernet Libraries(A02B-0207-K732) 1.7 or laterFANUC Open CNC FOCAS1/2 Libraries(A02B-0207-K737) 2.5 or later(30i/31i/32i)
Install method of Unsolicited messaging server
Copy the UMsgServ.exe onto the suitable folder.
Input the following command from the command prompt. > UMsgServ.exe -Install [Enter]
By the above operation, the Unsolicited messaging server will be started automatically. after the next reboot of the PC.
Uninstall method of Unsolicited messaging server
Right-click the icon of the "Unsolicited Messaging Server" on the system tray, select "Exit" from the menu. The Unsolicited messaging server terminates.
Input the following command from the command prompt.> UMsgServ.exe -Remove [Enter]
Delete UMsgServ.exe from the installed folder.
Setting method of data for Unsolicited messaging server
Right-click the icon of the "Unsolicited Messaging Server" on the system tray, select "Setting" from the menu. Following dialog screen for setting will be displayed.
Set necessary information for each item.
Port Number :
Specify the port number for the Unsolicited messaging server. (standard value is 8196)
Timeout(sec):
Specify the timeout time to detect an abnormal communication with CNC. (standard value is 30)
Maximum CNC Number :
Specify the maximum number of CNCs which can be observed at the same time by the Unsolicited messaging server.(standard value is 32)
The function of each button is as follows.
[Standard] :
resets the setting to the above standard value.
[ OK ] :
saves the setting value and closes this screen.
The setting value will be effective after the restart of the Unsolicited messaging server.
[ Cancel ] :
closes this screen without saving the set value.
The following setting is necessary to CNC beforehand, to use the unsolicited messaging function.
- IP address :IP address of destination PC.- Port number :TCP/UDP port number of destination PC.(Note:The unsolicited messaging function uses TCP and UDP of the same port number.)- Control parameter FIt is PMC address or macro variable number to demand the data transmission by the ladder or the NC program.Only PMC address ("R","E") can be set for Series 160i/180i/210i, 0i, and Power Mate i.- Transmission parameter FIt is the PMC address and size or the macro number and numbers which becomes the content of the message.Only PMC address can be set for Series 160i/180i/210i, 0i, and Power Mate i.- PMC address :R address for ladder program to demand data transmission- Reading address of PMC data :R address for ladder program to demand data transmission- Retry number :Number of transmission retry to observe communication board transmits data.- Timeout time :imeout time to observe communication board transmits data.- The interval time of the existence signal :The interval time of the existence signals which are transmitted while communication board operates.- others :Please refer to the specification of function for details.
These data can be set from the PC application using cnc_wrunsolicprm() or cnc_wrunsolicprm2().
When you set these data in CNC, these data is saved in S-RAM area of CNC.
Control data and Message transfer mechanism for the unsolicited messaging
Making method of application which uses the unsolicited messaging function
Set the parameter for the unsolicited messaging to CNC.
The parameter for the unsolicited messaging function is set to CNC SRAM area using cnc_wrunsolicprm(). The parameter can be read by cnc_rdunsolicprm(), if necessary.
Notify the completion of preparing the unsolicited messaging to CNC.
The completion of preparing the unsolicited messaging is notified to CNC using cnc_unsolicstart(). After this call, CNC part can send the Message.
Add the function to process the unsolicited messaging.
// Example of ON_MESSAGE
#define WM_MYMESSAGE (WM_APP + 1)
BEGIN_MESSAGE_MAP( CMyWnd, CMyParentWndClass )
//{{AFX_MSG_MAP( CMyWnd
ON_MESSAGE( WM_MYMESSAGE, OnMyMessage )
//}}AFX_MSG_MAP
END_MESSAGE_MAP( )
LRESULT CMyWnd::OnMyMessage(WPARAM wParam, LPARAM lParam)
{
LRESULT result;
// Process the Message from CNC using cnc_rdunsolicmsg(), etc.
return result;
}
The arguments of the OnMyMessage() function are as follows.
wParam
= -3 : The socket communication error occurred.
= -2 : The unsolicited message server has stopped.
= -1 : The CNC power was turned off.
= 0 : The Message from CNC arrived. (normal process)
= 1 : The CNC power was turned on.
lParam
= "Handle for the Message data reading" : in case of wParam = 0 This value can be used as the argument for cnc_rdunsolicmsg().
= 0 : Other than wParam = 0
Note)
In case of "wParam = -3" :
The "Handle for the Message data reading" on the CNC side becomes invalid, so call cnc_unsolicstart() again. When the problem is not solved, investigate CNC power supply, Ethernet cable and I/F board.
In case of "wParam = -2" :
The window message cannot be received at the application. So, both the restart of the application and the Unsolicited messaging server is necessary.
In case of "wparam = -1" :
The application should wait for the wParam to become "1". And it is necessary to execute the acquisition of the library handle again.
And the OnMyMessage() function can set "RES_CODE" of the PMC data for unsolicited messaging control by setting the return value in "result" when wParam=0. The value of "result" which can be set by the application is as follows.result = 0x00, 0x10..0x1F, 0x30..0x3F
Read the unsolicited messaging data.
The transmitted message data at above OnMyMessage() routine is read by using cnc_rdunsolicmsg().
Notify the termination of receiving the unsolicited messaging to CNC.
The termination of receiving the unsolicited message from CNC is notified by cnc_unsolicstop() when the PC application finishes.