Description
Writes the parameter specified by "datano","type"(only for the parameter with axis). The data format depends on each parameter. The format of Byte/Word/2-Word parameter is generally signed binary.
Writes the parameter for all axes once by specifying 'ALL_AXES' in 'type'. The parameter for each axis must be stored in each array of "IODBPSD".
The attribute of CNC parameter depends on the type and axis, and it is different for each parameter. It is as follows, and can be got by cnc_rdparainfo function.
Parameter type | Meaning | Byte size |
---|---|---|
Bit parameter | Every bits have each definition. | 1 |
Bit parameter with axis | Every bits have each definition. (each axis) | 1 |
Byte parameter | 1-byte data is stored. | 1 |
Byte parameter with axis | 1-byte data is stored. (each axis) | 1 |
Word parameter | 2-byte data is stored. | 2 |
Word parameter with axis | 2-byte data is stored. (each axis) | 2 |
2-Word parameter | 4-byte data is stored. | 4 |
2-Word parameter with axis | 4-byte data is stored. (each axis) | 4 |
Real parameter (only Series 15i, 30i, 0i-D/F, PMi-A) |
4-byte data which indicates value of variable and 4-byte data which indicates number of places of decimals are stored. | 8 |
Real parameter with axis (only Series 15i, 30i, 0i-D/F, PMi-A) |
4-byte data which indicates value of variable and 4-byte data which indicates number of places of decimals are stored. (each axis) | 8 |
It is impossible to write any bit parameter bit by bit. 8 bits(i.e. 1 byte) which belong to the same parameter number are written at the same time.
PW000 alarm(Series 15/15i, 30i, 0i-D/F, PMi-A), PS000 alarm(Series 16/18/21, 16i/18i/21i, 0i-A/B/C, Power Mate i): "PLEASE TURN OFF POWER" may be issued when some specific parameters are written.
The error(Return:EW_PROT) is returned when the locked parameter such as parameter more than 9000 is written.
PW000 alarm: "PLEASE TURN OFF POWER" may be issued when some specific parameters are written.
The error(Return:EW_PROT) is returned when the locked parameter such as parameter more than 9000 is written.
See the "PARAMETER MANUAL" of CNC for details of each parameter.
Universal Fanuc Driver
Fanuc Focas Library CD
Declaration
Arguments
Specify the library handle. See "Library handle" for details.
Specify the data block length(size of IODBPSD structure).
4+(byte size of parameter)*(number of axis)
In case that the size of parameter is 4 byte, the IODBPSD structure is as follows. In case that its size is 1, 2, or 8 byte, the size of data part per 1 parameter or 1 axis is 1, 2, 8 byte.
IODBPSD
no axis/1 axis | all axes |
---|---|
- Series 15/15i, 30i, 0i-D/F, PMi-A
n = Maximum controlled axes
- Series 16/18/21, 16i/18i/21i, 0i-A/B/C, Power Mate i
n = Current controlled axes
The spindle parameters have an axis attribute, and the data for number of spindle are valid.
Pointer to the IODBPSD structure including the parameter. The IODBPSD structure is as follows.
Series 15, 16/18/21, 16i/18i/21i, 0i-A/B and Power Mate i
typedef struct iodbpsd {
short datano; /* parameter number */
short type; /* axis number */
union {
char cdata; /* bit/byte parameter */
short idata; /* word parameter */
long ldata; /* 2-word parameter */
char cdatas[MAX_AXIS]; /* bit/byte parameter with axis*/
short idatas[MAX_AXIS]; /* word parameter with axis */
long ldatas[MAX_AXIS]; /* 2-word parameter with axis */
} u ;
} IODBPSD ; /* MAX_AXIS : max. controlled axes */
Series 15i, 30i, 0i-D/F, PMi-A and Ethernet connection
typedef struct realprm { /* real parameter */
long prm_val; /* value of variable */
long dec_val; /* number of places of decimals */
} REALPRM;
typedef struct iodbpsd {
short datano; /* parameter number */
short type; /* upper byte:type */
/* lower byte:axis */
union {
char cdata; /* bit/byte parameter */
short idata; /* word parameter */
long ldata; /* 2-word parameter */
REALPRM rdata; /* real parameter */
char cdatas[MAX_AXIS];/*bit/byte parameter with axis*/
short idatas[MAX_AXIS];/* word parameter with axis */
long ldatas[MAX_AXIS];/* 2-word parameter with axis */
REALPRM rdatas[MAX_AXIS];/* real parameter with axis */
} u;
} IODBPSD ; /* MAX_AXIS : max. controlled axes */
- datano
- Specify the parameter number.
- See the "PARAMETER MANUAL" of CNC about available parameter number. It can be got by cnc_rdparanum function and cnc_rdparainfo function.
- type
- Specify the attribute of parameter.
- Series 15, 16/18/21, 16i/18i/21i, 0i, 30i, Power Mate i, PMi-A Specify the axis number.
- Series 15i Upper byte : type
0 : no axis 1,..,m : 1 axis(m=max. controlled axes) ALL_AXES : all axes(ALL_AXES=-1)
0 : bit type 1 : byte type 2 : word type 3 : 2-word type 4 : real type 0 : no axis 1,..,m : 1 axis(m=max. controlled axes) ALL_AXES : all axes(ALL_AXES=-1) - rdata, rdatas ( Series 15i, 30i, 0i-D/F, PMi-A )
- Specify the real parameter. Specify the value of variable in prm_val, and specify the number of places of decimals in dec_val.
-
Real parameter = prm_val * 10 ** (-dec_val)
(Example) When the value of real parameter is 12.345, prm_val and dec_val are read as follows.
prm_val = 12345
dec_val = 3
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 |
---|---|
(2) |
Size of IODBPSD structure(length) is wrong. |
(3) |
Parameter number(datano) is wrong. |
(4) |
Axis number(type) is wrong. |
(6) |
There is no option required for the specified parameter. ( Series 16/18/21, 16i/18i/21i, 0i-A/B/C, Power Mate i ) |
(7) |
|
(17) |
( Series 16i/18i/21i, 0i-A/B/C ) |
As for the other return codes or the details, see "Return status of Data window function"
CNC option
And this function is related to the following CNC option.
- Series 16/18/21, 16i/18i/21i, 0i-A/B/C, Power Mate i CNC option for some specific parameters
For HSSB connection,
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/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.
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) | |||||||||||||||||
T (Turning) | - | ||||||||||||||||
LC (Loader) | - | - | - | - | - | - | - | - |
0i-D | 0i-F | 16i | 18i | 30i-A | 30i-B | |
---|---|---|---|---|---|---|
P (Punch press) | - | |||||
L (Laser) | - | - | - | - | ||
W (Wire) | - | - |
Power Mate i-D | |
Power Mate i-H | |
Power Motion i-A | O |
"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_rdparam cnc_rdparar cnc_wrparas cnc_rdparam_ext cnc_rdparainfo cnc_rdparanum
Example(C Language)
The following program writes M code for macro call in No.6080.
#include "fwlib32.h"
/* value is M-code value to be set. */
short example( long value )
{
IODBPSD param ;
short ret ;
param.datano = 6080 ;
param.type = 0 ;
param.u.ldata = value ;
ret = cnc_wrparam( h, 4+4*1, ¶m ) ;
return ( ret ) ;
}
Example(C#)
The following program writes M code for macro call in No.6080.
class example
{
/* value is M-code value to be set. */
public short sample(int value)
{
Focas1.IODBPSD param = new Focas1.IODBPSD();
short ret;
param.datano = 6080;
param.type = 0;
param.u.ldata = value;
ret = Focas1.cnc_wrparam(h, 4 + 4 * 1, param);
return (ret);
}
}