
------------------------------------------------------------------------------
1.3 Output NC program to be registered. <Main,Alarm>
------------------------------------------------------------------------------
[Name]
cnc_download
[Syntax]
#include <data.h>
#include <fwindow.h>
short cnc_download( char *data, short number ) ;
[Arguments]
data NC program data (ASCII string).
number Character number of NC program data (1 - 256).
[Return]
EW_OK( 0) Successful.
EW_FUNC( 1) The start-up procedure of CNC for registering NC
program has not been completed, or no start-up command
has been commanded.
EW_LENGTH( 2) Incorrect character number "number".
EW_DATA( 5) Incorrect NC program data. This code is returned under
one of following conditions.
- The same program number is already registered.
- A character which is unavailable for NC program is
detected.
- When TV check is effective, a block which includes
odd characters (including 'LF' at the end of the
block) is detected.
- No more programs can be registered because there is
no space for them.
EW_OVRFLOW( 8) No more NC program can be stored because tape memory
of CNC is full.
[Description]
Outputs NC program to be registered to CNC.
NC program output is a string of ASCII code characters.
"Start output of NC program to be registered(cnc_dwnstart)" must be
called before outputting NC program to be registered to CNC, and
"Stop output NC program to be registered(cnc_dwnend)" after
outputting.
If any program whose program number is same as newly registering
NC program's is already registered in CNC, one of following procedure
will be done according to CNC parameter No.3201#1 REP.
REP = "0" Return code "5" will be returned, and the new
program will be not registered.
REP = "1" The new program will be registered with
deleting already registered one, i.e., the new
program will replace the old one.
(Caution) It is impossible to write a program over a program that has been
selected. To replace a program that has been selected with another
program, delete the selected program or select a different program,
and then register the new program.