Modbus Stack: A tested Modbus Protocol Library for embedded systems

Intro to the CAS Modbus Stack

Modbus is an application layer messaging protocol, positioned at level 7 of the OSI model, which provides client/server communication between devices connected on different types of buses or networks.

Chipkin's Modbus stack (CAS Modbus Stack) is a software library that allows you to add a native Modbus interface to your embedded devices or software applications. The Modbus stack supports both Modbus slave/server (Field device, power meter, gas detector, etc.) and Modbus master/client (HMI, Utilities, data loggers, etc.).

Take it from us, we have been working with Modbus for 20+ years! We know what we are are doing. Purchasing the Modbus Stack from us will save you man-years of development when your company needs it the most. Let us handle the grunt work for you.

Modbus Stack
Modbus Stack - OSI Layers

Benefit from our 20+ years of Modbus experience!!!

Modbus Logo

  • Network layer independent supporting; Modbus TCP (Ethernet), Modbus RTU (RS485/RS232), and other Modbus flavors.
  • Supports both Modbus server (Slave) and Modbus client (Master) functionality.
  • Interfaces to a wide array of different programming language. C, Python, C#, Java, Delphi, Node.JS, etc...
  • Supports Windows, Linux, MacOS, RTOS, and embedded platforms
  • Designed for maximum portability across a wide range of different architectures and operating systems. X86, 32-bit, 64-bit, ARM, AVR, Microchip, Freescale ColdFire, etc.
  • Supports a wide range of compilers. GCC, Microsoft Visual C++, Borland C++, Code Warrior, IAR, CrossWorks, MicroChip MPLab.
Automation Checkmark
PCB Board
Supported Modbus Functions

  • 01 (0x01) Read Coils
  • 02 (0x02) Read Discrete Inputs
  • 03 (0x03) Read Holding Registers
  • 04 (0x04) Read Input Registers
  • 05 (0x05) Write Single Coil
  • 06 (0x06) Write Single Register
  • 15 (0x0F) Write Multiple Coils
  • 16 (0x10) Write Multiple registers
  • Other functions can be added as required

Source Code and Code Quality

Chipkin's Modbus Stack source code conforms to the C++98 standard and is built for portability to many different operating systems and architectures. Extensive unit tests have been written for our Modbus Stack in Google's C++ test framework. The source code has been tested with Valgrind to detect any memory leaks, threading issues, and performance profiling. The CAS Modbus Stack is thread safe and can be used on systems that do not support threading.

The CAS Modbus Stack source code has been compiled and tested with the following compilers:

The CAS Modbus Stack interfaces support building applications in your preferred programming language:

Other compilers and programming languages may be supported as well. Please send us a message for more information

Example Source Code

Please read the Modbus Stack License Agreement.

Requirements and Dependency

The CAS Modbus stack is designed to have minimum requirements to maximize the portability of the source code across as many platforms and architectures as possible. It has the ability to run on devices with very low resources by disabling Modbus functions to reduce the required resources and dependencies.

Minimum Requirements:

  • A relative millisecond timer
  • C++/98 or better compiler
  • Standard Template Library (STL)
CAS Modbus Scanner

Modbus V1

CAS Modbus Scanner is a utility to retrieve coils, inputs, holding registers, and input registers from a Modbus-enabled device. Values retrieved from the device can be viewed in many different formats, including Binary, HEX, Uint16, Int16, Uint32, Int32, and Float32.

This utility can also discover Modbus devices on your network if you do not know their address. It works by testing every address, function, length, and offset to check for exceptions or responses.... Download for Free!

Modbus for Field Technicians (Free)

Learning about Modbus? Want to update your Modbus knowledge? This free EBook will guide you through basic and advanced Modbus topics.

We also recommend you read the official Modbus Application Protocol Specifications.

1. What does the device do? 2. Do you want to support Modbus TCP, Modbus RTU, or both ? 3. Do you want to implement a Modbus Slave (Server), or Modbus Master (Client)? 4. What Modbus function codes do you want to support? Most common function codes are 1,2,3,4,5,6,15,16 5. What programming language are you planning on using? 6. What hardware are you planning on using? 7. How much Ram, Code code space do you have available?

Contact Us

Contact us via phone (+1 866-383-1657) or leave a detailed message below for sales, support, or any other needs

*Required Field
*Required Field
I'd like to receive the newsletter. *Check email for confirmation.
*Required Field
8:00am - 12:00pm 12:00pm - 5:00pm