01-26-2006 06:49 AM
01-27-2006 10:05 AM
01-30-2006 05:59 AM
02-01-2006 11:08 AM
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)
02-01-2006 11:10 AM
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)
05-03-2006 09:55 AM
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.