For various items such as part counter values it is necessary to read parameter values from controllers. If you’d like to synchronize devices with each other or simply ‘tag’ a machine with things like work-order or operation number it is also useful to be able to write parameter values that can be read by your device driver later. For machines equipped with FOCAS-enabled Fanuc controllers you can use the utility programs fanucparamread and fanucparamwrite from fanucparam to do so.
For your convenience new programs with a graphical user interface are now also included in fanucparam.zip, FanucParamReadGui.exe (Ver. 184.108.40.206) and FanucParamWriteGui.exe (Ver. 220.127.116.11).
FIG 1-2: FanucParamRead and FanucParamWrite GUI Versions
Initially this utility was developed for a project with lots of older and newer machines with Fanuc controllers. The requirement was to get part counter values from all machines. Unfortunately machine manufacturers are free to store such values at different locations including parameters. With fanucparamread it was possible to search and verify these values. The utility also outputs general information about the controller and its parameters. The program is also very useful for process, tool and quality data acquisition.
fanucparamwrite can be used to set or change writable parameters at the machine.
Important: If you’re using HSSB (High Speed Serial Bus) see notes on HSSB below. In both cases run the test directly on the PC with the HSSB interface card!
If you can access the controller via the network it is highly recommend to use the program on a laptop with a network connection at the shop-floor in front of the machine. For safety reasons it is recommended NOT to use fanucparamread on machines during production. TOP
Extract all contents of the archive to a folder on your PC.
Open a command line (run CMD), navigate to the folder containing fanucparamread.exe and fanucparamwrite.exe
If you just type in fanucparamread the program shows 3 required and one optional arguments: IP or DNS Hostname Parameter Start Address Parameter End Address HSSB Type (optional 1 = real HSSB, 2 = NCGUIDE (Simulator) HSSB)
Type in something like ‘fanucparamread IPORHOSTNAME 6710 6713 (1). In this example the parameters from 6710 to 6713 are read. If data can be found the program outputs it similar to the following:
FIG 3: fanucparamread: Read parameters
In the above example data was found parameters from 6710 to 6713 (2). If you get errors please look here to find out the reason.
The program outputs the value for datatype idata (short) for every parameter.
It also outputs the lowest and highest parameter number as well as the total number of parameters (3).
In addition you get some useful information about the machine and its controller (3). More than some users do not know the controller of their machine…
Tip: To output the results to a file you can simply type in fanucparamread IPORHOSTNAME STARTADDR ENDADDR > test.txt at the command line. The output then is sent to file test.txt (in the same folder as fanucparamread) instead of the monitor. For different ranges of parameters you can use different file names.
In practice fanucparamread can be used for various requirements:
If you know that the machine stores part counter values as parameter values you can note down the value shown at the operator panel, scan a parameter range (not too much addresses at the same time!), store the output in a file and search the file for the value. If you find more than one matching value let the machine produce one part, scan and search again. By doing so it is even possible to find these values without any documentation or assistance of the machine manufacturer.
In case you want to track things like process parameters you can use the same technique: Look at the output at the operator panel and note down the respective value. Scan a parameter range and try to find the value. Change the value and scan again. As it is common that the operator panel displays converted values it may be necessary to get the conversion formula from the machine manufacturer. TOP
WRITE PARAMETER VALUES
The ability to set parameter values at the controller is useful if different machines have to be synchronized with each other (e.g. ‘Continue with part-number 10022’) or devices should be ‘tagged’ with their current work-order, operation and part-number so that they can report these items together with machine-states.
Usage is very similar to the reading utility. Simply type in fanucparamwrite IPORHOSTNAME PARAMETER PARAMTEREVALUE for example fanucparamwrite FANUC 6713 10022 (1).
Note: Please use a parameter that is writable and NOT used by the controller for other purposes, see the parameter manual for your controller!
FIG 4: fanucparamwrite: Write parameter value
In this example the program sets the value for parameter number 6713 to 10022 and verifies the operation by reading the idata (short) value for parameter 6713, you can also use fanucparamread to do so. If see errors please look here to find out the reason. TOP
If your machine has a PC that is connected to the controller via HSSB or you use HSSB features of FANUC’s NCGUIDE simulation software usage of the programs is slightly different. In both cases do NOT use the dll files starting with fwlib (e.g. Fwlib32.dll) included in fanucparam.zip. For HSSB on a real machine use the fwlib dll’s that the machine’s PC uses (search for them). For NCGUIDE use the following 5 dll’s that are installed by NCGUIDE: fwlib0DN.dll, Fwlib32.dll, fwlibNCG.dll, hssb.dll and mcnhssb.dll.
For fanucparamread type in ‘fanucparamread IPORHOSTNAME STARTADDR ENDADDR 1’ on a real machine or ‘fanucparamread IPORHOSTNAME STARTADDR ENDADDR 2’ for HSSB with NCGUIDE.
For fanucparamwrite type in ‘fanucparamwrite IPORHOSTNAME PARAMETER VALUE 1’ on a real machine or ‘fanucparamwrite IPORHOSTNAME PARAMETER VALUE 2’ for HSSB with NCGUIDE.
If you are building your own device driver for CNCnetPDM you can simply use the output of fanucparamread to create logic for output of machine- process and quality data to your application. In the following code excerpt (C++) 4 values of a parameter are queried (tool offset) and used to fill a char array which then is used to create a database record with multiple process parameters. The process parameters are delimited with pipe symbols ‘|’. In practice this code is used to track process parameters on AGIE sinkers. The program uses a for loop to query the values. A conversion formula is used (divide by 1000).
15051 is the parameter to be queried
cnc_rdparam is the function to query the parameters
hfanuc is the communication handle
&fanparam points to structure IODBPSD
cOrder is the char array to store the values
cNoresult is the standard value if the function returns no value TOP
CODE EXAMPLE (C++)
if (!cnc_rdparam(stat.hFanuc, 15051, -1, 4 + 4 * MAX_AXIS, &fanparam)) // Read tool offset (15051 = 18i)
for (int i = 0; i < 4; i++) // 4 Values
sprintf(buf, "%.3f%.1s", (float)fanparam.u.ldatas[i] / 1000, cDelim); // add value + |
strcat(stat.cOrder, buf); // Add to stat.cOrder
else // Did not work
for (int i = 0; i < 4; i++) // 4 Values
strcat(stat.cOrder, cNoresult); // 0|0|0|0|