12-14-2016 11:48 AM
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
12-14-2016 12:30 PM
@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.
12-14-2016 03:17 PM
Attached is a view of the errors I recieved when running the code with the sens VI previously.
12-15-2016 06:49 AM
@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
12-15-2016 10:43 AM
Thanks, I will give that a try. What is the difference between putting VALUES or not doing it?
12-15-2016 11:00 AM
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.
12-15-2016 11:05 AM
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.
12-15-2016 11:12 AM
@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)
Ben64
12-15-2016 11:15 AM
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.
12-15-2016 11:17 AM
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