LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

labview visa write issue

Solved!
Go to solution

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...

0 Kudos
Message 1 of 5
(3,521 Views)

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?
Message 2 of 5
(3,512 Views)
Solution
Accepted by topic author Ryan Ge

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. Smiley Wink

 

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.

Message 3 of 5
(3,488 Views)

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.

 

0 Kudos
Message 4 of 5
(3,468 Views)

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. 

Message Edited by smercurio_fc on 10-17-2008 09:32 AM
Message 5 of 5
(3,438 Views)