file load G-code txt.file in arduino

Hi,

i am a new programmer and i have some questions. How is it possible to load my g-code in arduino from a text.file which is in my computer? I don't wanna use a SD Card. Can it be done without using a software like universal g-code sender? If so, which is the right way?

Can it be done without using a software like universal g-code sender?

Yes, you can write a custom g-code sender application.

If so, which is the right way?

Get busy writing.

Though what improvements you could make on the universal g-code sender, having to ask these questions, I can not imagine.

We may be able to provide more useful advice if you explain why you don't want to use the Universal GCode Sender program.

...R

The home project that i am working on is to shet a network, controlling 4 arduinos by using an ID for each one. Using the serian number of the arduino can i make a path to send G-Code to the one that i want to use? Any ideas ?

You do not say how the Arduinos are connected to the PC but here are some ideas

(1) Send the data to all of the Arduinos and have the target one recognise itself as the target and load the g-code

(2) use serial comms and only send the g-code to the appropriate COM port for the target Arduino

(3) use a network and only send the g-code to the appropriate IP address for the target Arduino

pipertzisdimitris:
The home project that i am working on is to shet a network, controlling 4 arduinos by using an ID for each one. Using the serian number of the arduino can i make a path to send G-Code to the one that i want to use? Any ideas ?

Sorry, but I can't make sense of that.

  • I don't know what you intended to type in place of shet.
  • I don't understand what GCode has got to do with a network.
  • You have not told us how the Arduinos are connected - or what they are connected to.
  • You have not told us what each of the Arduinos does.
  • Nothing in what I have quoted seems to be related to loading GCode from a text file.

And you did not answer the question in Reply #2

...R

Sorry if i am being vague but i am new in the world of programming.My purpose is to make a connection by 4 Arduinos. I want each one to control a motor. The power suply tha i use is by usb port. I want to send g-code and the right one arduino can read it so I can run it.If it is possible i want all 4 arduinos to run when i send them a .txt file with its ID.What I have in my mind is feasible or i'm thinking in a wrong way? I am sorry if any information is missing.Thank you for understanding.

What is sending the data ?
Why do you need 4 Arduinos ?

  1. The data will be sent by prossesor in txt file.
  2. I want 4 Arduinos to do diferent processing.

Perhaps it would be better if you described the project in more detail. There may be solutions that you have not thought of.

pipertzisdimitris:

  1. The data will be sent by prossesor in txt file.
  2. I want 4 Arduinos to do diferent processing.

It would be a big help if you respond to each of the points in Reply #5 as well as Reply #1 and Reply #9

Help us to help you.

...R

Ok.Lets start from the beginning.My idea was to make a cnc machin with 4 spindles. Each spindle will have to do different process. I want to implement it with 4 Arduinos. Perhaps with master-slave connection. I want somehow to send G-Code in text file. Each arduino in my opinion has to has an ID so I can sent the text file in the right location. After that I want the arduinos to start the process (G-Code) each with its own text archive. I hope I made myself clear.

I hope I made myself clear.

That is much clearer, thank you, but you have still not explained how the Arduinos are connected to the PC or what is sending the data.

Are you actually sure that you need 4 Arduinos ?

pipertzisdimitris:
Ok.Lets start from the beginning.My idea was to make a cnc machin with 4 spindles.

It would help if you explain what you mean by "spindle" in case we are misunderstanding you.

If you have a single machine with 4 different tools I don't see a need for 4 Arduinos. And if there is only one Arduino then I would expect that the GCode could easily specify which tool is to be used - that is a common requirement with high-end CNC machines.

Of course another approach would be to interpret the GCode on the PC and then it could send commands for movements to different Arduinos.

If you tell us what the CNC machine is for and maybe provide a diagram of it then it will be much easier to help.

...R

If you are connecting each Arduino by USB, you have 4 serial connections, the host can send whatever it likes to whichever port. The fact the data comes from a text file isn’t germane to the problem, this seems simply to be a case of understanding how to use serial over USB?

I would like to send my files by using one COM port from my pc. I will use as many Arduinos as it needs. I want 4 Arduinos to be controlled by an other Arduino. I want the master Arduino to transports
the text files to the right Arduino.

I want to use 4 different tools , on 1 machine , which each one will have to do different patern. I want 3 Axis for each tool (X,Y,Z) thats why i want to use 1 Arduino for each tool. Also i want to use only one serial port to sent the files to the Arduinos. The cnc machine it to make everytime 4 different patern in one moterial but in other coordinates of it.

Is that the sound of goalpost moving that I can hear ?

PC to master Arduino via serial link is easy. See Serial input basics - updated

The data sent will include a means of identifying the target Arduino which will be one of 4.
Parse the data from the PC on the master Arduino and send it to the appropriate slave based on the destination decoded from the PC message. How you pass it on depends on you. A serial interface is possible but will mean that the master Arduino needs 5 serial interfaces so probably not the best solution.

So, how about using I2C to distribute the data ? Put each slave Arduino on a common bus, give them each a different address and send the data as appropriate.

" So, how about using I2C to distribute the data ? Put each slave Arduino on a common bus, give them each a different address and send the data as appropriate. "

Some help with its implementation?

Will i have to upload a code to each tool Arduino so they can run a G-Code .txt file?

Some help with its implementation?

Install the Wire library if you have not already got it and look at the examples

See also Arduino - Wire for examples and explanations. The Master Writer/Slave Reader example would make a good place to start.

Will i have to upload a code to each tool Arduino so they can run a G-Code .txt file?

Getting the data to the Arduino is just the first step. Each Arduino will need to be running a program that interprets the G-Code and outputs the appropriate commands to its spindle to move it X, Y, Z and control its speed.