Iam trying to control a power supply( Agilent E3649A ) via LabVIEW through GPIB-USB, or RS232-USB interface. I have googled several websites, but still do not have a clear idea of how to implement such task. From what I know:
You will need to install the NI-VISA driver and the NI-488.2 driver to communicate with your instrument over GPIB-USB (which I strongly recommend over RS-232). You might have those already installed on your system if you ran the NI Device Drivers DVD. Once those are installed, you should configure the instrument in Measurement and Automation Explorer (MAX). If you run into problems here, I recommend that you give our Applications Engineers a call (
ni.com/support). After configuring the instrument, you should verify communication with the instrument in MAX. It will then be time to try communicating in LabVIEW.
I recommend that you use the newer LabVIEW driver, which is "project-style." The best way of getting started is running some of the examples that are included in the driver. If you use the newer driver, the examples will show up in the NI Example Finder. If you encounter problems when using the instrument driver, please go through the steps listed in the Instrument Driver Troubleshooting Guide.
Thanks for the tutorials and info. Now I could succesfully control the output of power supply through Labview-USB-GPIB using cable,driver from NI. However, I found out that there seems to have some lag between the time I change the voltage and corresponding reaction from power supply. Could anyone please provide me on how to have the response faster?? Attached is the code. Thank you very much.
You should not have the Initialize and Close inside the loop. These should be outside the loop. I would also suggest using an event structure inside the loop so that you only perform the action when you actually change the front panel control's value. Otherwise, you're always sending the command, which is pointless.
As for the "slowness", this is most likely due to the fact that you are using a higher-level VI that's changing the voltage, current, overvoltage setting, overcurrent setting, overvoltage protection state, overcurrent protection state, output state, whether you want fries, whether you want an apple pie or a cherry pie, whether you want a diet soda... This is the main thing I HATE about the older style instrument drivers, which appears to be what you're using. These had these monolithic VIs that changed half a dozen parameters when all you wanted to do was change the voltage. I don't know if the "project-style" ones are better in that there is a single VI to say, just change the voltage. You should still look at the project-style ones as those are the preferred drivers over the LLB ones. If neither of these has it then you can just find the code that sets the parameter you want to change and make that into its own subVI.
Thanks forr the help , and I solved the problem! Now I need to use PID vi for my application in Labview, and found there is nothing installed when I go to "control design & simulation" or "addons" in my labview 8.6!! Could anyone please tell me where to download these things such as PID vis? Thank you very much.
I am really in the beginning of the learning LabvIEW. I am trying to control a power supply( Ametek XG
1500 ) via LabVIEW through USB cable. I have goggled several websites, but still do not have a clear idea
my computer see the USB cable, but I do not have exact clue to make a good program to control power
supply.
I tried to make a program with NI-VISA with SCPI commands. Actually, I am not sure to write true
commands and I can not see the voltage or current value on the front panel. I have never write a program
to control any electronic device. Maybe, I can not see the basic step or not.
I don't understand at all why you would install a different com port driver than the one that comes from Ametek/Sorenesen. In any case, I did not use the IVI driver. I simply created my own using Tools>Instrumentation>Create Instrument Driver Project. Pretty simple for me - I did a basic driver in less than a day. I would suggest you look over the instrument driver tutorial (on main idnet page). The commands are well documented in the manual. Be sure to get the termination characters correct. I can't provide the code I wrote as it was for a customer but if you post what you have written with details on errors you get etc, I'll try to help.
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.
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).
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?
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.
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!
I'm a newbie in LV and to practice I'm controlling a power supply (TTI) with labview. Requirements are really easy. All I have to do is creating the first channel of the supply. There'll be three main buttons SET, OUTPUT and STOP. SET button will set the voltage and current values that the user wrote; OUTPUT button will open the OUTPUT of the channel 1 and STOP button will stop the code and close the power. The communication through supply and LV will be over TCP protocol.
I've decided to use Queued message handler and created two different loops, the event handling loop and the message handling loop. For event handling loop, I've created an event structure for the three buttons that I've mentioned above. I think I've handled this part pretty good however for the message handling loop I've some problems. I've created a case structure and cases are here:
The problem that I have is that I can't figure out how to combine these cases with TCP, I've done the Init and Open Connection parts and a little bit of Set Values, however I don't know how my approach should be.
Regarding the reading at 200ms one solution would be to put a timeout in your event loop of 200ms. Just keep in mind that if you are running your software on Windows (which is not a real time OS) you might (or will) have some jitter, i.e. it might be every 200 ms +-1ms.
For the updating of the indicators, if you put them directly in the reading state then it will be easy to update them. Otherwise you can store the last read value in a shift register and read that value to update your indicators.
I am new to labview and I am trying to control a dc power supply by using an RS-232 interface (set the output voltage). I can't use a GBIP interface as I only have one module which is used for a different task. Any advice on how to go about this in labview?
In my last sentence I wanted to say that I can't use GBIP as I don't have any available so I'd rather use RS232. When I searched online I only found solutions for GBIP, not RS232. Not sure how to use RS232 in labview unfortunately.
No other program is having control over the serial port so I'm not sure why it isn't working. This is why I decided to create a topic on this website, thinking that that driver is only for GBIP because it wasn't working for me.
The description of that error states an IO error. Are you using a USB-Serial adapter? Are you sure your serial port actually works? You should be able to test it using a terminal program like HyperTerminal or Putty.
I know that this post was a while ago but I seem to be having the exact same problem you did! I am using the same device and can write commands to it fine using VISA but when trying to read from it I get the I/O error. Would you mind letting me know how exactly you solved it?
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 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.
3a8082e126