LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Obtaining Frequency data from Agilent Analyzer

Ok, I will look into these things.  Thank you.  Does it matter where I put the Sens_X_Value VI? or can I just put it before the close vi

0 Kudos
Message 11 of 29
(1,169 Views)

@Rgreen42 wrote:

Ok, I will look into these things.  Thank you.  Does it matter where I put the Sens_X_Value VI? or can I just put it before the close vi


My personal preference is to read the "X" data immediately before (or after) reading the "Y" data. But as long as nothing has changed in the PNA setup, you can read the x data anytime. I quickly looked at the PNA-X User Manual because I never used, nor heard of "Sense:x?" Here are two things I found:

 

1) "Sense<cnum>:X?" has been deprecated. It is superseded by "CALCulate<cnum>:X?" You may want to start using the CALC:X? if writing the VI from scratch.

 

2) In the "Format:Data" section, it states that (amplitude) data is internally stored as REAL32 and Frequency as REAL64. It takes twice as long to transfer the REAL64 but it recommends using REAL64 to avoid rounding errors of the frequency values. Unless you set the number of points in the PNA to an astronomically large number, reading REAL64 would only add a few milliseconds.

 

 

0 Kudos
Message 12 of 29
(1,161 Views)

Attached is a view of the errors I recieved when running the code with the sens VI previously.

0 Kudos
Message 13 of 29
(1,151 Views)

@Rgreen42 wrote:

Attached is a view of the errors I recieved when running the code with the sens VI previously.


The text description for that error code is "Timeout expired before operation completed", and the source of the error was SENS_X_VAL.vi. More than likely, it is the VISA READ that is timing out.

 

I just realized your command string is wrong and probably the reason for the timeout. That's how the command appears in the users manual. It is the command syntax to show you how to build the actual command. The BRACKETS that surround items indicate that they are optional.The brackets are NOT to be used in the actual command. SO...the command should look like.


SENSE%d:X?

or

SENSE%d:X:VALUES?


Also, I don't have the manual in front of me, but double check to if there needs to be a space between "sense" and the "channel number" (i.e., is it SENSE%d or SENSE %d). Most likely it needs no space

 

op_vi.JPG

0 Kudos
Message 14 of 29
(1,127 Views)

Thanks, I will give that a try.   What is the difference between putting VALUES or not doing it?

0 Kudos
Message 15 of 29
(1,115 Views)

Attached is a picture of that section of the code setup seperate from the VI.  It does the same thing If I use the Sens_X vi too though.  It also has the error and view of what it shows in the data output from that sense_x.

Download All
0 Kudos
Message 16 of 29
(1,107 Views)

They are both identical commands. IMHO they are there mainly for readability. Same goes for the Upper/Lower case of the text. Upper case is mandatory, lower case is optional. So the command could be terse or verbose, depending on your preference. The following would all be valid commands (I used Ch1 for the %d).

 

SENS1:X?
SENS1:X:VAL?
SENSE1:X?
SENSE1:X:VALUE?

 

Sometimes the terse commands can be quite cryptic. The last command is easier to read.

0 Kudos
Message 17 of 29
(1,105 Views)

@Rgreen42 wrote:

Attached is a picture of that section of the code setup seperate from the VI.  It does the same thing If I use the Sens_X vi too though.  It also has the error and view of what it shows in the data output from that sense_x.


OK, you have the query interrupted message because you're reading 1024 bytes and the PNA is sending 3024 bytes (from capture 3 png). Try this: (I'm using the Real 32 case)

 

Read X Values.pngBen64

 

 

Message 18 of 29
(1,096 Views)

Is that a specific VI that you added things too? or is that your own custom VI?    I am unsure what a couple of those blocks are called but I will attempt to find them and figure it out.

0 Kudos
Message 19 of 29
(1,092 Views)

Look back a few replies and see what I said about the BinBlock transfer

 

The first few characters in you capture are

#43204 and then a bunch of unprintable characters

 

BinBloc format for the header is
#<Num_digits><Num_Bytes><Data>

 

you have the "#"
next you have "4" that defines the number of digits in the <Num_Bytes>
Num_Bytes = 3204

so finally you have 3204 data_bytes that follow (all your unprintable characters)

 

wire that to the final VISA read

 

Capture_3.png

0 Kudos
Message 20 of 29
(1,090 Views)