Third party software and hardware support forums. > Modbus

Mach3, Arduino, Modbus and MPG

<< < (2/7) > >>

mrprecise44:
Hello Zafar:

Is there any chance you could post the Arduino sketch in a .zip format. I  don't like the .rar type as the programs that upzip it want to  install other stuff on my computer.
I am a sometime user of Arduino, but have never interfaced it with Mach3. My current I/O for my mill is Cubloc.

Regards,
John
 

zafarsalam:
I use winrar for the rar files. It's a nice little harmless utility.

mrprecise44:
Hello Zafar:

I got the modbus program into the Arduino sketch file finally. Looking it over, it uses a higher level language, C++ perhaps, than the standard Arduino, and is definitely not user friendly to decipher. However, after some effort, I got it to recognize digital input pins, i.e., D2, D3, and compile. What threw me off was the program setup section has analog input pins listed as the letter "t". ??

Also, I did a search on the Arduino site, and located the list of Modbus functions used, and their meaning. In the Arduino sketch, they list the functions like 0x01; 0x03; but do not use the comment feature to explain what they do.
-----------------------

0x01 - Read Coils
0x02 - Read discrete Inputs
0x05 - Write Single Coil
0x0F - Write Multiple Coils

0x03 - Read Holding Registers
0x04 - Read Input Registers
0x06 - Write Single Register
0x10 - Write Multiple Registers
0x16 - Mask Write Register
0x17 - Read Write Multiple Registers

--------------------
Anyhow, I will try it on a Mega, and see if the digital inputs higher than 15 will work.
Thanks for your effort. The zip file was appreciated.

I did find an un-zipper for RAR on the SourceForge site. All the winRAR files I located by Google were 40 to 50 megabytes, and were a pain to try to use. The SourceForge program was very small, and downloaded in a few seconds.

If the program will run the Mega pins above 15,  you could have lots of digital I/O available.

Regards,
John

zafarsalam:
John,

See the developer's notes at the website in the initial comments section of the sketch. Not all the modbus functions are implemented in this one. For digital inputs and other functions of Arduino, I'd recommend to go through the example codes of Arduino software and the tutorial section of the Arduino website.

Zafar

mrprecise44:
Zafar:

I have not tried the actual hardware yet, but what I plan to do is copy some working code from one of my working Arduino programs, like a digital pin I/O actuating an LED, into the "void/loop" and see if it works. If I get one to work, changing the pin numbers and re-compiling for higher numbers will show what is or is not working.

John

Navigation

[0] Message Index

[#] Next page

[*] Previous page

Go to full version