Description
Sends NC command data to CNC(for DNC operation).
When the data processing on the CNC side is delayed and the data cannot be transferred,
this function waits until it can be transferred.
If an application cannot wait, use the cnc_cdnc function.
The procedure of DNC operation is as follows.
In case of Series 15, the parameter No.20 must be set to '15'.
Even if this setting is not done, this function does not return error.
In case of Series 16/18/21, 0i, Power Mate i, "DMMC" signal(DI)<G042#7> must be on.
Even if this setting is not done, this function does not return error.
For transferring the data, there are 16 buffers of 256 bytes in case of
Series 15, and there are 4 buffers of 256 bytes in case of Series 16/
18/21, 16i/18i/21i, 0i, Power Mate i.
One buffer is used at each cnc_dnc calling without any relation to the
data size. Therefore, the maximum size which can be transferred by one
calling is 256 bytes.
For series Series 16/18/21, 16i/18i/21i, 0i system, set the CNC parameter (No.8706#0=1)
to make the High Speed DNC interface be available.
High Speed DNC uses the single data buffer, which is 40K bytes size ring buffer.
Application can call the cnc_dnc() multiple times until the buffer becomes full.
Because importance is attached to the speed of data transfer to the CNC, in general, return of errors(EW_DATA, etc.) may be delayed.
Namely, an error status may refrect the result caused by the previously executed cnc_dnc callings.
And the error status for some cnc_dnc callings just before the finish of DNC transferring is returned by "End of DNC".
Format of NC command data to be executed
NC command data to be executed on CNC is a string composed of ASCII characters as following format.
-
LF NC command1 LF NC command2 LF ... LF Mxx LF %
where,
LF | 0x0A ('\n': EOB) |
Mxx | M code at the end of the DNC operation(M02,M30,etc.) |
'LF' must be placed at the top of the whole NC commands, and '%' at the end.
'LF's are added after each NC commands.
For example, to execute the commands such as
-
M3 S2000 ;
T14 ;
G0 X10. ;
G0 Z-5. ;
M30 ;
-
cnc_dnc( "\nM3S2000\nT14\nG0X10.\nG0Z-5.\nM30\n%", 32 ) ;
For above example, the commands can be sent block by block like this.
-
cnc_dnc( "\n", 1 ) ;
cnc_dnc( "M3S2000\n", 8 ) ;
cnc_dnc( "T14\n", 4 ) ;
cnc_dnc( "G0X10.\n", 7 ) ;
cnc_dnc( "G0Z-5.\n", 7 ) ;
cnc_dnc( "M30\n", 4 ) ;
cnc_dnc( "%", 1 ) ;
Note1) The G130 function of Power Mate i-H cannot be used. |
Universal Fanuc Driver
Fanuc Focas Library CD
Declaration
Arguments : HSSB
Specify the library handle.
See "Library handle" for details.
Specify the number of characters of NC program data.(1,..,256)
(In case of High Speed DNC of SeriesSeries 16/18/21, 16i/18i/21i, 0i, it is 1,..,40959)
Specify the top address of NC program 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) |
'RESET or STOP' was pushed. Call the cnc_dncend function. |
(1) |
|
(2) |
Length of data block(number) exceeds 256 bytes. (In case of High Speed DNC of Series 16/18/21, 16i/18i/21i, 0i : 40959 bytes) |
As for the other return codes or the details, see "Return status of Data window function"
CNC option
For HSSB connection,
CNC parameter
This function is related to the following CNC parameter.
See the manual of CNC parameter for details.
0000#0 (influenced by setting)
8706#0 (influenced by setting) (This parameter is effective only in path 1. Set 0 except the 1st path.)
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 | X |
"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_dncstart cnc_cdnc cnc_dncend