Author Topic: Arduino Modbus, Complete, Documented and free  (Read 146159 times)

0 Members and 1 Guest are viewing this topic.

Offline dude1

  • Active Member
  • Posts: 1,251
    • View Profile
Re: Arduino Modbus, Complete, Documented and free
« Reply #60 on: October 17, 2015, 05:53:45 AM »
Thank you for your help...
Now I have some inputs working with leds, some blinking, some fixed but I noticed that just some arduino mega ports from the main row (2 to 12) are working as outputs and none of the extra ports are working (22 to 53). look at the pinmaping https://www.arduino.cc/en/Hacking/PinMapping2560


Offline giantpt

  • Active Member
  • Posts: 8
    • View Profile
Re: Arduino Modbus, Complete, Documented and free
« Reply #61 on: October 17, 2015, 07:50:06 AM »
Well, found how to increase the number of ports on the Mega to be used... it is on the Arduino code, the default value of ports is 14, we just have to change this number to the desired number, in my case I have activated all of the digital ports with the number of 54

Now, on the Modbus configurator how can we call the analog ports? as we cannot write "Axx", it allows just numbers

Offline giantpt

  • Active Member
  • Posts: 8
    • View Profile
Re: Arduino Modbus, Complete, Documented and free
« Reply #62 on: October 20, 2015, 04:15:08 AM »
Hi guys, I found a lot of things by my self but I still need help on how to connect more than one arduino to the system.

someone knows how to do it?

thanks

Offline CNC3D

  • Holding
  • Posts: 1
    • View Profile
Re: Arduino Modbus, Complete, Documented and free
« Reply #63 on: December 04, 2015, 07:49:06 AM »
Hai, recently started with CNC Mach3 etc.  So I registered and stumbled upon Modbus, sounds cool. I've read the topic and i think i can answer your question, although 2 months late.

On one arduino compile and upload the 'standard' firmware ModBusSlave.pde
For  another arduino make a copy of ModBusSlave.pde and rename it to ModBusSlave2.pde (of course in its one arduino directory with the same name)
Open ModBusSlave2.pde and change the line

    #define Slave_Address 0x01   //Address of MODBus Slave

to #define Slave_Address 0x02   //Address of MODBus Slave

save and compile and upload.

I have yet to try it myself. but this is what I can think of to make it work.
In mach3 you also have to use slave 2 (obvious).

Regards
Frank






Offline Tweakie.CNC

  • Global Moderator
  • *
  • Posts: 7,637
  • Super Kitty
    • View Profile
    • Tweakie.CNC
Re: Arduino Modbus, Complete, Documented and free
« Reply #64 on: December 04, 2015, 07:55:39 AM »
Hi Frank,

Welcome to the forum.

Excellent explanation.

Tweakie.
Success consists of going from failure to failure without loss of enthusiasm.  Winston Churchill.

Offline aluplastvz

  • Active Member
  • Posts: 43
    • View Profile
Re: Arduino Modbus, Complete, Documented and free
« Reply #65 on: January 09, 2016, 11:53:35 AM »
I have a problem with this code when you activate the Modbus command and went M6T ???
Mach3 bag, "blocks"

Offline learncnc

  • Holding
  • Posts: 1
    • View Profile
Re: Arduino Modbus, Complete, Documented and free
« Reply #66 on: January 18, 2016, 12:45:12 AM »
Hi...everyone
Can provide many mach3 Brains and Arduino Modbus complete example.
Provide Arduino LCD Displays for mach3 portable example.

thanks.

Offline XavierMod

  • Holding
  • Posts: 2
    • View Profile
Re: Arduino Modbus, Complete, Documented and free
« Reply #67 on: February 22, 2016, 04:02:59 PM »
Hi!

I am using the Shilling library to read 10 switches and following some corrections in this post it works very well.
The problem I have is when spindle starts, comunication  is broken, perhaps there is some interference.
To solve this problem now I use the "open" button in "modbus test" window, then Mach and arduino Uno reconnect.
I would like to know how to execute this "open" function from a macro.

Also I'm thinking abou to use TCP modbus in order to avoid this problem.
I think tcp modbus allows temporary interruptions, doesn't?

Thanks in advance
Xavier

Offline Tweakie.CNC

  • Global Moderator
  • *
  • Posts: 7,637
  • Super Kitty
    • View Profile
    • Tweakie.CNC
Re: Arduino Modbus, Complete, Documented and free
« Reply #68 on: February 23, 2016, 02:06:21 AM »
Quote
The problem I have is when spindle starts, comunication  is broken, perhaps there is some interference.

I think the electrical noise issue with the spindle should be resolved first.

Tweakie.
Success consists of going from failure to failure without loss of enthusiasm.  Winston Churchill.

Offline XavierMod

  • Holding
  • Posts: 2
    • View Profile
Re: Arduino Modbus, Complete, Documented and free
« Reply #69 on: February 23, 2016, 02:33:10 PM »
Yes Tweakie, you are all right, but not ever is possible to remove all noise in circuits, specially in a 10meter usb cable.
The solution I have tested is to reopen the modbus port, but it is not practical using menu.

The Shilling library puts pin 13 up when "Kill time" is reached,
This pin 13 could be wiredd directly to an Mach input.
I would like try reopen modbus port in macropump reading this input.
The problem is I can't find any way to do that, perhaps a plugin is needed.

Xavier