Instrument Control (GPIB, Serial, VISA, IVI)

cancel
Showing results for 
Search instead for 
Did you mean: 

Error Hex 0xBFFF0015 in NI MAX - Using Laser Scan Micrometer

Solved!
Go to solution

I am fairly new to using LabVIEW and very new to using LabVIEW for instrument control.

I am currently trying to use LabVIEW to control a Laser Scan Micrometer (Mitutoyo LSM 6200 + LSM 501S) and I have been unable to communicate with the LSM properly at all.

 

I have the LSM hooked up via RS232-USB crossover connection, and it is showing up in MAX as COM4. From there, both the port and the LSM are set to have 9600 Baud Rate and 8N1 Frame with no parity or flow control. 

 

Anytime I send a Write command in VISA test panel, I get some return bytes, but whenever I Query or Read anything I get Error 0xBFFF0015. 

The same thing happens on a couple of other instruments I am working with, but I do not yet have the correct cables for those.

 

I am inclined to believe the error is with the syntax and which I am sending commands. Attached is the manual for the LSM. 

 

http://manualmachine.com/mitutoyo/lsm-6200/670042-user-manual/page:8/

 

The portion on RS232 commands begin in section 6.2.1.4 which is in page 

My termination character is set (both on labview and the LSM) to be a carriage return. This is CR in the LSM, and 0xD in LabVIEW (according to setup in MAX)

I have tried commands such as 'R' and 'STAT' and more followed by 0xD, xD, CR, \r, \n\r, and nothing I do ever gives me anything besides some return bits and that error. 

Am I communicating improperly? What Should I do?

 

Thanks for your time.

0 Kudos
Message 1 of 4
(3,108 Views)
Solution
Accepted by topic author MKandPL

It always helps to see the code you are using.  Error 0xBFFF0015 is a timeout error, so something isn't setup quite like you think.  Most likely you are appending a termination character to your string and VISA is also appending its own termination**.  Try explicitly setting the termination characters for VISA to use, and for the instrument as well.   Then don't add it to your string, let VISA handle it.

 

VISA_Serail_Simple_IO_test.png

 

Look at the Help for each property in the property node to see what the settings are and how they affect communications. I also included the Serial Config VI in case your serial config has to be changed in LabVIEW beyond the VISA defaults.  Ignore the Termination character settings in that one as you will do them in the next step with the property node anyway.

 

Edit ** Also read this about display codes for strings, it might be the problem you're having - https://forums.ni.com/t5/LabVIEW/Sending-New-Line-character-after-command/td-p/3739608

Message 2 of 4
(3,073 Views)

@cstorey

 

Firstly, Thank you for your assistance.

 

I want to reiterate that I haven't even brought this into LabVIEW yet (although, I am on LabVIEW 2018 when I do);

 rather, I am still in NI MAX in a VISA test panel. I did not want to try making a code until I have actually established successful communication. 

I have tried going back and removing the CR from my inputs. I get return bytes, but still just that error when I try to read. Am I supposed to be able to read the results (in this case, data from a LSM)?

 

See attached file for what I am doing.  I have also tried more simple commands such as "R" for run. No luck.

 

 

 

EDIT: For the first time, I am getting data out of Read in NI MaX. I do not have a complete control of it though, I have to still figure some stuff out. I will continue in LabVIEW and get back to you if I have any issues. Thanks again!

0 Kudos
Message 3 of 4
(3,040 Views)

@Cstorey,

 

Thank you very much for the help! I have it working just fine!

0 Kudos
Message 4 of 4
(3,036 Views)