Description
Read NC program registered on the tape memory in CNC (program memory).
The procedure of uploading is as follows.
Format of input dataNC program which is read from CNC is the string composed of ASCII characters as following format.
% LF Oxxxx LF Block1 LF Block2 LF ... LF Mxx LF %
where,
LF | 0x0A ('\n': EOB) |
Oxxxx | Program number |
Mxx | M code at the end of the program(M02,M30,etc.) |
A null character('0x00') is not added at the end of each string stored in the buffer.
The last character of read NC program is '%'.
If the application keeps reading by using this function after reading the last '%', only '%' can be read for Series 15/15i, nothing can be read for Series 16/18/21, 16i/18i/21i, 0i, 30i, Power Mate i, PMi-A.
For example, when you read the following NC program using this function,
O1234 ;
G1 F0.3 W10. ;
M30 ;
%
-
you will get the following strings.
- In case of fully large buffer. Series 15/15i
- And in case that the buffer size is less than 24 bytes, you will get the following strings.
1st time | "%\nO1234\nG1F0.3W10.\nM30\n%" | (24 characters) | |
2nd and after | "%" | (1 character) |
1st time | "%\nO1234\nG1F0.3W10.\nM30\n%" | (24 characters) | |
2nd and after | "" | (0 character) |
In case that the buffer size is 10 bytes. Series 15/15i
1st time | "%\nO1234\nG1" | (10 characters) | |
2nd time | "F0.3W10.\nM" | (10 characters) | |
3rd time | "30\n%" | (4 characters) | |
4th and after | "%" | (1 characters) |
1st time | "%\nO1234\nG1" | (10 characters) | |
2nd time | "F0.3W10.\nM" | (10 characters) | |
3rd time | "30\n%" | (4 characters) | |
4th and after | "" | (0 characters) |
Universal Fanuc Driver
Fanuc Focas Library CD
Declaration
Arguments : HSSB
Specify the library handle.
See "Library handle" for details.
Pointer to the ODBUP structure including the NC program.
The ODBUP structure is as follows.
typedef struct odbup {
short dummy[2] ; /* Not used. */
char data[MAX_RBUF] ; /* NC program data. */
} ODBUP ; (MAX_RBUF : maximum character number to read)
The default value of read buffer size (MAX_RBUF) with ODBUP structure is 256.
In order to read more characters at a time, it is necessary to customize.
Specify the address of the variable which shows number of characters to be read.
Set read number of characters by one time to this variable(*number).
After reading,the number of characters actually read is set in this variable(*number) again.
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 |
---|---|
(1) |
|
(2) |
The read number of characters of NC program number(*number) is 0. |
As for the other return codes or the details, see "Return status of Data window function"
CNC option
For HSSB connection,
The extended driver/library function is necessary.
CNC parameter
This function is related to the following CNC parameter.
See the manual of CNC parameter for details.
0023=16(except EDIT mode) (must be set)
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 | H |
"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_upstart cnc_cupload cnc_upend