LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

Change timeout in ag5313xa

I am programming using CVI and have a requirement to reduce the time which the instrument takes to timeout (currently 20sec).
I have tried reducing the GPIB timeout via MAX and this has had no effect.
I am using a vxi driver ag5313a modified 5/28/2003 downloaded a couple of days ago.
the error code is -1073807339 (Timeout expired before operation completed.)
 
0 Kudos
Message 1 of 6
(4,038 Views)
Hello
 
I am not 100% sure which driver you are using, but I think it is this one from the website:
 
Can you give me some more information about what you are trying to do? Which functions are you calling at the moment. It may just be a case of modifying the code slightly, but I need to understand better what you are trying to do.
 
The error you have reported is a VISA error and will occur when the software doesn't receive a response from your instrument within the specified timeout.
 
If you can let me know some more info, I'll try to help
 
Hannah
NIUK & Ireland
 
 
0 Kudos
Message 2 of 6
(4,005 Views)
The driver you suggested is the one I moved away from in the middle of last week as it does not timeout at all with the condition I get but gets stuck in a loop.
The driver I am using now  is  //ftp.ni.com/support/idnet/F15B52BBF81644C6E0340003BA7CCD71/ag5313xa_MS.msi
I am trying to test up to 512 units in a 5 minute period on boards of 64 in a time based test occasionally no signal is recieved at the counter, usually realated to an operator error and the system hangs up.
I initalise , switch off some functions to speed up test time then go to continuous measurement mode.
in a loop I switch through each unit and fetch the result (status = ag5313xaFetchMeasurenent(Countersession, result);)
it is this function which returns a 20 second timeout. In a worst case situatuation I could loose power to a board of 64 resulting in a 21 minute hold up in the system throwing out the rest  of my results.(better than our current hang up situation but not Ideal)
I hope this enlightens you to my problem and allows you to help me further.
0 Kudos
Message 3 of 6
(3,991 Views)

Hi,

  the driver is an IVI version, so it shouldn't be the GPIB settings that would set the timeout time.

Since the instrument driver uses either read, or fetch, I'm wondering if a slightly different approach could be taken, by intiating the setup, then checking in some way, (which could give the appropriate timeout) then fetching if appropriate.

The nearest I could find is the WaitForMeasureComplete, which has a MaxTime associated with it (in milliseconds).

This should give the functionality you require.

#include "ag5313xa.h"
#include <cvirte.h>
static ViReal64 measurement = -1.0;
static ViStatus errStatus;
static ViSession sessHdl;

int main (int argc, char *argv[])
{
 if (InitCVIRTE (0, argv, 0) == 0)
  return -1;    /* out of memory */
/*  Ivi_SpecificDriverNew ("ag5313xa",
//       "RangeCheck=1,QueryInstrStatus=0,Cache=1,Simulate=1,RecordCoercions=0,DriverSetup=0,InterchangeCheck=0",
//       &sessHdl);
*/  
 errStatus = ag5313xa_InitWithOptions ("sim_ag5313xa", VI_TRUE, VI_TRUE,
         "Simulate=1,RangeCheck=1,QueryInstrStatus=1,Cache=1",
         &sessHdl);

  errStatus = ag5313xa_Initiate (sessHdl);
 
  errStatus = ag5313xa_WaitForMeasureComplete (sessHdl, 1000); //1000 = 1 second
 
  if (errStatus)
   {
   errStatus = ag5313xa_Abort (sessHdl);
  }
  else
   {
   errStatus = ag5313xa_FetchMeasurenent (sessHdl, &measurement);
  }
  errStatus = ag5313xa_close (sessHdl);

 return 0;
}

 

Thanks

Sacha Emery
National Instruments (UK)

// it takes almost no time to rate an answer Smiley Wink
Message 4 of 6
(3,966 Views)

Hi,

  I should have said, before the initiate, you'd need to do your configuration setup to say what it is you're measureing.

Thanks

Sacha Emery
National Instruments (UK)

// it takes almost no time to rate an answer Smiley Wink
Message 5 of 6
(3,964 Views)

Hi SachaE, sorry about the time between posts but I got pulled onto another project and just got back to this one recently.

I tried the wait for measure complete command and unfortunately always timed out no mater what i tried to set up during configuration.

I have however hit upon a solution

initiate

Delay (0.2)

abort

then fetch the result.

I am not particularly happy about using delay but it is working for my test system.

I will try to find time to get a setup which uses wait for measure complete as I belive this should be a better option but I felt I really should give some feedback.

If you (or anyone) has further information to add I would be most appreciative.

 

0 Kudos
Message 6 of 6
(3,890 Views)