National Instruments NI-488.2 Refrigerator User Manual


 
Chapter 8 NI-488.2 Programming Techniques
© National Instruments Corporation 8-19 NI-488.2 User Manual
In the following example, the GPIB interface is to configure itself to
participate in a parallel poll. It asserts DIO5 when
ist is 1 if a parallel
poll is conducted.
ibppc(0, 0x6C);
ibist(0, 1);
2. Conduct the parallel poll using ibrpp and check the response for a
certain value. The following example code performs the parallel poll
and compares the response to hex 10, which corresponds to DIO5.
If that bit is set, the
ist of the device is 1.
ibrpp(dev, &ppr);
if (ppr & 0x10) printf("ist = 1\n");
3. Unconfigure the device for parallel polling with ibppc. Notice that
any value having the parallel poll disable bit set (bit 4) in the bit
pattern disables the configuration, so you can use any value between
hex 70 and 7E.
ibppc(dev, 0x70);
Parallel Polling with Multi-Device NI-488.2 Calls
Complete the following steps to implement parallel polling using
multi-device NI-488.2 calls. Each step contains example code.
1. Configure the device for parallel polling using the
PPollConfig
call, unless the device can configure itself for parallel polling.
The following example configures a device at address 3 to assert
data line 5 (DIO5) when its
ist value is 1.
#include "ni488.h"
char response;
Addr4882_t AddressList[2];
/* The following command clears the GPIB. */
SendIFC(0);
/* The value of sense is compared with the ist bit
of the device and determines whether the data
line is asserted.*/
PPollConfig(0,3,5,1);