Description
Writes the pitch error compensation data specified by "datano_s", "datano_e". The data must be stored in "data" array of "IODBPI" with signed binary format.
- Series 15, 16/18/21, 16i/18i/21i, 0i-A/B/C/D, Power Mate i
- Series 15i, 0i-F, 30i, PMi-A
Available range of data | : | -7,..,7 |
Available range of data | : | -128,..,127 |
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 IODBPI structure).
6+(number of pitch error compensation data)
IODBPI
N : Number of pitch error compensation data
Pointer to the IODBPI structure including the pitch error compensation data. The IODBPI structure is as follows.
typedef struct iodbpi {
short datano_s; /* start number of pitch error data */
short dummy; /* (not used) */
short datano_e; /* end number of pitch error data */
char data[N]; /* pitch error compensation data */
} IODBPI ; /* N : number of pitch error data */
- datano_s
- Specify the start number of the pitch error compensation data.
- datano_e
- Specify the end number of the pitch error compensation data.
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 IODBPI structure(length) is wrong. |
(3) |
Pitch error compensation data number(datano_s, datano_e) is wrong. |
(5) |
Pitch error compensation data(data) is out of range. |
(6) |
This function needs the pitch error compensation option. |
(7) |
CNC is not in the emergency stop. |
As for the other return codes or the details, see "Return status of Data window function"
CNC option
This function need the following CNC option.
And this function is related to the following CNC option.
Bi-directional pitch error compensation
Extended bi-directional pitch error compensation
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 related to the following CNC parameter.
See the manual of CNC parameter for details.
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
Example(C Language)
The following program writes the pitch error compensation data within the
specified number range.
#include "fwlib32.h"
/* start/end are start/end number to be written. */
/* data is array of value to be written. */
short example( short start, short end, char *data )
{
IODBPI *pitch ;
short ret, idx ;
pitch = (IODBPI *)malloc( 1024 ) ;
pitch->datano_s = start ;
pitch->datano_e = end ;
for ( idx = 0 ; idx < end-start+1 ; idx++ )
pitch->data[idx] = data[idx] ;
ret = cnc_wrpitchr( h, 6+(end-start+1), pitch ) ;
free( pitch ) ;
return ( ret ) ;
}
Example(C#)
The following program writes the pitch error compensation data within the
specified number range.
class example
{
/* start/end are start/end number to be written. */
/* data is array of value to be written. */
public short sample(short start, short end, sbyte[] data)
{
Focas1.IODBPI pitHead = new Focas1.IODBPI();
short ret, idx;
byte[] bytes = new byte[1024];
IntPtr ptrHead = Marshal.AllocCoTaskMem(Marshal.SizeOf(pitHead));
pitHead.datano_s = start;
pitHead.datano_e = end;
Marshal.StructureToPtr(pitHead, ptrHead, false);
Marshal.Copy(ptrHead, bytes, 0, 6);
for (idx = 0; idx < end - start + 1; idx++)
{
bytes[6 + idx] = (byte)data[idx];
}
ret = Focas1.cnc_wrpitchr(h, (short)(6 + (end - start + 1)), bytes);
Marshal.FreeCoTaskMem(ptrHead);
return (ret);
}
}