
Format of NC command data to be executed
NC command data to be executed to CNC is a string composed of ASCII
characters as following format.
LF Oxxxx LF Block1 LF Block2 LF ... LF Mxx LF %
LF NC command1 LF NC command2 LF ... LF Mxx LF %
LF 0x0A ('¥n').
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 commands such as
M3 S2000 ;
T14 ;
G0 X10. ;
G0 Z-5. ;
M30 ;
send a following string using cnc_dnc function.
cnc_dnc( "¥nM3S2000¥nT14¥nG0X10.¥nG0Z-5.¥nM30¥n%", 32 ) ;
The string data can be sent by multiple cnc_dnc functions.
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 ) ;