LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Agilent E3631A Power Supply Labview Drivers Not Working

Why would you think to do that?  Somehow you think a program constant in a subVI is meant to be a user interface control?

 

The code uses a property node to determine what type of interface it is.  The programmer set that constant to be a value so it would align with the code he wrote.  So if it reports the VISA port is Serial   (wire = Serial) that is true and the true case will run which obviously has code for a serial port because the programmer put in a note saying "Serial Interface".

 

If the port is not a serial interface, then the comparison will be False the false case will run which obviously has code for a GPIB port because the programmer put in a note saying "GPIB Interface".  There is no reason for you to touch the code in those driver subVI's.

 

If you want a serial port, then you choose from the VISA control on your front panel the port that is serial.  If you want a GBIP port, then you choose the GPIB port from the VISA control.

 

A GPIB port and a serial port are two totally different things.  You can't just decide for it to be one or the other.  The code in the driver detects which type it is and runs with it.

 

The 6 hour link probably doesn't work because NI seems to change the links to their documents from time to time.

Here is a different link you should go to.  How to Learn LV

0 Kudos
Message 11 of 23
(1,701 Views)

Ok, so that makes sense. But, I have selected my device from the VISA Resource Name control on the front panel (COM 6 for my power supply). But yet that isn't solving the issue. Shouldn't the code recognize that my power supply (COM 6) is connected using GPIB and then execute accordingly? Or am I missing something?

0 Kudos
Message 12 of 23
(1,688 Views)

GPIB (the General Purpose Interface Bus) has been "standardized" as IEEE-488.  Did you install the NI 488.2 Driver (in addition to VISA)?  Note that 488.2 is based on a parallel (not serial) Bus structure, but the Virtual Instrument Software Architecture (VISA) does have provisions for communicating with GPIB (not sure if NI-VISA requires, or not, the 488.2 driver ...).

 

Bob Schor

0 Kudos
Message 13 of 23
(1,683 Views)

Now I get it!  I was bothered by not being able to understand your last Post-with-code, especially as it was filled with "blank" VIs with names like "Initialize".  So I went back to your picture and found that you were posting Agilent code.  It took me a little searching to find the Agilent Instrument Driver (I've not used Instrument Drivers in the past), download and install it, and start poking around.  I can't do too much testing today, as I'm home with my laptop and have a limited set to "test instruments" to plug in, but now that I see what Agilent is doing, I might have a clue to your problem.

 

I'm sure you've already done this, but "just in case", here are some initial steps you should do, and should report back to us if you disagree with anything or find anything else that looks "unusual":

  1. Connect your Agilent PS to your PC using whatever cable you use to connect to the GPIB Port on the Power Supply.  I'm going to assume it is a GPIB-to-USB cable.  Plug into an appropriate USB Port.
  2. Open MAX.  Look at Devices and Interfaces, and try to find the Power Supply.  It might be helpful to capture a Screen Shot showing the Devices and Interfaces (so we can see what MAX says about it), and also a Screen Shot of MAX's Software Tab so we can see the Drivers and other Software MAX is using.
  3. Open a Test Panel for the Power Supply.  There should be a configuration page for the VISA Serial Interface.  Set the Baud Rate, Parity, Data Bits, and Flow Control (the default seems to be 9600, N-8-1, None).  Using the manual, attempt to send an "Initialization" command to the Power Supply, and read back its response.  We're really interested in knowing if this step is successful!  If you get gibberish, chances are the Baud Rate is wrong.  If some of the text is right, but you get the odd weird character, you might have Data Bits or Parity wrong.
  4. If Initialize works, you might try sending the Command to take a reading, and then read the response and see if it makes sense.  Let us know!
  5. Assuming everything works, you've demonstrated that MAX and LabVIEW can communicate with the Power Supply.  Now to get the Example Code to work.
  6. In Initialize, set the Serial Configuration Control to match what you used in MAX.  Set the VISA Resource (by clicking the down arrow in the box and choosing from the populated list).  You should not do anything "fancy" to specify "Serial" (as you mentioned in your earlier posts) -- VISA is made to work with a variety of interfaces, and it determines the type of the Interface and then does interface-specific stuff appropriate for that interface.  If it recognizes that you are connected to a GPIB Device over a Serial line, it will select Serial by itself.
  7. I recommend you create a routine consisting of this configured Initialize function connected directly with their Close function (just in case there is no error -- you want to leave the VISA interface in a "closed" configuration).  Now run this -- you should not get an error (but do tell us if you do, and post the Error).
  8. If all goes well, you should now be able to run the full Example.  Again, do all the above steps first (please) and let us know how it goes.

Bob Schor

0 Kudos
Message 14 of 23
(1,680 Views)

P.S. to my post two previously -- you probably do not need to install the NI 488.2 Driver for this Agilent Power Supply (I don't have it installed, and looking at Agilent's code, I don't believe I'll need it).

 

Bob Schor

0 Kudos
Message 15 of 23
(1,678 Views)

Thanks for the help so far!

 

1.) Yes, I am using a GPIB to USB cable to connect the power supply to my computer.

2.) The first two pictures are of the MAX device and software settings.

3.) The next pictures are of me sending the commands/communicating with the power supply. I couldn't exactly find an "Initialize" command in the manual - https://edisciplinas.usp.br/pluginfile.php/2405092/mod_resource/content/1/Agilent_E3631%20Power%20Su... - but I think this is it INITiate [:IMMediate]. It seemed to run fine. I used some other commands like OUTP ON just to show I can communicate with it. I also attached pictures of the Baud rate in MAX.

4.) Not sure what Initialize is suppose to return, but I think it worked?

 

7.) Here are picture of just trying to use the Initialize and Close VI's. I still get an error.

 

Let me know if I should attach anything else. Thanks!

 

- Also as a side note, when running the Example VI for Output DC Volts, I get this error (attached in the last picture). Additionally, my power supply also gives a -410 error, which according to the manual is "Query INTERRUPTED: A command was received which sends data to the output buffer, but the output buffer contained data from a previous command (the previous data is not overwritten). The output buffer is cleared when power has been off, or after a *RST (reset) command has been executed."

 

 

0 Kudos
Message 16 of 23
(1,672 Views)
  • I notice you have 4 Com Ports connected to 4 Instruments.  Is this true?  I would recommend connecting "almost nothing" except one Instrument so there is no confusion.
  • I'm not sure if escaped characters use "/" or "\", but your Initialize Command uses both, and one is wrong!  I would guess "/s" is literally "/s", which "\s" is literally " ", a space.
  • I believe you are mis-reading the Manual.  For example, the command that you show in "Initialize Command (I think)" is the Trigger command, Initiate Immediate, which should be written as "INIT IMM\n".  The lower case characters are there to help you remember what they mean, the square brackets show options, and spaces don't need to be "escaped" but can simply be typed.
  • Try opening up the instrument and sending as the very first command "*IDN?\n" (that's five characters, <asterisk>IDN<questionmark>, followed by \n to end the line.  The ? at the end (should) tell the Instrument you want a response, and it should identify itself, so be sure you follow this by reading.  Do all this with MAX, of course -- use MAX to send the (six, counting \n) string (I'm not going to put quotes here, and don't you put them, either) *IDN?\n.  It should acknowlege receiving 6 characters (though you typed 7, but \n counts as 1), and when you do a Read, you should get a string of maybe 20 characters.
  • I think the commands that start with an Asterisk are GPIB commands.  For example, *RST is usually "Reset", and "*TST?" does a Self-Test and reports (see the "?") its results, with 0 being "Success".

Hope this is helpful.  See if you can find someone who has used a GPIB device and can help you with remote control and communication.

 

Bob Schor

 

0 Kudos
Message 17 of 23
(1,659 Views)

So I went ahead and ran *IDN, and it did return 6 bytes. However, when I clicked Read I got the error again.

Download All
0 Kudos
Message 18 of 23
(1,656 Views)

Here are just some photo's of the connector's I am using and the what it shows in VISA max. If that helps shed any light. 

Download All
0 Kudos
Message 19 of 23
(1,651 Views)

I'm confused.  It sounded like in message 1 that when you connected to it and treated it like a serial port (before you messed with the driver code), the communication worked, that you were able to set the power supply.

 

Is that true?

And if so, why are your trying to mess around with making it a GPIB connection?

0 Kudos
Message 20 of 23
(1,644 Views)