LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

The value read by visa read VI is not correct!

Solved!
Go to solution

I design a labview program to control Agilent E5072C network analyzer. When I want to get value from this instrument, I use the "VISA read" VI which listed in the block plate. However, the value read by this VI is last time measurement value. For example, last time the read value is 1.0 db and this time the measurement value is 1.2 db. But when I use "VISA read" VI to fetch the value, it is 1.0 db.

Agilent also provide a VI for this device to read measurement value, and it alway read correct value. so could someone tell me why? do I need do any action before read value from this instrument if I want to use "VISA read" VI instead of Agilent VI?

0 Kudos
Message 1 of 13
(3,581 Views)
There is a driver from NI - not agilent, and the driver uses VISA Read so I don't understand your question. Of you are just starting with LabVIEW, use the driver. Even if you're not, use the driver as a starting point.
0 Kudos
Message 2 of 13
(3,566 Views)
The VISA Read function is simply a routine for reading a string from a VISA device. It knows nothing about the commands needed to communicate with the instrument. What commands are you writing to the instrument prior to the read?

You need to interact with it like is documented in the instrument manual.

Mike...


Certified Professional Instructor
Certified LabVIEW Architect
LabVIEW Champion

"... after all, He's not a tame lion..."

For help with grief and grieving.
0 Kudos
Message 3 of 13
(3,559 Views)

In my program, I use "VISA WRITE" to input a command ":CALC:MARK1:Y?" Then I use "VISA READ" to fetch the value. I want to get the value at mark1 point. But as I described, the value fetched is last time measurement value. In addition, if I fetch the value by mannually through NI Max, the value is correct. Afte change "VISA READ" VI to the VI I posted in my topic. The value fetched is correct.

0 Kudos
Message 4 of 13
(3,551 Views)

OK, what does the Agilent VI do that the plain read does not? Also, does the CALC command cause a new measurement to be made or just report the result from the last measurement?


Mike...


Certified Professional Instructor
Certified LabVIEW Architect
LabVIEW Champion

"... after all, He's not a tame lion..."

For help with grief and grieving.
0 Kudos
Message 5 of 13
(3,525 Views)

After my program input CALC command, the value displayed on screen is correct. for instance 1.2db.  but my program use read VI to fetch this value, it get the last time measurement value like 1.0. As for Agilent VI attached on my topic. I am not sure what does it do before fetch value. could you please look at that VI?

0 Kudos
Message 6 of 13
(3,513 Views)
You can look at the block diagram yourself if it's the one from NI.

http://sine.ni.com/apps/utf8/niid_web_display.download_page?p_id_guid=74D1F1D4EB5268E8E04400144FB7D2...
0 Kudos
Message 7 of 13
(3,507 Views)

Hi all,

It is no matter which company write this VI. What I am really care about is that why "VISA read" VI unable to read the measurement value correctly? another VI can read correctly. what is the difference between them. and Agilent network analyzer has some special rule should be obey before reading Mark value?

0 Kudos
Message 8 of 13
(3,483 Views)
As it had been said, look at the working code. You are missing some setting so either use the working driver, base your code on it, or carefully read the manual and rewrite your code. Why do you want to reinvent the wheel anyway? Someone with a great deal more experience with LabVIEW and the instrument spent a great deal of time writing something that works.
0 Kudos
Message 9 of 13
(3,473 Views)
Solution
Accepted by song403

You are probably reading it too quickly.  By reading it in NI-MAX, you are doing it by hand, so it takes longer.  When you do it programmatically, it is "instant".  Try using the *OPC? command to turn your command into a query.  It will then return a "1" in the read buffer.  Read the "1" and then do the fetch command.

 

To Dennis:

I've had bad experiences with manufacturer-supplied drivers to the point where I don't even try to use them any more.  But if Agilent is as anal about their drivers as they are about their manuals, they should be no problem.  😄

Bill
CLD
(Mid-Level minion.)
My support system ensures that I don't look totally incompetent.
Proud to say that I've progressed beyond knowing just enough to be dangerous. I now know enough to know that I have no clue about anything at all.
Humble author of the CLAD Nugget.
0 Kudos
Message 10 of 13
(3,452 Views)