Instrument Control (GPIB, Serial, VISA, IVI)

cancel
Showing results for 
Search instead for 
Did you mean: 

Can query serial port with NI MAX, but doesn't work in Labview

Solved!
Go to solution

I'm trying to control a Coherent Sapphire 488 with labview. It's connected via a serial to USB converter into the computer. I can communicate with a device using NI MAX, but when I try to run the vi (attached), it works for several queries, but evetually returns a null character, after which I can no longer communicate with the port. If I then go into the NI MAX interface, every time I try to read it gives the "VISA: (Hex 0xBFFF0015) Timeout expired before operation completed" error message.There are also several queriess from the instrument's manual that don't seem to work at all (with or without MAX) and always return a null character. Any help is appreciated. I'm certainly a novice with device communication. Thanks.

0 Kudos
Message 1 of 5
(5,060 Views)
Solution
Accepted by topic author jwlarkin

Generally issue with termination character.

 

 And you are sending     \  and  r   and not CarriageReturn.

Message 2 of 5
(5,050 Views)

Thanks a lot, man. Swapping \r for a carriage return constant seems to have worked.

0 Kudos
Message 3 of 5
(5,046 Views)

Is it \r\n?

0 Kudos
Message 4 of 5
(2,746 Views)

mikemai,

 

There's actually a constant in LabVIEW called "Carriage Return," or you can use \r

You can check out this document for more information: Difference Between Carriage Return, Line Feed and End of Line Characters

 

If you have additional questions I'd suggest making a new forum post, since this one is from 2012 and likely not monitored closely.

Francine P.
Applications Engineering
National Instruments
0 Kudos
Message 5 of 5
(2,735 Views)