LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

HP33120A IVI Driver Problems

I am having some problems with the NI IVI driver for the Agilent 33120A Function Generator. I am controling the 33120 through the serial port and I am able to control it. The problem I am having is that every time I want to change just one thing such as the frequency, the generator resets. I am using the Inialize VI from the driver set, then into the Write Instrument Data VI then the Close. I have tracked the problem down to the Initalize VI. Every time it is run, the generator resets, even though I have both the query and reset inputs set to False. I am not sure if there is a way around using the Initalize VI, since I have no experience with the IVI drivers. Using GPIB is not an option, since the application will be stand alone a
nd I do not wish to force the GPIB issue. I have attached a VI for changing duty cycle as an example. Any help would be appreciated.
Troy
0 Kudos
Message 1 of 4
(2,521 Views)
I looked at the source code for the driver and it appears (through very rusty C eyes) that the init function either does a reset or configures the instrument to some default configuration. There is really no reason to use the Init function more than once in a program. Use it once at the beginning to set the instrument to a known state and then just call whatever functions you need later. The issue has nothing to do with either serial or gpib. It's really more an IVI standard I believe.
0 Kudos
Message 2 of 4
(2,521 Views)
Thanks Dennis. The reason I mentioned not being able to use GPIB is in the past when I ran into something like this with a driver I just wrote my own. But I am having problems getting the instrument to work through serial port writting my own driver. Also, I am not accessing the generator that often, so I didn't want to leave the visa bus hanging open, and speed was not an issue either. So I made the decision to just do it as needed, it makes the higher level VI cleaner, by not having the RefNum (or instrument handle) running around the diagram. My previous experience with instrument drivers for GPIB all had this Initialize VI. When you looked at the code for the VI, it was nothing more than a Visa Open and a couple of VIs for ID and Reset. How do I do tha
t using the new Instrument Handle refnum of the IVI drivers? I hope that makes sense.
Troy
0 Kudos
Message 3 of 4
(2,521 Views)
If you don't want to pass the reference, when you want to call another function, just create a constant for the instrument handle, right click the constant, and choose Select IVI Class. I'm not sure this is any cleaner than explicitly wiring the reference though.
0 Kudos
Message 4 of 4
(2,521 Views)