From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

VISA Timeout

I am trying to connect to my SICK LMS100 LIDAR with Labview. I have it connected by USB and I can send and receive messages to it using the SICK software with no issue.

 

I would like to get the scans into labview, so I can coordinate measurements with other sensors. I have started with a basic write and read vi that communicates with the scanner via VISA. However, in the read portion, I receive a timeout error. I do not believe even the read portion is working either because the hardware lights do not signal they have recieved the message.

 

I migrated to the VISA test Panel in NI MAX to manually communicate with the device. With the same messages, I get a timeout error there as well. But that is the only information I have.

 

I have confirmed the parameters (baud rate, etc.) are correct.

Download All
0 Kudos
Message 1 of 9
(3,198 Views)
Is your VI set the same way by sending ASCII <ETX> instead of the correct control character? Please get an ASCII table.

Look at the drivers for other Sick sensors to see if they use similar protocol.
Message 2 of 9
(3,188 Views)

I'm sorry, I'm not sure I completely understand what you are saying.

 

Is <ETX> not the correct end of text ascii character? This string works properly when using the SICK software to communicate using the device.

0 Kudos
Message 3 of 9
(3,178 Views)

jwh244 wrote:

Is <ETX> not the correct end of text ascii character?


No.  If you dig through the programmer's manual, they will have <ETX> and <STX> defined as specific characters.  <STX> tends to be a 0x02 (defined in my ASCII table as Start Of Text) and <ETX> tends to be 0x0A (which is a linefeed).

 

You are currently sending the actual "<ETX>" and "<STX>" as a string (5 characters each), not the single character they are supposed to be.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
Message 4 of 9
(3,168 Views)

I appreciate the help on that bug.

 

A followup though,

What reasons would cause something to work fine in the VISA Test Panel, but not the VISA Write and Read vi's with the same settings?

 

What I'm finding is that my command strings are now working fine in the VISA test panel, but i'll switch over to the vi (after closing NI MAX, of course), enter an identical string, and it times out.

 

I have reattached the VI here for convenience.

0 Kudos
Message 5 of 9
(3,143 Views)

You are still not sending the STX and ETX characters. The string to write control is is set to Normal display mode. So when you enter \02, is sends three characters: "\", "0", and "2". You need to change the display mode to '\' Codes Display to get what you want.

 

Lynn

Message 6 of 9
(3,138 Views)

Thanks for the help everyone

 

I think what was causing my confusion was that strings were working in one environment, but not another.

Each of your suggestions fixed a problem though! So I appreciate the helpful replies!

0 Kudos
Message 7 of 9
(3,111 Views)

@crossrulz wrote:

jwh244 wrote:

Is <ETX> not the correct end of text ascii character?


No.  If you dig through the programmer's manual, they will have <ETX> and <STX> defined as specific characters.  <STX> tends to be a 0x02 (defined in my ASCII table as Start Of Text) and <ETX> tends to be 0x0A (which is a linefeed).

 

You are currently sending the actual "<ETX>" and "<STX>" as a string (5 characters each), not the single character they are supposed to be.


My ASCII table shows ETX as x03 not x0A.  Linefeed is x0A which is not the same ast ETX.

0 Kudos
Message 8 of 9
(3,099 Views)

@RavensFan wrote:

My ASCII table shows ETX as x03 not x0A.  Linefeed is x0A which is not the same ast ETX.


Well that's what I get for not entirely reading my table.  I just interpreted ETX as the termination character, which most instruments use a line feed.  Ok, everything makes a lot more sense now.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
0 Kudos
Message 9 of 9
(3,095 Views)