Hi, I'm trying to create a CNC machine by using Arduino UNO and Visual Basic code.
Up to now, I'm able to get the information from the gcode, I am able to control the stepper motor sending just one command per time between PC and Arduino, via RS232.
Now I send number of steps for motorx, number of steps for motor y and speed and then the motor does his job..
Now, I want to start with a complete cycle, so to simulate a bunch of information from pc to arduino to stepper motors. My question is: which is the best way to send these information from pc to arduino?
May be, for a complex gcode file, i will need to send thousands of messages with the information for the motors, so thousands of rs232comunication. So a RS232 message, then a motor movement, then another comunication and a motor movement and so on.
My doubt is related with the slowness of the comunication and maybe this is not the best solution.
A better solution could be to send all the information to arduino and only after, start with motor movement.
For me possible solution could be a big multidimensional array, or maybe read the value from the file directly from arduino or..... I don't know.
Any suggestion? Thanks