Hello Guest it is April 25, 2024, 06:38:39 AM

Author Topic: Modbus Programming guidance needed  (Read 4218 times)

0 Members and 1 Guest are viewing this topic.

Re: Modbus Programming guidance needed
« Reply #30 on: January 05, 2021, 08:44:08 AM »
Mike, We are trying to make a system that will need no real settings. It is a really cleaver setup and I think you will like it better. This will make for a much shorter development cycle.

Chris,
I have sent you a message off list and we can make a time for me to poke around your machine. I hope we can get this rolling and others will be able to get something from this.
Fixing problems one post at a time ;)

www.newfangledsolutions.com
www.machsupport.com
Re: Modbus Programming guidance needed
« Reply #31 on: January 05, 2021, 04:29:50 PM »
 ;D Since it will work even for dummies like me I am more than willing to try it. ;D

Mike
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.
Re: Modbus Programming guidance needed
« Reply #32 on: January 06, 2021, 01:57:15 AM »
I made something in the past that may be helpful to this chat. Just updated and tested again before I am posting here.

It's a tutorial with all the code as well as an exe installer to get a Arduino Mega with a simple shield to act as a 32 input 32 output modbus device with the possibility of also having the ability to add an ADC or DAC (or both).

It's really simple and includes an exe installer that configures the modbus settings automatically in the Machine.ini so all you have to give the device an IP address. The installer will not overwrite anything but make a backup if you try this first. It might help some with the confusion of setting up modbus.

Here is all you need in hardware:
https://www.amazon.com/XCSOURCE-ATmega2560-16AU-ATMEGA16U2-Expansion-TE168/dp/B00XXEI2CI/ref=sr_1_5?dchild=1&keywords=w5100&qid=1609915738&s=electronics&sr=1-5

Here is the tutorial with all the code:
https://github.com/kethort/io-over-tcp-modbus-arduino-mach4/blob/master/README.md
Re: Modbus Programming guidance needed
« Reply #33 on: January 06, 2021, 04:26:10 AM »
Hi compewter_numerical,
Nice work!
Since I have the Mega and the ethernet card I will give this a try while waiting for Brian's solution.

Mike
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.
Re: Modbus Programming guidance needed
« Reply #34 on: January 06, 2021, 06:37:37 AM »
Nice!
Fixing problems one post at a time ;)

www.newfangledsolutions.com
www.machsupport.com

Offline jbuehn

*
  •  101 101
    • View Profile
Re: Modbus Programming guidance needed
« Reply #35 on: January 06, 2021, 12:26:44 PM »
Very cool!
Re: Modbus Programming guidance needed
« Reply #36 on: January 06, 2021, 11:54:35 PM »
cool thanks. I just tested the mega/ethernet repo (a couple posts ago) on a fresh install and fixed some issues and the readme. So here is a demo using a 10k pot to ADC from 0V-5V to adjust on screen slider.

https://www.youtube.com/watch?v=ColmX-h78hE

Unfortunately, the slider goes crazy if you assign it a modbus register and an internal Mach4 function. The ADC values need some work too but I'm too lazy to do anything about it and it's probably going to be different for each ADC (I'm using a 16 bit res ADC).
 
If you get really bored you can try to build this MPG Handwheel I turned wireless using a Arduino like device (ESP32). It also has an installer for easy modbus setup and a wizard.

https://github.com/kethort/esp32-cnc-mpg-handwheel-conversion-mach4