Skip to content

Instantly share code, notes, and snippets.

[
(7035, 0.145),
(20100-7035, 0.285),
(40200-20100, 0.37),
(80000-40200, 0.45),
("inf", 0.48)
]
@JGrossholtz
JGrossholtz / modbus_rs232_master_client.c
Last active February 4, 2026 21:07
A sample libmodbus client / server (master/slave) using RS232 to request data from a modbus client (tested with libmodbus3.0.6)
#include <stdio.h>
#include <unistd.h>
#include <modbus.h>
#include <string.h>
#include <errno.h>
#include <sys/ioctl.h>
#include <linux/serial.h>
#include <asm/ioctls.h>
#define NB_REGS 2