Instrument Control (GPIB, Serial, VISA, IVI)

cancel
Showing results for 
Search instead for 
Did you mean: 

BK Precision device works in VISA test panel but fails when using driver

I am trying to control a BK Precision XLN power supply.  I have set it up as a TCPIP VISA instrument using sockets (port 5025).  It validates fine in NI MAX, and when using the VISA test panels I can write to and read from it (although I get a timeout error on the read if I specify too many bytes).  When I use the supplied instrument driver blocks in LV, VISA read commands always timeout and fail to return anything, regardless of how many bytes are specified.

0 Kudos
Message 1 of 8
(6,184 Views)

Hello SBH,

 

It is strange that you can communicate using the VISA test panel but can’t communicate using BK’s driver, which just wraps VISA calls into LabVIEW functions. Have you tried implanting simple VISA commands yourself, to test basic communication in the LabVIEW development environment?

 

Also, make sure your drivers are created for used with your specific power supply. I don’t know if this truly makes a difference but there may be different configuration settings required by different power supplies. It is also worth reviewing the programmer’s manual for your power supply to double check your commands are correct and you are reading the correct number of bytes.

0 Kudos
Message 2 of 8
(6,141 Views)

I agree it's odd, I've used the identical driver over USB for another application and have checked that it is the most current correct driver.  (BKPrecision XLN6024-GL) I'm working on a new computer and installation where USB is not an option.  

 

I have tried putting together a simple set of VISA commands myself without success.  Write commands do not throw an error but I'm pretty confident the message is not getting through.  I've tried basic *IDN? as well as turning output on and off, etc.  It all works in the VISA test panel but fails in the VI/Instrument Driver.   when I try to implement the VISA blocks they don't throw an error (except for READ timing out) they just don't elicit any information from, or change on the instrument end.

0 Kudos
Message 3 of 8
(6,129 Views)
You should not have to specify the exact number of bytes to read with a VXI-11/LXI instrument. Was it auto-detected in MAX? Are you sending a termination character in the test panels?
0 Kudos
Message 4 of 8
(6,120 Views)

I don't think it is a VXI-11/LXI instrument, it did not autodetect and I had to use the 'Manual Entry of Raw Socket' option to set up the device.  I am sending  a termination on the write (\n), if I don't send a termination on the read it captures the read but then gives a timeout error if waiting for more bytes, if I use a termination cahracter on the read it functions as you would expect, except that it returns multiple termination characters (line or carriage feeds) in some messages so you would have to perform multiple reads to get the whole message.  (this is all in the test panels, I haven't gotten anything back using the VISA blocks in a VI)

 

Given that behaviour it seems more like what you would get using a telnet terminal interface but even given that I still am confused why I can talk to it with the test panel and not using the VISA blocks in a VI. 

 

Thanks,

Stearns

 

0 Kudos
Message 5 of 8
(6,097 Views)
The instrument driver probably does not append a termination character. Have you turned on I/O Trace to look at the differences? You should also be able to quickly view the driver's block diagram. It's and easy change to automatically append a termination character if that is the difference.

I would recommend that you check with B&K about standards.
0 Kudos
Message 6 of 8
(6,093 Views)

I have a similar problem with an MDL001 DC load mainframe. I am running Labview 2014 (64bit). NI MAX 16.0, NI-Visa 16.0. When the driver perform a Visa Write it does not append the term char (10) to the write. I used an IP Listener to confirm this. If I use the Visa panel it sends the term char.  If I look at the NI-Trace it shows the Visa call for the MAX Visa Panel is different from the Visa call for the MDL001. U read another threa that suggested 64 bit but I am running LV2014 (64bit)

Here are the NI traces:

MDL001 10.  VISA Write ("TCPIP0::127.0.0...::13000::SOCKET", "*IDN?")
Process ID: 0x00001D68         Thread ID: 0x00003550
Start Time: 16:39:04.133       Call Duration 00:00:00.000
Status: 0 (VI_SUCCESS)

Visa Panel

24.  viWrite (TCPIP0::127.0.0.20::1300... (0x05C2BF20), "*IDN?.", 6, 6)
Process ID: 0x00003960         Thread ID: 0x000039E8
Start Time: 16:43:42.339       Call Duration 00:00:00.000
Status: 0 (VI_SUCCESS)

 

0 Kudos
Message 7 of 8
(4,273 Views)

It goes without saying that the two calls are different the call without termination is VISAWrite, the panel call with termination is viwrite which is more like a 488.2 style call.

0 Kudos
Message 8 of 8
(4,270 Views)