05-18-2018 04:52 AM
hi there !
As part of my project of end of study, I wish to build a cnc machine with two axes. I used two Nema 17 stepper motors and an arduino uno card for the interpretation of the G code with a CNC shield and two DRV8825 type drivers. I have already developed the program that will help me translate G-code instructions into motion. now i am interfacing with labview to communicate with my Arduino. I want to know the number of lines in my G-code file and send them one after another to my arduino with the help of a button until the end of the file.
Any suggestion will help and thank you in advance
05-18-2018 06:01 AM - edited 05-18-2018 06:02 AM
Have a Read Text File configured to read lines and set the count to -1. This will read the entire file and give you an array of strings (one element per line in the file). Then you can just use a FOR loop to iteration on those lines.
Also, don't use the Bytes At Port. Just tell the VISA Read to read more bytes than you expect back. The timeout will occur if there is an issue with the communications.
05-21-2018 04:01 AM
thanks for your help
i got two questions :
1-wich tunnel mode i have to choose?
2-is it going to work like i want (sending one instruction by the time)
the reason that i didn't test it yet that i don't have an arduino board yet
05-21-2018 07:07 AM
@joesaad wrote:
i got two questions :
1-wich tunnel mode i have to choose?
2-is it going to work like i want (sending one instruction by the time)
the reason that i didn't test it yet that i don't have an arduino board yet
1. Which tunnel are you referring to?
2. Have you not examined the code at all? Where are the writes happening? Where are the reads happening? Spend 5 minutes to study the diagram and understand the logic.
And I also highly recommend you take some of the free online tutorials.
3 Hour Introduction
6 Hour Introduction
LabVEW Basics
Self Paced training for students
Self Paced training beginner to advanced, SSP Required
LabVIEW Wiki on Training
Learning NI
Getting Started with NI Products
07-26-2018 02:23 AM
That might help:
If you have a CNC controller that is compatible GRBL 1.1 then I think I have what you need:
https://lavag.org/files/file/303-rgbl-11/
I was able to control a GRBL controller based on a Arduino Mega with firmware GRBL 1.1 that has a CNC shield connected to it.
Good luck
Benoit