G-code
Supported M-codes
M54, M55, M56, M57 (General purpose IO)
20 min
please note that mentioned commands may fail during loading and/or simulation to make your macro code avoid these errors please take a look at the manual section run behavior during loading of job file and simulation docid\ p2jh9ffrvp0wcb5jcd9px digital outputs set output m54 p the p word must be between 1 and 10 where 1 is aux1 and 10 is aux10 if the connected controller only has one aux output, 2 is mapped to flood and 3 to mist clear output m55 p clear output the p word must be between 1 and 10 where 1 is aux1 and 10 is aux10 if the connected controller only has one aux output, 2 is mapped to flood and 3 to mist read outputs m57 p read output x , store the result in variable #5399 output p value aux1 aux n 1 to n machine on 51 drive enable 52 coolant1 (flood) 61 coolant2 (mist) 62 tool 63 tool direction 64 digital inputs read input m56 p p value input 51 56 home inputs x c 61 probe input 62 sync input 63 hwa input 64 hwb input 65 estop1 66 estop2 67 exterr 68 pause the result is stored in system parameters/variables docid\ oqhjs3llcfqksac cemc2 #5399 example erad aux input 3 example read home input of x axis read input + wait m56 p l q read digital input p and specify wait mode, the result is stored in variable #5399 p the input number l 0 do not wait l 1 wait for high l 2 wait for low q timeout (seconds) note that we use wait (l2) here, in the event of a timeout, the value of #5399 is 1 in order to make this code simulation and rendering proof we need to extend it like this analogue inputs read analog input m56 e … read analog input e, result stored in #5399 pwm set pwm m54 e q set pwm output e to permille value q (0 <= y <= 1000) read pwm output m57 e read pwm output, result stored in #5399 optional iocard if a relay board is used such as rly8 , the io number p or e is specified like in the following examples value of 103 means card 1 port 3 value of 208 means card 2 port 8