Skip to content

Instantly share code, notes, and snippets.

View lindnerlars's full-sized avatar
💭
:)

Lars Lindner lindnerlars

💭
:)
  • Kassel
  • 20:54 (UTC +02:00)
View GitHub Profile
@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