04-07-2018 08:09 PM
I have a B&K Precision 1688B switching-mode power supply (0-18 V, 20 A max) in a test rig. I simply want to record (not control) its voltage and current output measurements with my rig's VI. The power supply has a USB port, but B&K does not have a LabVIEW driver for the device.
BK did make its own software (HCS operating software) to control this power supply. HCS offers datalogging services, but I'd like to record all my measurements into a single location using a single program.
Can LabVIEW use HCS' drivers to talk to my power supply? If so, how? BK offers HCS and USB COM drivers for the 1685B in the power supply's software page.
I'd rather not use high tolerance resistors, a new power supply, or an expensive new current probe just to record a measurement that an existing device is already making.
I'm using an 6361 DAQ along with a 2345 SCC connector block in my test rig.
Solved! Go to Solution.
04-09-2018 06:34 AM
Go to the Docs & Software tab on that linked web page. There is a Programming Manual listed. Give that a good read and make your own driver set.
04-09-2018 11:58 AM
Yeah, looking at the manual you only need to send 1 command "GETD". But you need to set the serial communications and line feed character properly. Here's an example you could try..
04-23-2018 09:38 PM
cstorey,
Thanks for the example! I can read the display voltage and current readings now, but the VI isn't very stable. Sometimes it just freezes before halting and throwing me a timeout error (Error -1073807339, hex 0xBFFF0015).
Here is BK's documentation for the GETD command:
That last OK part of the return message throws off my string processing, so I compare for an "OK" message after my read. If the read message isn't "OK\r", then I scan it. Otherewise, I ignore it.
I'm curious if this OK-check is getting thrown off by a not-OK situation (like if the power supply momentarily sends an error message as I vary the voltage). I tried checking for this by displaying the read buffer to the front panel, but these timed-out iterations just don't return anything and the read buffer string for a previous iteration doesn't indicate anything bad either.
Also, I want to incorporate this reading function into another VI where I'm reading voltage and current readings from a Tektronix oscilloscope using Tektronix' own drivers. Will the "Flush buffer" part of this code mess with Tektronix's code? Or does flushing only affect the referenced VISA instance?
04-24-2018 10:38 AM - edited 04-24-2018 10:41 AM
I think you can eliminate all the waits and flushes and just issue two successive VISA read commands, the first to catch the voltage/current/status and the second the OK message. I missed that there was a termination character after the data and before OK. So you need to read in a separate call, but you shouldn't issue the GETD command again, or else the PSU is probably throwing errors.
Try this. (Edit to include the updated file!)
04-24-2018 10:40 AM
What's in the other case of the case structure? I'm using LV 2016, so I can't use your snippet.
04-24-2018 10:45 AM
Here's a 2015 version that should open for you.
The other case is just to handle errors if the reading is incomplete, since the VISA read returned <=5chars, which is more than OK\r but less than I/V/status, you kknow something is wrong. Hopefully you never use that case, but you can put in code to handle the error however you like; ignore, display a message, quit, etc..
04-24-2018 11:09 AM
I added a 50 ms wait at the beginning of the while loop so LV wouldn't ping the PSU too quickly. It seems stable so far, but I'll just have to run the new code with my test rig to find out. Thanks for your help cstorey!
11-17-2020 07:20 PM
I have a similar problem, Is it ok if you can share your vi to write a voltage to the b&k precision 1697B power supply?