Instrument Control (GPIB, Serial, VISA, IVI)

cancel
Showing results for 
Search instead for 
Did you mean: 

Using a Labview VI, I send a query command to my device and the proper data is displayed but when I send a different query command the old data is returned

I am new to LabView and GPIB so I apologize if this is something trivial but I could not find anything related...I am not sure if this is realted to my device, my VI, GPIB or a combination of such.

 

I am using a Labview 2009, I am using the Basic GPIB Read/Write VI to command and query my device which is connected via a GPIB-USB interface. I am confident that the VI works, I can command my device to set certain parameters and I can query those parameters to ensure they accepted by the device. So, let's say I send a command to route my RF power to be measured on the top port, I then send a query to see how much power is at the top port. My device reports 21.5dbm (Current), 22.6 (Max) and 21.3 (Minimum).

 

My problem starts when I send the next query, let's say I query the frequency. I am expecting my device to report 1030.1MHz (Current), 1030.7 (Max) and 1030.0 (Minimum) but my VI is reporting the data from the original query, 21.5dbm (Current), 22.6 (Max) and 21.3 (Minimum). After I run the VI several times the correct data is received. I would really only like to run the VI one time and have the correct data appear.

 

I am not sure if this is coincidental or part of my problem...First, I ran my VI 15 times before the "Frequency Query" reported correctly. I then sent another query and I had to run the VI 33-35 times before the correct data displayed; I then had a hunch and sent another query, this time it took approximately 64-65 times to run the VI before the correct data was captured.

 

Any help would be appreciated.

 

(I needed to edit this post because it was written as if I wrote the VI...I did not; I downloaded it.)

 

Thanks,

jb

 

0 Kudos
Message 1 of 3
(4,687 Views)
What is the make and model of the instrument? I'm posting from my phone so I can't look at the VI but you should be using VISA functions. Check for an existing driver with Help> Find Instrument Drivers.
0 Kudos
Message 2 of 3
(4,677 Views)

Thanks for the quick reply Dennis...I am using an IFF45-TS from Aeroflex; I believe that I just found my problem. My Read Buffer was populated with existing data when I opened the VI, I think (and I am going on limb) that each time I sent a query command the current data was being appended to the existing data...that's just my hunch. 

 

I found that clearing the read buffer, selecting the 'Make Current Values Default' and saving those changes to the VI corrected the issues I was having with all of my VI's. I can now send the query and I receive the correct data on all of my Query Command type of VI's.

 

Thanks

jb

 

0 Kudos
Message 3 of 3
(4,671 Views)