About Development Cautionary Note of Customization Software
About Development Cautionary Note of Customization Software
About Development Cautionary Note of Customization Software
Table of Contents
1 Outline ................................................................................................................................. 2
2 Recommended programming method.................................................................................. 3
3 Case of trouble..................................................................................................................... 5
4 FOCAS application to add load ............................................................................................ 9
5 List of FOCAS2 functions that require support ................................................................... 22
6 FANUC application ............................................................................................................30
7 GENERAL WARNINGS FOR CNC APPLICATION DEVELOPMENT ............................... 31
Ed
About development 04 Draw A-42148-00093EN
Title cautionary note of
Date Sheet
customization software 2021. FANUC CORPORATION 1/33
07/19
© MyFANUC B702B2F68851464B8B0D71626E906C08
7169FPDAVxTjbjuntGBbibBhLmV7rOz9MW/0zLDNscA7SdMIC+2wd68VWEg==
1 Outline
For the operation management of production equipment by IoT, the machine users who add the data
communication from FOCAS2 application to the existing machine via Ethernet are increasing.
CNC
Ladder
program PC application
CNC data
Machine Tool
Updating machining data
After adding the software for monitoring operation (FIELD system and MT-LINKi are included), Reading or
writing CNC’s data from Customizing software (PMC ladder program, PC application, C-language executor
application and FANUC PICTURE application) might become slow very rarely.
Customizing software don't assume the delay of reading CNC data or writing CNC data, the alarm and the
warning might occur. Moreover, the machine sometimes fails to work at the worst case.
CNC data
Machine Tool
Delay of updating machining data
Above trouble might occur when Machine user adds our software for monitoring operation (FIELD system and
MT-LINKi).
Ed
About development 04 Draw A-42148-00093EN
Title cautionary note of
Date Sheet
customization software 2021. FANUC CORPORATION 2/33
07/19
© MyFANUC B702B2F68851464B8B0D71626E906C08
7169FPDAVxTjbjuntGBbibBhLmV7rOz9MW/0zLDNscA7SdMIC+2wd68VWEg==
This report describes “Recommended programming method” and “Case of trouble” to prevent from trouble.
Confirm that your Customizing software are supporting the delay of reading/writing CNC data.
After confirmation of Customizing software, check that the process for delay runs correctly on machine tool.
For checking the process, we prepared the application to add load (LoadFocasFunc.exe). This application
communicates with CNC periodically. In this report, the method to use the application (LoadFocasFunc.exe) is
described.
However, if multiple FOCAS applications work on with processing, the execution of the FOCAS library
functions may be synchronized and EW_BUSY may always occur.
In such a case, you should take counter measures such as making the retry timing variable
Ed
About development 04 Draw A-42148-00093EN
Title cautionary note of
Date Sheet
customization software 2021. FANUC CORPORATION 3/33
07/19
© MyFANUC B702B2F68851464B8B0D71626E906C08
7169FPDAVxTjbjuntGBbibBhLmV7rOz9MW/0zLDNscA7SdMIC+2wd68VWEg==
Ed
About development 04 Draw A-42148-00093EN
Title cautionary note of
Date Sheet
customization software 2021. FANUC CORPORATION 4/33
07/19
© MyFANUC B702B2F68851464B8B0D71626E906C08
7169FPDAVxTjbjuntGBbibBhLmV7rOz9MW/0zLDNscA7SdMIC+2wd68VWEg==
3 Case of trouble
Cause)
- In the existing machine, the machining program is automatically selected by the application on the PC.
- Before adding the IoT equipment, calling FOCAS function “cnc_pdf_slctmain” for main program selection
and the main program was selected correctly without returning the return status EW_BUSY.
- After adding IoT equipment, due to the influence of it, there was a case where EW_BUSY was returned
from FOCAS function for main program selection.
- Because the processing of FOCAS function as return status for the main program selection was not
considered, the main program was not changed from the previous program, and machining was started with
the wrong program, and erroneous machining occurred.
Countermeasure)
Add processing of the FOCAS function for the main program selection as return status.
Ed
About development 04 Draw A-42148-00093EN
Title cautionary note of
Date Sheet
customization software 2021. FANUC CORPORATION 5/33
07/19
© MyFANUC B702B2F68851464B8B0D71626E906C08
7169FPDAVxTjbjuntGBbibBhLmV7rOz9MW/0zLDNscA7SdMIC+2wd68VWEg==
Ed
About development 04 Draw A-42148-00093EN
Title cautionary note of
Date Sheet
customization software 2021. FANUC CORPORATION 6/33
07/19
© MyFANUC B702B2F68851464B8B0D71626E906C08
7169FPDAVxTjbjuntGBbibBhLmV7rOz9MW/0zLDNscA7SdMIC+2wd68VWEg==
Cause)
- In the existing machine, the tool compensation amount is changed by the low speed type PMC window
function during the tool change operation. The tool change operation is completed in about 0.7 to 0.8
seconds.
- Before adding the IoT equipment, the process of changing the tool compensation amount was completed in
about 64 milliseconds, and the tool change operation was completed after the new tool compensation
amount was applied, and the machining was started.
- After adding the IoT equipment, due to the influence of the IoT application, execution of the low speed
type PMC window function was kept waiting, and a phenomenon occurred which took more than 1 second
to update the tool compensation amount.
- As the result of the delay, machining started with the tool compensation amount before update and
machining defect occurred because the tool change operation completed before the completion of updating
the tool compensation amount.
Countermeasure)
Add the completion for updating the tool compensation amount to the completion condition of the tool change
operation.
Ed
About development 04 Draw A-42148-00093EN
Title cautionary note of
Date Sheet
customization software 2021. FANUC CORPORATION 7/33
07/19
© MyFANUC B702B2F68851464B8B0D71626E906C08
7169FPDAVxTjbjuntGBbibBhLmV7rOz9MW/0zLDNscA7SdMIC+2wd68VWEg==
Note
In the above example of ladder program, checking completion code of WINDW
instruction is omitted in order to make the difference clear. It is recommended that
the practical ladder program checks if the completion code is “0” at the
completion of WINDW instruction.
Ed
About development 04 Draw A-42148-00093EN
Title cautionary note of
Date Sheet
customization software 2021. FANUC CORPORATION 8/33
07/19
© MyFANUC B702B2F68851464B8B0D71626E906C08
7169FPDAVxTjbjuntGBbibBhLmV7rOz9MW/0zLDNscA7SdMIC+2wd68VWEg==
Notice
Don’t consider that your application is supporting the delay of reading / writing
CNC data even if Machine tool works correctly with this application.
Confirm the source of Customizing software.
LoadFocasFunc.exe
Factory LAN
CNC
Ladder
program PC application
CNC data
Machine Tool
Operating environment
Windows XP Professional, Windows Vista Business,
Windows 7 Professional, Windows 10 Pro/IoT
Ed
About development 04 Draw A-42148-00093EN
Title cautionary note of
Date Sheet
customization software 2021. FANUC CORPORATION 9/33
07/19
© MyFANUC B702B2F68851464B8B0D71626E906C08
7169FPDAVxTjbjuntGBbibBhLmV7rOz9MW/0zLDNscA7SdMIC+2wd68VWEg==
Ed
About development 04 Draw A-42148-00093EN
Title cautionary note of
Date Sheet
customization software 2021. FANUC CORPORATION 10/33
07/19
© MyFANUC B702B2F68851464B8B0D71626E906C08
7169FPDAVxTjbjuntGBbibBhLmV7rOz9MW/0zLDNscA7SdMIC+2wd68VWEg==
4.2 Explanation
CONNECT SETTING
(1) Connect the PC on which LoadFocasFunc.exe is installed to the CNC with an Ethernet cable or HSSB
cable.
(2) For Ethernet connection, check the CNC IP address and FOCAS2 PORT NUMBER (TCP).
Ed
About development 04 Draw A-42148-00093EN
Title cautionary note of
Date Sheet
customization software 2021. FANUC CORPORATION 11/33
07/19
© MyFANUC B702B2F68851464B8B0D71626E906C08
7169FPDAVxTjbjuntGBbibBhLmV7rOz9MW/0zLDNscA7SdMIC+2wd68VWEg==
Ed
About development 04 Draw A-42148-00093EN
Title cautionary note of
Date Sheet
customization software 2021. FANUC CORPORATION 12/33
07/19
© MyFANUC B702B2F68851464B8B0D71626E906C08
7169FPDAVxTjbjuntGBbibBhLmV7rOz9MW/0zLDNscA7SdMIC+2wd68VWEg==
3
4
If the CNC model is not supported with this application, the following pop-up screen will be displayed.
Ed
About development 04 Draw A-42148-00093EN
Title cautionary note of
Date Sheet
customization software 2021. FANUC CORPORATION 13/33
07/19
© MyFANUC B702B2F68851464B8B0D71626E906C08
7169FPDAVxTjbjuntGBbibBhLmV7rOz9MW/0zLDNscA7SdMIC+2wd68VWEg==
LOAD SETTING
Set the output folder of the log file and set load settings.
Log File
Function
Select the function to be executed to load the CNC. Basically, select all functions.
Interval (msec)
Specify the execution interval of the function (the time from the completion of the execution of the function to
the start of the next function).
Drag the slider with your mouse and move it left or right. Alternatively, you can move the slider with the cursor
keys on the left and right of the keyboard.
Ed
About development 04 Draw A-42148-00093EN
Title cautionary note of
Date Sheet
customization software 2021. FANUC CORPORATION 14/33
07/19
© MyFANUC B702B2F68851464B8B0D71626E906C08
7169FPDAVxTjbjuntGBbibBhLmV7rOz9MW/0zLDNscA7SdMIC+2wd68VWEg==
After completing the settings, press the “START” button. Start executing the FOCAS function.
After pressing the "START" button, if the required settings are not set or if an error occurs during execution, the
following pop-up screen will be displayed.
Ed
About development 04 Draw A-42148-00093EN
Title cautionary note of
Date Sheet
customization software 2021. FANUC CORPORATION 15/33
07/19
© MyFANUC B702B2F68851464B8B0D71626E906C08
7169FPDAVxTjbjuntGBbibBhLmV7rOz9MW/0zLDNscA7SdMIC+2wd68VWEg==
2 3
NOTE
1. If the log file already exists in the folder on the PC that is the output destination of the
log file, this application overwrites it after deleting the file.
2. Also note that once you stop execution with the "STOP" button and then "START"
again, it will be executed after deleting the files in the specified folder.
3. When multiple applications are started at the same time, the same folder name
cannot be specified for "LogFile".Specify a different folder name.
STATUS
During execution of the FOCAS function, the execution status of the function is displayed in the
"STATUS" area.
The display format is described as follows.
1 2
Ed
About development 04 Draw A-42148-00093EN
Title cautionary note of
Date Sheet
customization software 2021. FANUC CORPORATION 16/33
07/19
© MyFANUC B702B2F68851464B8B0D71626E906C08
7169FPDAVxTjbjuntGBbibBhLmV7rOz9MW/0zLDNscA7SdMIC+2wd68VWEg==
In addition, if the above log file exists in the specified folder when the “START” button is pressed, all log
files will be deleted. After deletion, the output is executed with the file name "LoadLog00.csv".
1
Interval,100msec
2 Exec Function: Upload, PMCdata, MainProg, SystemSoft
3 4 5 6 7
Log output format
Ed
About development 04 Draw A-42148-00093EN
Title cautionary note of
Date Sheet
customization software 2021. FANUC CORPORATION 17/33
07/19
© MyFANUC B702B2F68851464B8B0D71626E906C08
7169FPDAVxTjbjuntGBbibBhLmV7rOz9MW/0zLDNscA7SdMIC+2wd68VWEg==
This section describes how to check the following items using this application.
Note
Please do not judge whether your application supports the delay of data reading /
writing only by whether the machine tool works by using this application.
Please also check the ladder sequence processing and source code to see
whether your application supports the delay of data reading / writing.
Behavior 1
When executing any of the following functions, LoadFocasFunc.exe may terminate with an error of ret =
-16 (EW_SOCKET).
- Write CNC parameters using PMC window
- Write CNC parameters by FOCAS2 function
STATUS is as following.
Ed
About development 04 Draw A-42148-00093EN
Title cautionary note of
Date Sheet
customization software 2021. FANUC CORPORATION 18/33
07/19
© MyFANUC B702B2F68851464B8B0D71626E906C08
7169FPDAVxTjbjuntGBbibBhLmV7rOz9MW/0zLDNscA7SdMIC+2wd68VWEg==
Causing
If any of the following functions is executed while LoadFocasFunc.exe is transferring CNC parameters, CNC
parameter writing will be in a standby state.
- Write CNC parameters using PMC window
- Write CNC parameters by FOCAS2 function
If CNC parameter writing is in a standby state, the following functions will be also in a standby state.
- all low-speed PMC window functions
- FOCAS functions described in “ List of FOCAS2 functions that require support "
Please note that cnc_pdf_rdmain () used in the Main Program acquisition of LoadFocasFunc.exe is also in the
standby state. After the number of seconds setting in Timeout (sec), LoadFocasFunc.exe may terminate with an
error of "ret = -16".
Countermeasure
Set the Timeout (sec) time of the ethernet connection to more than 30 seconds.
Because of transferring all CNC parameters may take more than 5 seconds, there is also a delay of more than 5
seconds in executing the low-speed type PMC window and FOCAS functions.
Please also check that the PMC ladder and PC application have been created correctly.
Behavior 2
The execution time (end time-start time) of MainProg, PMCdata, and SystemSoft recorded in the log file
LoadLog00.csv is 1 second or more.
Causing
It is possible that the low-speed PMC window in the PMC ladder and the FOCAS functions in the PC
application are executed frequently.
Countermeasure
Please consider whether the execution frequency of the low-speed type PMC window in the PMC ladder and the
FOCAS functions in the PC application can be reduced.
Behavior 3
Transferring (Upload) of the CNC parameters recorded in the log file LoadLog00.csv ends with EW_RESET
(-2).
Example) Upload, 11: 29: 43.944, 11: 29: 59.869, -2, err_no = 0, err_dtno = 0
Caussing
This is normal behavior when a reset is performed on the CNC.
No problem.
Ed
About development 04 Draw A-42148-00093EN
Title cautionary note of
Date Sheet
customization software 2021. FANUC CORPORATION 19/33
07/19
© MyFANUC B702B2F68851464B8B0D71626E906C08
7169FPDAVxTjbjuntGBbibBhLmV7rOz9MW/0zLDNscA7SdMIC+2wd68VWEg==
(1) Connect the computer including the PC application development environment to the CNC.
(2) In Visual Studio, set a breakpoint in the process where the return value is EW_BUSY.
(3) Connect the PC on which LoadFocasFunc.exe is installed with CNC and Ethernet.
(4) Start LoadFocasFunc.exe on the computer.
(5) Enter the IP address and Port number of CNC into LoadFocasFunc.exe and press the CONNECT button.
(6) Press the START button on the computer to load the CNC data reading and writing.
(7) Check that EW_BUSY processing of PC application is executed in Visual Studio. If do not come to
EW_BUSY processing, please reduce the value of Interval of LoadFocasFunc.exe.
Ed
About development 04 Draw A-42148-00093EN
Title cautionary note of
Date Sheet
customization software 2021. FANUC CORPORATION 20/33
07/19
© MyFANUC B702B2F68851464B8B0D71626E906C08
7169FPDAVxTjbjuntGBbibBhLmV7rOz9MW/0zLDNscA7SdMIC+2wd68VWEg==
Use the PMC trace function to check the address related to the request in the PMC window.
Note
If writing to the CNC parameters using a PMC ladder, etc., please turn off the check
box of Main
Program of LOAD SETTING of LoadFocasFunc.exe.
When writing to the CNC parameters using a PMC ladder, etc., if both Upload (READ
of CNC
parameters) and Main Program are executed, LoadFocasFunc.exe may terminate
with an error "ret = -16".
Ed
About development 04 Draw A-42148-00093EN
Title cautionary note of
Date Sheet
customization software 2021. FANUC CORPORATION 21/33
07/19
© MyFANUC B702B2F68851464B8B0D71626E906C08
7169FPDAVxTjbjuntGBbibBhLmV7rOz9MW/0zLDNscA7SdMIC+2wd68VWEg==
Ed
About development 04 Draw A-42148-00093EN
Title cautionary note of
Date Sheet
customization software 2021. FANUC CORPORATION 22/33
07/19
© MyFANUC B702B2F68851464B8B0D71626E906C08
7169FPDAVxTjbjuntGBbibBhLmV7rOz9MW/0zLDNscA7SdMIC+2wd68VWEg==
Ed
About development 04 Draw A-42148-00093EN
Title cautionary note of
Date Sheet
customization software 2021. FANUC CORPORATION 23/33
07/19
© MyFANUC B702B2F68851464B8B0D71626E906C08
7169FPDAVxTjbjuntGBbibBhLmV7rOz9MW/0zLDNscA7SdMIC+2wd68VWEg==
Ed
About development 04 Draw A-42148-00093EN
Title cautionary note of
Date Sheet
customization software 2021. FANUC CORPORATION 24/33
07/19
© MyFANUC B702B2F68851464B8B0D71626E906C08
7169FPDAVxTjbjuntGBbibBhLmV7rOz9MW/0zLDNscA7SdMIC+2wd68VWEg==
Ed
About development 04 Draw A-42148-00093EN
Title cautionary note of
Date Sheet
customization software 2021. FANUC CORPORATION 25/33
07/19
© MyFANUC B702B2F68851464B8B0D71626E906C08
7169FPDAVxTjbjuntGBbibBhLmV7rOz9MW/0zLDNscA7SdMIC+2wd68VWEg==
Ed
About development 04 Draw A-42148-00093EN
Title cautionary note of
Date Sheet
customization software 2021. FANUC CORPORATION 26/33
07/19
© MyFANUC B702B2F68851464B8B0D71626E906C08
7169FPDAVxTjbjuntGBbibBhLmV7rOz9MW/0zLDNscA7SdMIC+2wd68VWEg==
Ed
About development 04 Draw A-42148-00093EN
Title cautionary note of
Date Sheet
customization software 2021. FANUC CORPORATION 27/33
07/19
© MyFANUC B702B2F68851464B8B0D71626E906C08
7169FPDAVxTjbjuntGBbibBhLmV7rOz9MW/0zLDNscA7SdMIC+2wd68VWEg==
Ed
About development 04 Draw A-42148-00093EN
Title cautionary note of
Date Sheet
customization software 2021. FANUC CORPORATION 28/33
07/19
© MyFANUC B702B2F68851464B8B0D71626E906C08
7169FPDAVxTjbjuntGBbibBhLmV7rOz9MW/0zLDNscA7SdMIC+2wd68VWEg==
Ed
About development 04 Draw A-42148-00093EN
Title cautionary note of
Date Sheet
customization software 2021. FANUC CORPORATION 29/33
07/19
© MyFANUC B702B2F68851464B8B0D71626E906C08
7169FPDAVxTjbjuntGBbibBhLmV7rOz9MW/0zLDNscA7SdMIC+2wd68VWEg==
6 FANUC application
The following FANUC application was improved that load of CNC was reduced.
Use the latest version.
Ed
About development 04 Draw A-42148-00093EN
Title cautionary note of
Date Sheet
customization software 2021. FANUC CORPORATION 30/33
07/19
© MyFANUC B702B2F68851464B8B0D71626E906C08
7169FPDAVxTjbjuntGBbibBhLmV7rOz9MW/0zLDNscA7SdMIC+2wd68VWEg==
Be careful enough for the following warnings when you develop two or more
applications or use networks.
If you neglect them, machine may behave in an unexpected working and tool, work
piece, and machine may be damaged. In the worst case, there is an operator’s
extreme risk of death or serious injury.
2 Be careful enough that you must prevent PMC signals in the same byte from
being written by the following two or more applications including network
functions. While an application reads and writes one byte of PMC signals, other
applications may write the same byte.
3 Be careful enough if you process a PMC signal set that is related to a NC function
by using the following two or more applications including network functions.
Because they are executed based on each individual cycles (in other words,
asynchronous cycles), there is a possibility that the NC may receive the PMC
signal set in an unexpected order.
4 Generally, when multi-byte data are read or written at once among the following
two or more applications including network functions, the coherency of the read
multi-byte data (in other words, reading all latest data at once) is not guaranteed.
To ensure the coherency of the multi-byte data, prepare flags to notify the
completion of reading or writing process that is separated from the entity of the
data and make the handshaking process to access the data by using the flags.
Ed
About development 04 Draw A-42148-00093EN
Title cautionary note of
Date Sheet
customization software 2021. FANUC CORPORATION 31/33
07/19
© MyFANUC B702B2F68851464B8B0D71626E906C08
7169FPDAVxTjbjuntGBbibBhLmV7rOz9MW/0zLDNscA7SdMIC+2wd68VWEg==
WARNING
Data List Table
Category Data
Parameter, Tool compensation value and related data,
Work zero offset value and related data,
Workpiece coordinate system shift value and related data,
Macro variable, P-CODE variable, Program and related data,
General data for NC
Tool management function data, Tool life management data,
Error compensation related data ,
Overtravel check (Interference check) related data ,
Software operator’s panel related data
PMC data PMC signal, PMC parameter
Tool data for punch press and related data, Safety zone data and related data,
Data for Laser, Laser cutting condition data and related data, Laser oscillator setting data and
Punch press or Wire cut related data, Wire consumption compensation data, Guide position
compensation data, Workpiece leveling data
Other data Parameters for Data Server, Parameters for network setting
5 CNC has functions that read or write PMC signals in other than the G/F address.
Be careful enough if the above mentioned applications and network read or write
PMC signals used by these functions. When reading or writing the same PMC
signal, applications or CNC functions may work in an unexpected manner.
As for the CNC functions of interest, refer to the connection manual
(Function) ”Appendix B. List of Functions Using PMC Signals Other Than G/F
Address”.
Ed
About development 04 Draw A-42148-00093EN
Title cautionary note of
Date Sheet
customization software 2021. FANUC CORPORATION 32/33
07/19
© MyFANUC B702B2F68851464B8B0D71626E906C08
7169FPDAVxTjbjuntGBbibBhLmV7rOz9MW/0zLDNscA7SdMIC+2wd68VWEg==
【Version history】
Ed Date Description
01 Jun.13,2019 The first edition registration
02 Feb.05,2020 1.Outline was modified. 4.FOCAS application was added.
03 Oct.30,2020 Section 2.3, 2.4 and 7 are added. A note in 3.2 was added.
04 Jul.19,2021 ‘Getting and releasing library handle’ is added to the section 2.1.
Description about website is deleted in the 1.Outline.
Ed
About development 04 Draw A-42148-00093EN
Title cautionary note of
Date Sheet
customization software 2021. FANUC CORPORATION 33/33
07/19
© MyFANUC B702B2F68851464B8B0D71626E906C08