02-12-2015 12:54 PM
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.
02-12-2015 01:10 PM
02-12-2015 01:26 PM
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.
02-12-2015 02:07 PM
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.
02-12-2015 02:51 PM
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.
02-12-2015 03:06 PM
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
02-13-2015 08:19 AM
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!
02-13-2015 12:58 PM
@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.
02-13-2015 01:10 PM
@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.