10-16-2008 01:50 AM
environment:
-windows xp professional sp2
-Labview 8.5
description:
I have an instrument with rs232 interface, when I use UartAssist tool to send the command, the instrument could receive successful.
but, when I start my labview application to use visa control, and send the exactly same command, there's no response.
I trace the error during my control, there's no error occured after send command(send successful), but the instrument didn't response.
I'm sure the baudrate and other configuration is right, why the instrument can not response?
BTW, I try using the HyperTerminal to send the same command, the instrument can response too...
Solved! Go to Solution.
10-16-2008 03:10 AM
BTW, I try using the HyperTerminal to send the same command, the instrument can response too...
10-16-2008 09:29 AM
muks wrote:BTW, I try using the HyperTerminal to send the same command, the instrument can response too...
So do you mean it is working fine in hyper terminal?
I'd say that's probably a yes.
The most likely cause here is a simple termination issue. Most serial commands need to be terminated by one or more characters. This varies from instrument to instrument, but it's typically a carriage return. You will need to check your instrument's programming manual to determine what this character is, and append that character to the command string. The individual character constants are available in the String palette, bottom row.
10-16-2008 11:37 PM
Termination issue! Thanks for your suggestion.
Labview needs a carriage return constant to append the command string, I thought that type a carriage return in command string is ok.
So that's why the instrument didn't response.
10-17-2008 09:31 AM - edited 10-17-2008 09:32 AM
Ryan Ge wrote:Termination issue! Thanks for your suggestion.
Labview needs a carriage return constant to append the command string, I thought that type a carriage return in command string is ok.
So that's why the instrument didn't response.
You can, but the problem is that when you press "Enter" on the keyboard to enter a new line in a string constant or control what gets entered is a newline character, not a carriage return character. You can see this by setting the display mode of the string constant/control to '\' display mode, as seen here:
You can replace the "n" at the end there with "r" to get a carriage return instead of a newline. Note that you need to be in '\' display mode for this to work correctly.