GPIB Programming Techniques
Chapter 6
NI-488.2M SRM for OS/2
6-10
© National Instruments Corp.
2.
Conduct the parallel poll using
PPoll
, store the response, and check the
response for a certain value. In the following example, because DIO5 is
asserted by the device if
ist
= 1, the program checks bit 4 (hex 10) in the
response to determine the value of
ist
.
/* The second step performs the parallel poll and
stores the response in response.
*/
PPoll(0, &response);
/* If response has bit 4 (hex 10) set, the ist bit
of the device at that time is equal to 1. If
it does not appear, the ist bit is equal to 0.
Check the bit in the following statement.
*/
if (response & 0x10) {
printf("The ist equals 1.\n");
}
else {
printf("The ist equals 0.\n");
}
3.
Unconfigure the device for parallel polling using the
PPollUnconfig
routine.
/* The third step disables parallel polling for
device 3. Notice that the NOADDR constant
must appear at the end of the array to
signal the end of the address list. If
NOADDR is the only value in the array, ALL
devices are sent the parallel poll disable
message.
*/
AddressList[0] = 3;
AddressList[1] = NOADDR;
PPollUnconfig(0, AddressList);
Parallel Polling with NI-488 Functions
Follow these steps to implement parallel polling using NI-488 functions. Each
step contains example code.
1.
Configure the device for parallel polling using the
ibppc
function, unless
the device can configure itself for parallel polling.