03-09-2019 11:43 PM
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
03-10-2019 12:46 AM
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?
03-10-2019 10:02 AM
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
03-10-2019 11:01 AM
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":
Bob Schor
03-10-2019 11:12 AM
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
03-10-2019 03:59 PM - edited 03-10-2019 04:14 PM
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."
03-10-2019 05:12 PM
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
03-10-2019 05:54 PM
So I went ahead and ran *IDN, and it did return 6 bytes. However, when I clicked Read I got the error again.
03-10-2019 06:50 PM - edited 03-10-2019 06:59 PM
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.
03-10-2019 07:27 PM
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?