Description
Writes the NC program by line basis.
When you specify the same number("Oxxxx") in the top of the program, this function deletes the character after O number, but doesn't delete O number.
When you specify the different number("Oxxxx") in the top of the program, you get EW_DATA ad the return code.
The conditions of the function about CNC mode and the kind of program are as follows.
EDIT mode | MDI mode | Other mode | |
MDI program | × | O | × |
Selected program | O | × | × |
Not selected program | O | O | O |
If you have the playback option, TJOG/THND mode is the same as EDIT.
This function works normally if OP signal is 1 but STL signal is 0 (for example, feed hold stopping, single block stopping, etc).
When you use this function for the MDI program or the selected program in the following situations, the execution pointer goes to the top of line specified by line_no.
- MDI program in MDI mode.
- Selected program in EDIT mode.
- Selected program in TJOG/THND mode with the playback option.
Universal Fanuc Driver
Fanuc Focas Library CD
Declaration
Arguments : HSSB
Specify the library handle. See "Library handle" for details.
Specify the program number to write.
When you write the MDI program, you have to specify -1.
Specify the line number to write.
When you write to the first line of a program, you have to specify 0.
When you specify other than the existing line number, you get EW_DATA error as the return code.
Specify the pointer to the buffer holding the program text.
According to the following attentions, full the buffer with ASCII codes before writing.
- Do not use except the meaning code for CNC.
- Do not use the small letter of alphabets.
- Do not use '%' (EOR).
Specify the size of character to write.
This function checks the free area in CNC memory beforewriting.
If there is no more than (this character size + 100) in this area, this function returns EW_OVRFLOW as the return code without writing.
Attention) The character number you can write at the once is up to 200. (30i/31i/32i, 0i-D/F and PMi-A are 716 characters)
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) |
|
||||||||||||||||||||||||||||||
(5) |
In order to get more information for this err_no return value, execute cnc_getdtailerr function. The following detail status will be set onto the member, err_no of ODBERR structure.
|
||||||||||||||||||||||||||||||
(6) |
The extended driver/library function is necessary. |
||||||||||||||||||||||||||||||
(12) |
|||||||||||||||||||||||||||||||
(7) |
CNC parameter is a state of write-protection(O8000-/O9000- protection, encoding). Protect KEY signal was ON. (Writing the MDI program is excluded)(except 30i/31i/32i, 0i-D/F, PMi-A) |
||||||||||||||||||||||||||||||
(13) |
The specified program is running.
|
||||||||||||||||||||||||||||||
(8) |
It is lack of free area in CNC memory. Make enough free area in CNC memory. |
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 not related to CNC parameter.
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_rdprogline cnc_rdprogline2 cnc_delprogline cnc_searchword cnc_searchresult