LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

bk precision 9124 driver

I am doing a lab project with LabVIEW 2013, using a BK precision 9124 power supply. All I need to do is tell the power supply to output a voltage. I tried looking at

http://sine.ni.com/apps/utf8/niid_web_display.download_page?p_id_guid=866A6146CCF047EDE04400144FB7D2...

but I cannot make head or tail of these programs, or even get any of the examples to run. I am using a RS232 to TTL serial Converter cable IT-E131 for communication.

Does anyone know how to tell the power supply to output a voltage?

0 Kudos
Message 1 of 22
(5,084 Views)

So the drivers aren't the greatest but it looks like it is all there.  Use the Initialize, then I'm guessing you'll need to set the mode to remote so use the Set Mode to remote, then you'll want to set the voltage so use the Configure Output setting the voltage to the value you want, then use the Enable Output to set the value.  When your program is done use the Close to clean up any references and release the hardware.

 

What steps in this fail?  Where does the error come from?  What have you tried?

 

The first thing you will want to make sure is that the COM port you are trying to us in your initialization is the right one.  You can do this by shorting out pins 2 and 3 on the DB9 on the PC.  This will send the transmit to the receieve.  You can then run any normal serial port monitor software (LabVIEW can do this too) to see that what you send is what you get.  This will confirm that the physical port you are trying to use is the right one.  If you are using a USB serial device an easier way maybe to have it not be plugged in, then see what ports are available, then plug it in and see what new one appeared.

 

EDIT:  Another thing I've had issues with is some times you require a null modem DB9 and some times you need a pass through depending on what the device needs.  To know which you have take a DMM and see if pin 2 on one end goes to pin 2 on the other.  If it does then you have a straight through cable and you may need one that swaps the transmit and receive in the cable.

0 Kudos
Message 2 of 22
(5,082 Views)

Thanks for the advice. I've put together a vi using the functions you mentioned. It initializes now, so it seems like it can communicate with the hardware okay. It works until I turn on the voltage ramp, and then the Configure Output returns an error.

 

Initialize also sometimes returns an error.

0 Kudos
Message 3 of 22
(5,048 Views)

I'm using the same driver for bk precision 9123A for more conplicated function.

Seems working fine.

Make sure you use the right baud rate.

 

 

George Zou
0 Kudos
Message 4 of 22
(5,044 Views)

Make VISA Read/Write synchronize in the Initialize.vi

 

 

 

 

George Zou
0 Kudos
Message 5 of 22
(5,043 Views)

Can you post screen shots of the errors you are experiencing? These can be good clues as to what is going awry. 

Taylor B.
National Instruments
0 Kudos
Message 6 of 22
(5,031 Views)

The program runs fine when outputting zero voltage, but when I try anything else, it gives me this error in the

BK Precision 91xx Series.lvlib:Configure Output.


FH error.png

 

The baud rate is 4800, and I know that is correct. Could it be a problem with the Visa, Parity, Data Bits, Flow Control, or Stop Bits? I don't know what any of those are.

 

Also, I'm using LabView 2013, so the subvis might be out of date. If so, does anyone know what I could do?

0 Kudos
Message 7 of 22
(4,999 Views)
The instrument is reporting an error in the command that you sent. Use a probe to determine the command and then compare it to the command in your manual. Look for a syntax error or a value that is out of range.
0 Kudos
Message 8 of 22
(4,991 Views)

I figured it out, and it works now. I had my integer input plugged into the wrong terminal. Thanks for all the help everyone!

0 Kudos
Message 9 of 22
(4,976 Views)

Actually it doesn't quite work perfectly. Each time I open the vi, it works once, and then I have to close out of and restart the vi and the power supply or it won't work because of an error in the Initialize.vi. The error is the same as in the screenshot I posted above. My thoughts is that it has already been initialized from an earlier run, but shouldn't the close.vi at the end take care of that?

0 Kudos
Message 10 of 22
(4,966 Views)