11-01-2013 01:59 PM
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
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?
11-01-2013 02:17 PM - edited 11-01-2013 02:19 PM
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.
Unofficial Forum Rules and Guidelines
Get going with G! - LabVIEW Wiki.
17 Part Blog on Automotive CAN bus. - Hooovahh - LabVIEW Overlord
11-07-2013 09:07 AM - edited 11-07-2013 09:10 AM
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.
11-07-2013 09:24 AM
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.
11-07-2013 09:59 AM
Make VISA Read/Write synchronize in the Initialize.vi
11-08-2013 09:54 AM
Can you post screen shots of the errors you are experiencing? These can be good clues as to what is going awry.
11-14-2013 08:48 AM - edited 11-14-2013 08:52 AM
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.
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?
11-14-2013 10:04 AM
11-15-2013 08:57 AM
I figured it out, and it works now. I had my integer input plugged into the wrong terminal. Thanks for all the help everyone!
11-15-2013 10:06 AM
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?