UFACTORY Gcode
UFACTORY Gcode is compatible with LinuxCNC gcode: http://linuxcnc.org/, and refers to the RS-274 standard.
Firmware version: v2.3.0 or later
UFACTORY Studio version: V2.3.0 or later
TCP port: 504
1. G command
G0 X Y Z A B C // The speed is 240mm/s by default
G1 X Y Z A B C F // XYZ(mm), ABC(RPY,degree), F(speed,mm/min)
G2 //Arc move, clockwise arc (G2 X Y Z R P F ) (G2 X Y Z I J K P F), R-radius, I- X offset, J- Y offset, K- Z offset, P-number of turns, default is 1
G3 //Arc move, counterclockwise arc (G3 X Y Z R P F) (G3 X Y Z I J K P F)
G4 P // Dwell, Unit: s
G17 //Z-axis, XY-plane
G18 //Y-axis, YZ-plane
G19 //X-axis, YZ-plane
G20 // use inches for length units
G21 // use millimeters for length units
G90 //absolute distance mode
G90.1 //absolute distance mode for I, J & K offsets
G91 //incremental distance mode
G91.1 //incremental distance mode for I, J & K offsets
You can debug and check more examples via 'UFACTORY Studio-Gcode' page.
2. M command
M2/M30 //end program
M62 P //turn on digital output synchronized with motion(wait=True).
M63 P //turn off digital output synchronized with motion(wait=True).
M64 P //turn on digital output immediately(wait=False).
M65 P //turn off digital output immediately(wait=False).
E67 E Q //set controller analog output synchronized with motion(wait=True).
E68 E Q //set controller analog output immediately(wait=False).
P: IONUM(0-15, 0-7: CO0-CO7, 8-15: DO0-DO7)
E: IONUM(0-1), Q: value(0-10)
3. Python Example
Note:
1. Response:
byte0: return value. 0 is success
byte1: mode and state
byte2: error code
byte3 & byte4: buffer
2. Recommend to send 1 non-empty data at a time(with line breaks)
3. Need to receive the response, otherwise the buffer will be full.
Last updated