Welcome, Guest. Please login or register.
Did you miss your activation email?
July 16, 2018, 04:01:05 AM

Login with username, password and session length
Search:     Advanced search
* Home Help Search Calendar Links Login Register
+  Machsupport Forum
|-+  Third party software and hardware support forums.
| |-+  Modbus
| | |-+  Arduino Uno that works with Modbus
Pages: 1   Go Down
Print
Author Topic: Arduino Uno that works with Modbus  (Read 2554 times)
0 Members and 1 Guest are viewing this topic.
BenBouwer
Active Member

Offline Offline

Posts: 5


View Profile
« on: January 31, 2018, 01:09:33 AM »

Modbus Arduino slave for Mach3 by Ben Bouwer
  The purpose of this scetch is to link the Arduino digital and analog pins to Mach3 using the Modbus Protocol.
    To keep things simple I used a register for each pin in the arduino.
    Each register can be a Digital input, Digital output, Analog input or PWM output register
    Choose what you want each Arduino Pin to be (Digital input, Digital output, Analog input, PWM output or MPG input):
   
See attached Arduino Scetch

Unzip it

Place it in a folder within the Arduino folder the same name as the file

Arduino/Mach3_Modbus_Slave_Version_6_Point_5/Mach3_Modbus_Slave_Version_6_Point_5.ino


* Mach3_Modbus_Slave_Version_6_Point_5.zip (7.69 KB - downloaded 104 times.)
Logged
TOTALLYRC
Active Member

Offline Offline

Posts: 799


View Profile
« Reply #1 on: January 31, 2018, 07:14:06 AM »

Nice to see more Arduino stuff. If I get a chance I will try this out on my lathe since I want to add 2 pots.
Logged

We never have the time or money to do it right the first time, but we somehow manage to do it twice and then spend the money to get it right.
BenBouwer
Active Member

Offline Offline

Posts: 5


View Profile
« Reply #2 on: February 01, 2018, 12:41:10 AM »

Find attached pictures of:

Brain Setup
Brain View Register 18
Brain View Register 19
ModBus Configuration

Brain View Register 20 and 22 will be similar to Brain View Register 18
Brain View Register 21 and 23 will be similar to Brain View Register 19

You must write your own Brains for the rest of the Registers


* Brain Setup.PNG (14.79 KB, 291x371 - viewed 180 times.)

* BrainView Register 18.PNG (13.61 KB, 962x719 - viewed 185 times.)

* BrainView Register 19.PNG (19.93 KB, 963x723 - viewed 163 times.)

* ModBus Configuration.PNG (47.39 KB, 861x567 - viewed 170 times.)
Logged
BenBouwer
Active Member

Offline Offline

Posts: 5


View Profile
« Reply #3 on: February 01, 2018, 12:46:58 AM »

Please be carefull.
The program was not tested on a real machine!
Modbus must not be used for critical inputs or outputs.
See Mach3 manual.
Logged
duongfx
Holding

Offline Offline

Posts: 1


View Profile
« Reply #4 on: February 10, 2018, 05:13:35 AM »

 I will try this,thank to Ben
But i do not see ModbusRtu.h include
« Last Edit: February 10, 2018, 05:20:06 AM by duongfx » Logged
BenBouwer
Active Member

Offline Offline

Posts: 5


View Profile
« Reply #5 on: February 12, 2018, 06:58:14 AM »

You must downdoad it form https://github.com/smarmengol/Modbus-Master-Slave-for-Arduino

Download it as a Zip file.

Install it using the menus in the Arduino IDE: Sketch, Include Library, Add.ZIP Library

Also download the other Libraries from the Arduino Site or from Git Hub and install them.

#include <ModbusRtu.h>                                          // Ensure that the ModbusRtu library is included (under libraries)
#include <Wire.h>                                                    // Ensure that the Wire library is included (under libraries)
#include <LiquidCrystal_I2C.h>                               // Ensure that the LiquidCrystal_I2C library is included (under libraries)
#include <Encoder.h>                                              // Ensure that the Encoder library is included (under libraries)
Logged
mkydj
Holding

Offline Offline

Posts: 1


View Profile
« Reply #6 on: March 21, 2018, 03:36:26 AM »

Hi Ben,the project is very interesting, which arduino is better?
Do not know well brain mach3, have file brn of the project?
Logged
BenBouwer
Active Member

Offline Offline

Posts: 5


View Profile
« Reply #7 on: April 23, 2018, 06:06:47 AM »

I do not have the Brain file for the project. You can do it yourself using the info above.
Logged
Pages: 1   Go Up
Print
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.20 | SMF © 2013, Simple Machines Valid XHTML 1.0! Valid CSS!