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 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) value type information u16 16 bit unsigned integer (default) u32 32 bit unsigned integer u64 64 bit unsigned integer i16 16 bit signed integer i32 32 bit signed integer i64 64 bit signed integer d32 32 bit floating point number d64 64 bit floating point number data ordering designation (introduced in version 5 3) value ordering information n no reordering of data (default) b swap the bytes within each register(16 bits) w swap the placement of each register used in the combined value bw swap both the register placement and the bytes in each register example write single coil write single coil, baud rate of 19200, even parity with 1 stop bit read multiple coils, store beginning at user variable #300 read discrete inputs write single register write multiple coils write multiple holding registers report slave id read a double value (64 bit floating point) from a slave device with no data reordering (introduced in version 5 3)