03-21-2018 02:05 PM
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
Solved! Go to Solution.
03-21-2018 02:14 PM
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?
03-21-2018 02:23 PM
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
03-21-2018 03:07 PM
This is the labview code that I try and the setting that I used in cool term
03-21-2018 03:46 PM
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?
03-29-2018 02:08 PM
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
04-02-2018 10:20 AM
Hi,
I tested the system today. The problem was in the terminal characters that I forgot to include. Thank you for the inside.
Toan