Hallo
I have derived an application which communicates with a device1 in the way
listed in the pseudocode below ( auto serial polling was enabled.) :
ub = ibfind(device1);
ub2 = ibfind(device2);
loop;
ibwrt(ub , "Measure" );
ibwait(ub , SRQ | TIMO);
ibsrq(ub, &Status);
ibread(ub , &value , 100);
endloop;
This application worked fine till the PC's clockfrequency increased the
perhaps 600MHZ limit. Now ibwait dosen't terminate with the service request,
but with the timeout! After disabling autoserial polling this problem was
fixed. It seams that auto serial polling handle the service request before
ibwait notice it?
But now we have another problem: another device sometimes sends service
requests while we are waiting for SRQ's from
device1. Now ibwait terminates
with the iberror 16 (ESRQ).
Now I have read some of NI's manuals on serial polling and get some ideas
how to solve this problem. I hope someone could comment this Ideas.
1) the simplest one:
enable auto serial polling and disable interrupts of the GPIB interface
-> auto serial polling couldn't begin before ibwait( am I rigth?).
2) relative simple but cpu-time wasting :
enable auto serial polling and avoid waiting for SRQ:
ub = ibfind(device1);
ub2 = ibfind(device2);
loop;
ibwrt(ub , "Measure" );
while( !(ibwait(ub , 0) & 0x4)) ;
ibsrq(ub, &Status);
ibread(ub , &value , 100);
endloop;
3) some changes on program design
disable auto serial polling and wait for SRQI
u = ibfind(board);
ub = ibfind(device1);
ub2 = ibfind(device2);
loop;
ibwrt(ub , "Measure" );
ibwait(u , SRQI | TIMO);
ibsrq(ub, &status);
if( status & 0x4 ){
ibread(ub , &value , 100);
}
endloop;
4) redesign the program
enable auto serial polling and use ibnotify or i
bInstallCallback.
thanks
Babak