G-code
Special commands
Modbus
12 min
modbus command can be used to communicate with other devices over modbus protocol please note that your controller board needs to have the modbus feature and that the controller board has to be the master device modbus \<s> \<f> \<a> \<n> \<v> \<u> \<b> \<fb> \<t> \<o> parameters s defines the slave number f function number a address n number of bits or registers v value u user variable b baud rate if not specified, baud rate of 115200 is used fb parity / stop bits configuration designation if not specified, no parity and 2 stop bits are used t data type used in rmr/3 and wmr/16 o the data ordering used in rmr/3 and wmr/16 supported baud rates 9600 19200 38400 57600 76800 115200 supported function numbers 1 rmc read multiple coils 2 rdi read discrete inputs 3 rmr read multiple registers 4 rmir read multiple input registers 5 wsi write single coil 6 wsr write single registers 15 wmc write multiple coils 16 wmr write multiple registers 17 rs report slaveid the abbreviation can be used instead of the number, so f=rmc or f rmc is equal to f1 parity / stop bits configuration designations setting parity stop bits e1 even 1 o1 odd 1 n2 none 2 n1 none 1 data type designations (introduced in version 5 3) true false 65,278false unhandled content type false unhandled content type false unhandled content type false unhandled content type false unhandled content type false unhandled content type false unhandled content type false unhandled content type false unhandled content type false unhandled content type false unhandled content type false unhandled content type false unhandled content type false unhandled content type false unhandled content type false unhandled content type false unhandled content type false unhandled content type data ordering designation (introduced in version 5 3) true false 130false unhandled content type false unhandled content type false unhandled content type false unhandled content type false unhandled content type false unhandled content type false unhandled content type false unhandled content type false unhandled content type false unhandled content type example write single coil modbus s1 f5 a0 v1 write single coil, baud rate of 19200, even parity with 1 stop bit modbus s1 f5 a0 v1 b19200 fb=e1 read multiple coils, store beginning at user variable #300 modbus s1 f=rmc a0 n8 u300 msg "c0="#300 " c1="#301 " c2="#302 " c3="#303 " c4="#304 " c5="#305 " c6="#306 " c7="#307 read discrete inputs modbus s1 f=rdi a0 n8 u400 msg "i0="#400 " i1="#401 " i2="#402 " i3="#403 " i4="#404 " i5="#405 " i6="#406 " i7="#407 write single register modbus s1 f6 a0 v255 write multiple coils \#500=0 \#501=1 \#502=0 \#503=1 \#504=0 \#505=1 \#506=0 \#507=1 modbus s1 f15 a0 n8 u500 write multiple holding registers \#600 = 1 \#601 = 2 modbus s1 f16 a0 n2 u600 report slave id modbus s1 f17 read a double value (64 bit floating point) from a slave device with no data reordering (introduced in version 5 3) modbus s1 f3 a0 n1 u700 t=d64 o=n