AnsweredAssumed Answered

How to read status registers for limit tests from PNA5230A

Question asked by vmarrero on Dec 9, 2009
Hi;
I am using a 4-port PNA 5230A and I am trying to implement a code that I found that will perform a sweep, wait until the sweep is done, then check if the limit test for each trace pass or fail.
In my case the PNA will have 4 VSWR traces with 4 limit tests.  What I want to do is check them remotely and if the sweep shows a failure save the data.

How do I expand the following code to the be able to read the register the other traces/limits?

Any help is appreciated, especially any document explaining how the following code works.

The following is a part of the code where I check the active trace (in this case 1 trace) and verify the limit test status.

// Clear status registers
VISAWrite("*CLS");
     
// Clear the Sevice Request Enable register
VISAWrite("*SRE 0");
     
// Clear Standard Event Status Enable register
VISAWrite("*ESE 0");
     
// Enable questionable register, bit(10) to report to the status byte
VISAWrite("STAT:QUES:ENAB 1024");
     
// Enable the staus byte to register bit3 (weigth 8) to notify controller
VISAWrite("*SRE 8");
     
// Take one sweep and update display
VISAWrite("INITiate1:IMMediate;*OPC?");
opc = VISARead();
     
// Check waht failed in the analyzer....could make a function out of this!
     
VISAWrite("*STB?");
opc = VISARead();
rgstr = atoi(opc);
                    
// If yes, then was it the questionable register?
if (rgstr > 0 || rgstr < 0)
{
     // determine if the limit1 register, bit 8 is set
     VISAWrite("STAT:QUES:EVEN?");
     opc = VISARead();
     rgstr = atoi(opc);                              
                              
     // If yes, was it trace 1?
     if (rgstr = 1024)
     {
          VISAWrite("STAT:QUES:LIM1:EVEN?");
          opc = VISARead();
          rgstr = atoi(opc);
          if (rgstr = 2)
          {
               flag = flag + 1;
               cout<<"Limit Line 1 Failed!!\n";
          }               
Thanks for your time.

Victor  

Outcomes