10-30-2006 06:44 AM
10-30-2006 08:11 AM
10-30-2006 02:33 PM
10-31-2006 01:12 AM
Hi Thanks for the replay.
Let me more specific on the question with the exact work we are doing.
We have old GPIB driver for SONY/TEKRONIX RTD710 digitizer which uses ibnotify() and GPIB callback function to handle SRQ, with this we are able to get all the instrument generated SRQ's depending upon our requirement.
Now we change the digitizer to Tektronix TDS5032B DPO and downloaded NI-IVI 'C', driver, with this we developed the driver with checking the status after each function call.
Now the question has arised on the SRQ part , I underrstood wait for OPC when fetchinng the waveform, but will other SRQ's like COMMAND ERROR, EXECUTION ERRORS are handle in status check? Pls let me know. Do we need to open a seperate VISA\GPIB session? I'm not very clear on this.
Thanks
Prashantha
11-01-2006 02:07 PM
Hi Prashantha,
I believe the answer to your question is yes, the CheckStatusCallback does check for EXECUTION_ERROR_BIT and COMMAND_ERROR_BIT. Again, you can use tkds30xx driver as an example:
/*- 488.2 Event Status Register (ESR) Bits ------------------------------*/
#define IEEE_488_2_QUERY_ERROR_BIT 0x04
#define IEEE_488_2_DEVICE_DEPENDENT_ERROR_BIT 0x08
#define IEEE_488_2_EXECUTION_ERROR_BIT 0x10
#define IEEE_488_2_COMMAND_ERROR_BIT 0x20
#define IEEE_488_2_ERROR_BITS (IEEE_488_2_QUERY_ERROR_BIT | \
IEEE_488_2_DEVICE_DEPENDENT_ERROR_BIT | \
IEEE_488_2_EXECUTION_ERROR_BIT | \
IEEE_488_2_COMMAND_ERROR_BIT)
static ViStatus _VI_FUNC tkds30xx_CheckStatusCallback (ViSession vi, ViSession io)
{
ViStatus error = VI_SUCCESS;
ViInt16 esr = 0;
ViUInt16 interface = VI_INTF_GPIB;
viCheckErr( viGetAttribute (io, VI_ATTR_INTF_TYPE, &interface));
if (interface != VI_INTF_ASRL)
{
/* Query instrument status */
viCheckErr( viQueryf (io, "*ESR?", "%hd", &esr));
/* Convert status information into a message */
if (esr & IEEE_488_2_ERROR_BITS)
{
viCheckErr( IVI_ERROR_INSTR_SPECIFIC);
}
}
Error:
return error;
}