Hello Guest it is March 28, 2024, 04:04:22 AM

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

0 Members and 1 Guest are viewing this topic.

Offline fdos

*
  •  326 326
    • View Profile
Re: Arduino Modbus, Complete, Documented and free
« Reply #20 on: February 27, 2013, 05:01:07 PM »
Had a bit more of a dabble.

Just for fun added to

void setup()

   pinMode(13,OUTPUT);  
   pinMode(8,OUTPUT);

and to

void loop()

digitalWrite(13,regs[3]);
digitalWrite(8,regs[4]);

As expected I get access to Arduino pins 8 and 13 via modbus test (registers 3 & 4) and vbscript (Setmodoutput (0 & 1)) etc fine.

Could be useful..   I chose those pins as purely arbitary examples.  Normally I'd probably pick them sequentially.

« Last Edit: February 27, 2013, 05:12:10 PM by fdos »
Re: Arduino Modbus, Complete, Documented and free
« Reply #21 on: February 27, 2013, 05:34:14 PM »
Hello Wayne:
Sounds like you have the basics going in the right direction.

John

Offline fdos

*
  •  326 326
    • View Profile
Re: Arduino Modbus, Complete, Documented and free
« Reply #22 on: February 27, 2013, 06:24:30 PM »
Yes, it's fairly straightforward now I have the same code you other guys are using!

Seems to be some redundent defintions etc in there, might have a go at tidying it up a bit.



Wayne...
Re: Arduino Modbus, Complete, Documented and free
« Reply #23 on: April 06, 2013, 08:52:05 AM »
Sorry when i verify, The arduino say "WProgram.h" no such file. :'(

Is it miss some file?

Thank you so much

Offline fdos

*
  •  326 326
    • View Profile
Re: Arduino Modbus, Complete, Documented and free
« Reply #24 on: April 06, 2013, 08:57:39 AM »
Change all references of WProgram.h to arduino.h.

 I think that's what I did.  However I found the other sketch we have been talking about to be better.

Re: Arduino Modbus, Complete, Documented and free
« Reply #25 on: April 10, 2013, 09:36:05 PM »
Change all references of WProgram.h to arduino.h.

 I think that's what I did.  However I found the other sketch we have been talking about to be better.


Thank you very much.It is work now
Re: Arduino Modbus, Complete, Documented and free
« Reply #26 on: March 10, 2014, 07:29:11 PM »
Hi!
I have my Arduino programmed with the library on this thread and setup 4 IO's (pins 2,3,4 and 5) to input. In the test window of Mach3, i can see the change of status while i press or not my buttons on the board....the value of register 0 goes from 003C (notthing pressed) to, for example, 0038 (pin 2 grounded), so i know that my arduino and communication os working.
The problem is that i can't get any brain to work....i can't get my mach3 to undrstand that this modbus input should make "#INPUT1" active. Can anybody help me with this brain?
Tks.
Re: Arduino Modbus, Complete, Documented and free
« Reply #27 on: March 23, 2014, 04:58:04 PM »
Hey HI!

Shilling, thank you for this awesome documentation, it works fine!
I can blink with diode on my Arduino Uno R3, but I have few question about this documentation and CNC.

I'm working on my first CNC machine and I'm newbie in this area, for this moment I have:
- Arduino Uno R3 - http://cdn.makezine.com/make/arduino/Arduino-callouts1.jpg
- 2xL298N driver for stepper motor - http://image.dhgate.com/albu_355579110_00-1.0x0/a35-l298n-stepper-motor-driver-board-robot.jpg
- 2xunipolar stepping motors MITSUMI M42SP-5P (from printers) - http://img441.imageshack.us/img441/1098/minip9251053.jpg
- Power supply for 12/24V;
- future CNC from wood.

Connection between Arduino|drivers|motors looks like on picture in attach.

I had already upload "firmware" for Arduino, but I can't get how to setup Mach3, because for connection one motor it took 4pins on Arduino. In the Config -> Ports and Pins -> Motor Outputs you can specify only 2pins.
Can anyone help with a link for good tutorial or documentation how to setup Mach3+ModBus+Arduino?
Or, maybe, someone can with understanding "How to work with Brain" when you are making CNC?

Thanks everyone for help!
Have a good day!)

Offline Fastest1

*
  •  920 920
  • Houston, TX
    • View Profile
Arduino Modbus, Complete, Documented and free
« Reply #28 on: March 24, 2014, 09:07:33 AM »
Are you trying to use pin 3 for step on 1 motor and direction on another?
I want to die in my sleep like my grandfather, not like the passengers in the car! :-)
Re: Arduino Modbus, Complete, Documented and free
« Reply #29 on: June 11, 2014, 04:09:55 PM »
For those trying to work through these specific errors when compiling:

WProgram.h - no such file
"Config_IO" was not Declared In This scope
"Kill_IO" was not Declared In This scope
"Updates_Pin_states" was not Declared In This scope
"UpdatesAN_States" was not Declared In This scope

As found elsewhere on the internets, the answers are relatively simple: replace (or as I did, copy) all instances of WProgram.h to Arduino.h - the newer compilers changed this after this thread was created. For the "not declared..." errors, follow Shilling's instructions *explicitly* - don't just go blindly. If you're using a non-Windows OS, you'll need to make sure permissions (or more specifically, ownership) is appropriate for the user that's launching the IDE.



HINT: The answer is in section 3.2, page 11 of his instructions. Chances are you might be opening the wrong file (ask me how I know  :P )

HTH!!!