Instrument Control (GPIB, Serial, VISA, IVI)

cancel
Showing results for 
Search instead for 
Did you mean: 

Unable to acquire serial COM1 lock on Fluke 45 in LabVIEW

Solved!
Go to solution

When the Fluke DMM ECHO setting is on, the following happens using the VISA test panel in NI MAX:

 

  1. From the VISA panel, a write command is sent to write *IDN?\r to the multimeter.  No error, the DMM accepts the command.
  2. From the VISA panel, a read command is sent, and the DMM echos the previous write (*IDN?\r) command back to the VISA panel
  3. From the VISA panel, a read command is sent, and the DMM reports the result of the write command (FLUKE, 45, [sn redacted], 1.7 D1.0\r\n)
  4. From the VISA Panel, a read command is sent, and the DMM reports that the write command was received and executed successfully using the DMM's default nomenclature (=>\r\n)

 

Note that this is entirely the same when the ECHO setting is off, except that step 2 does not occur.

 

Now, this is entirely the same as the following output when issuing the *IDN? command in Tera Term:

*IDN?

FLUKE, 45, [sn redacted], 1.7 D1.0

=>

 

(Tera Term, does not display the carriage return (\r) or line feed (\n) like the VISA panel does.)

 

So, it would appear that the VISA panel is communicating with the DMM in the same way as terminal, it is just not actively reading like Tera Term and requires the user to request a line read.

 

What I do not understand, is the difference between behavior of the DMM when using Tera Term or the VISA test panel and when using LabVIEW.

 

When communicating with the DMM in Tera Term or the VISA Panel, the DMM responds by going from display state 1 to display state 2 (see images below).  When attempting to use even the most basic example serial communication VIs or the Fluke plug and play driver VIs, the DMM stays at display state 1.  Note that the change from state 1 to state 2 happens only after initiating a connection in Tera Term or the VISA panel; so, I believe that I am experiencing an issue where LabVIEW is unable to acquire a communication lock with the serial instrument.

 

If anyone has insight, please let me know if you have any way to troubleshoot this particular issue.

 

 

Display State 1:

ds1

 

Display State 2:

ds2 

 

0 Kudos
Message 1 of 15
(8,769 Views)
Do you send a cr lf in labview?
greetings from the Netherlands
Message 2 of 15
(8,765 Views)

I've tried it without, with both, and with either.

 

I don't think that the commands are even reaching the instrument when using LabVIEW because the device never enters display state 2 as described in my original post.  Display state 2 occurrs without any commands issued on my part, and I believe results from Tera Term or the VISA Panel acquiring an exclusive lock on the DMM.

 

Even after multiple resets and ensuring that no other program is trying to communicate over COM, I can't get LabVIEW to acquire a lock on the DMM.

 

I am, however, able to succesfully perform a loopback test in LabVIEW with the same RS232 cable on COM 1.  So, it's clear that the issue occurrs only when trying to use the DMM.

0 Kudos
Message 3 of 15
(8,762 Views)

A loopback test is pretty meaningless. What is the actual LabVIEW code? Are you closing the VISA resource at the end which would release the port? Are you getting results when you request them? Not seeing a specific screen is not in itself that significant

0 Kudos
Message 4 of 15
(8,760 Views)

I have used a number of example VIs that issue open and close VISA.

 

Two that come to mind are:

 These generally result in timeout errors.

 

0 Kudos
Message 5 of 15
(8,756 Views)
How did you add cr and lf?
Ihope you did not simply add the characters i wrote but th equivalent cr/lf constant on the labview string palette.
Please verify this. Use concat to add the cr lf
Or change the string display mode into control chars and add \r\n
greetings from the Netherlands
0 Kudos
Message 6 of 15
(8,754 Views)

I used \r\n in string display

0 Kudos
Message 7 of 15
(8,752 Views)
In the correct display mode?
Otherwise a real \ and r and \ and n are sent.
The display mode of a string may be changed when right clicking and select another display mode.
greetings from the Netherlands
0 Kudos
Message 8 of 15
(8,748 Views)

I used the example found here: http://digital.ni.com/public.nsf/allkb/171D2D70CFB66E74862571390062D12B

 

I believe it's set up correctly, based on what you've said.  I've also tried every combination of \r and \n

 

exampleVI.png

exampleVI2.png

0 Kudos
Message 9 of 15
(8,746 Views)

I should note that I do not think that this is an issue of formatting the command correctly.  I think that there is an issue with the way LabVIEW is attempting to open VISA communication with the DMM.

 

The fact that I can use default Tera Term settings or default NI VISA Test Panel settings and communicate, but not use example VIs with the same settings is confusing. (And yes, I have reset the hardware as well as the software multiple times to ensure that I don't have resources competing for COM1.)

0 Kudos
Message 10 of 15
(8,745 Views)