Instrument Control (GPIB, Serial, VISA, IVI)

cancel
Showing results for 
Search instead for 
Did you mean: 

Control BK Precision 1687b power supply through VISA

Solved!
Go to solution

I am currently designing a data acquisition system to run tests at my work using a cDAQ-9174 chassis, and we have a programmable variable power supply that we would like to control and measure data from in LabVIEW. There was not a driver for this specific power supply on the NI website, so I followed the tutorial http://www.ni.com/tutorial/4478/en/#toc2 for configuring and installing a driver. However, I am unable to create a block diagram that runs properly because I run into "Timeout expired before operation completed" or "Invalid buffer mask specified" errors. At first DAQmx was able to validate the port settings, but even after making no changes it seems to randomly get an error "The resource is valid, but VISA cannot currently access it." Has anyone used a similar setup with greater success? I do not know much about USB protocol and the two times I have restarted the process, NI-VISA named it first as a RAW resource, and then as a INSTR resource, which to my understanding use completely different configuration settings in the block diagram. If it helps, I am using LabVIEW 2011.

0 Kudos
Message 1 of 11
(6,517 Views)

This device does not follow IEEE-488.2 protocols (Does not understand SCPI commands).  You will need to understand the packages sent to the supply as well as how to decode the various responses.  Here is the manual.

Help the Community (and future reviewers) by marking posts as follows:
If it helped - KUDOS
If it answers the issue - SOLUTION
0 Kudos
Message 2 of 11
(6,468 Views)

I have the set of commands for the device, but the manual does not say where the code needs to be entered. NI MAX is now listing the power supply as a USB RAW VISA resource and an ASRL::INSTR VISA resource simultaneously, so I think there is a problem somewhere in the driver installation.

0 Kudos
Message 3 of 11
(6,459 Views)

Have a look at this thread where I demonstrated setting up communication with a BK 1688, nearly identical to what you need I think.  You just specify either the serial or USB resource name in the VISA resource input.  (Did you set up both USB and serial?) 

 

https://forums.ni.com/t5/Instrument-Control-GPIB-Serial/Recording-benchtop-power-supply-output-via-L...

 

Note the unique response of these instruments!  They use a termination character then OK, then another termination character.  You'll just need to add the code for setting output and limits.  As minions pointed out they are not SCPI compliant, so you will just provide strings to VISA write for the commands required.

 

Craig

 

Message 4 of 11
(6,454 Views)

Craig,

Unfortunately as I am using LabVIEW 2011, I cannot open the VI from the other thread.

0 Kudos
Message 5 of 11
(6,437 Views)
Solution
Accepted by topic author cvan17

@cvan17 wrote:

Unfortunately as I am using LabVIEW 2011, I cannot open the VI from the other thread.


Here you go.


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 6 of 11
(6,435 Views)

Thanks for the code, however I am still getting an error:

 

LabVIEW: Error connecting to GPIB driver or device.
=========================
NI-488: Error connecting to driver or device.
=========================
VISA: (Hex 0x0) Operation completed successfully.

 

I opened a VISA test panel in MAX and I am not able to complete any queries, getting the same read operation error "timeout expired before operation completed"

0 Kudos
Message 7 of 11
(6,426 Views)

UPDATE

 

I redid the wiring and it's working now. From here I think I can figure out how to programmatically control the voltage. Thanks.

0 Kudos
Message 8 of 11
(6,423 Views)

I have purchased the same identical power supply and running into the same problem.  Is it ok if you could share a working example of the vi for voltage output please as b&k precision stated that they were not planning to release LabVIEW support for the 1695B.  Thanking you in advance.

0 Kudos
Message 9 of 11
(4,534 Views)

I threw this together to better understand how the supply works.  It will set the voltage to whatever level is desired.

Help the Community (and future reviewers) by marking posts as follows:
If it helped - KUDOS
If it answers the issue - SOLUTION
Message 10 of 11
(4,527 Views)