Skip to content

Reads and Writes Hardware Inputs/Outputs into Modbus Regs. This programm allows to use your Arduino as a Fieldbus Coupler over Modbus TCP. This means you can Read/Write Digital and Analog In/Outputs from a higher level controller. For example a PLC or PC.

Notifications You must be signed in to change notification settings

rocadura/Arduino-ModbusIP_Server

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 

Repository files navigation

WHAT IS THIS?

This programm allows to use your Arduino as a Fieldbus Coupler over Modbus TCP. This means you can Read/Write Digital and Analog In/Outputs from a higher level controller. For example a PLC or PC.

HOW TO USE?

*Update the file "boardDefines.h" according to your Arduino board and your needs.

  1. Change your IP, MAC, ...
  2. Update the arrays "pinsArrayDI" & "pinsArrayDO" with the pin_numbers of your board. You can use all of them as DI or DO. Or any combination such as:

Preview

*Then build and upload into the arduino board. Start serial monitor. It shows something like this:

Preview

*Use any ModbusTCP-Client to connect from your PC / PLC to the Arduino. Serial monitor should say "new client"

Preview

*Watch inputs and set outputs from the corresponding registers (1x, 2x, 3x, 4x). For example:

*Set Coils (0x) to Arduino Digital Outputs

Preview

*Read Arduino Digital inputs into Discrete Inputs registers (1x)

Preview

*Modbus Input Registers (3x)

Preview

*Modbus Holding Registers (4x)

Preview

SCALING ANALOG VALUES

Analog values are scaled from 0 to 100,0% using an integer with 10x Gain. For Example:

  • 1000 Modbus = 100% in Arduino
  • 855 Modbus = 85,5% in Arduino
  • 151 Modbus = 15,1% in Arduino

HARDWARE REQUIREMENTS:

Arduino MEGA 2560
Ethernet Shield W5100 for Arduino

SOFTWARE REQUIREMENTS (TESTED WITH):

Microsoft Visual Studio 2013 using Arduino IDE v1.6/1.8

Arduino Libraries:
	- ArduinoRS485 1.0.0
	- ArduinoModbus by Arduino 1.0.0
	- SPI Master library for arduino (built-in)
	- Ethernet library for arduino (built-in)

About

Reads and Writes Hardware Inputs/Outputs into Modbus Regs. This programm allows to use your Arduino as a Fieldbus Coupler over Modbus TCP. This means you can Read/Write Digital and Analog In/Outputs from a higher level controller. For example a PLC or PC.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages