LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Controlling tinyG board using Labview

Solved!
Go to solution

Hi everyone,

 

I am trying to use Labview to interact with a tinyG board ( which is used to control a stepper motor, the tinyG use G code). From what I understand, I need to send a serial command that specify the position to the COM port that connect to tinyG, so I used VISA to do so. I first test all the commands I need via Cool Term and then use VISA to write these commands to the COM port, however the Cool Term works while the VISA does not. Would you mind sharing some thought on this problem?

 

Thank you,

 

Toan

0 Kudos
Message 1 of 7
(4,478 Views)

Wrong cable?  Wrong serial port settings (baud, start bits, stop bits, parity)?  Other program still has control of port?

 

What is "does not work"?  Do you get any error messages?

 

Does this device require a termination character with the command and you aren't sending it with LabVIEW?

0 Kudos
Message 2 of 7
(4,472 Views)

Hi, 

 

Thank you for helping out. I'm pretty sure that the cable and the setting are correct. When I switch from cool term to labview, I disconnected the port so i dont think there is a sharing port problem. When I say does not work I mean that the commands are sent but the tinyG does not react to those (i.e the stepper motor does not move). The last question is interesting. I am not sure whether there is a termination character. If there is one, it have to be added by default in cool term I guess

0 Kudos
Message 3 of 7
(4,470 Views)

This is the labview code that I try and the setting that I used in cool term

Download All
0 Kudos
Message 4 of 7
(4,460 Views)
Solution
Accepted by topic author Tomsawyer

Do not config the serial port and close it on every iteration of the while loop!   They belong before and after the loop.

 

Do you want those commands to be send repeatedly as fast as your LabVIEW program will allow it?  That is what you are doing right now.  You may even be overflowing your buffer or causing the device to be confused and get locked up.  Try your code so it only sends one command at a time when you hit a button.

 

When you use the terminal program, are you typing stuff in and then hitting the enter key?  If you are, then of course you are sending a terminal character.  Your string constants should then have either a carriage return, or linefeed, or both in there.  Turn on \code display so you'll be able to see them.

 

Have you read the manual for this device?

0 Kudos
Message 5 of 7
(4,447 Views)

Hi,

 

I am so sorry for the late response. I am travelling for my spring break so I haven't had chance to try out your suggestion. I will let you know once I have chance to work with the tinyG again (early next week)

 

Toan

 

0 Kudos
Message 6 of 7
(4,374 Views)

Hi,

 

I tested the system today. The problem was in the terminal characters that I forgot to include. Thank you for the inside.

 

Toan

0 Kudos
Message 7 of 7
(4,352 Views)