LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

serial communication interface with arduino

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

 

 

0 Kudos
Message 1 of 5
(2,947 Views)

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.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
0 Kudos
Message 2 of 5
(2,929 Views)

thanks for your help Smiley Happy

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 

0 Kudos
Message 3 of 5
(2,884 Views)

@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


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
0 Kudos
Message 4 of 5
(2,877 Views)

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

0 Kudos
Message 5 of 5
(2,781 Views)