
Series 30i/ 31i/ 32i-A
C executor library for conversion
Programming manual
01 04.05.06
S. Hasegawa
New registration
B-64183EN/01
EDIT
DATE
DESIG.
DESCRIPTION
181/226
DRAW.NO.
3.12.14
Read the CNC Program
[Name]
pl_nc_upload2
[Syntax]
#include <pmclib.h>
short pl_nc_upload2(unsigned short path, char * buf, unsigned short size);
[Arguments]
Input
path: The CNC path number(from 1)
Set the CNC path number. When you set zero, first path CNC is
selected.
buf: Pointer to the array to store the read program
Set the pointer to the array, which the read CNC program is
stored.
*size: Size of array
Set the size of array. You can set 256 bytes in the maximum.
Output
*buf: Read CNC program
The CNC program is stored with the following format.
"\nOxxxx\n(Block 1)\n(Block 2)\n...\nMxx\n%"
The "Oxxxx" is the program number. The "Mxx" is the M code.
The end of the CNC program is the "%" character. Note that the
read CNC program is not terminated with NUL ('\0').
*size: Size of read data
The size of read data is returned. The value is equal or less than
the specified value at calling.
[Return]
0: Normal completion.
-11: The function pl_nc_upstart2() is not called.
1: The "path" is invalid.
2: The "size" is invalid.
[Description]
This function reads the CNC program.
You can read the CNC program described by ASCII characters.
You should call the pl_nc_upstart2_8d() or pl_nc_upstart2() before the
calling of the pl_nc_upload2(). You should call the pl_nc_upend2() after
the calling of the pl_nc_upload2().