National Instruments NI-488.2 Time Clock User Manual


 
Application Examples Chapter 2
NI-488.2 User Manual for Windows 2-16 © National Instruments Corp.
Example 7: Serial Polls Using NI-488.2 Routines
This example illustrates how you can take advantage of the NI-488.2 routines to reduce
the complexity of performing serial polls of multiple devices.
A candy manufacturer is using GPIB strain gauges to measure the consistency of the
syrup used to make candy. The plant has four big mixers containing syrup. The syrup
has to reach a certain consistency to make good quality candy. This is measured by strain
gauges that monitor the amount of pressure used to move the mixer arms. When a certain
consistency is reached, the mixture is removed and a new batch of syrup is poured in the
mixer. The GPIB strain gauges are connected to a computer with an IEEE 488.2
interface board and the NI-488.2 software installed. The process is controlled by an
application that uses NI-488.2 routines to communicate with the IEEE 488.2-compliant
strain gauges. The following steps correspond to the program flowchart in Figure 2-7.
1. The application initializes the GPIB by bringing the interface board in the computer
online.
2. The application configures the strain gauges to request service when they have a
significant pressure reading or a mechanical failure occurs. They signal their request
for service by asserting the SRQ line.
3. The application waits for one or more of the strain gauges to indicate that they have a
significant pressure reading. This wait event ends as soon as the SRQ line is
asserted.
4. The application serial polls each of the strain gauges to see if it requested service.
5. Once the application has determined which one of the strain gauges requires service,
it takes a reading from that strain gauge.
6. If the reading matches the desired consistency, a dialog window appears on the
computer screen and prompts the mixer operator to remove the mixture and start a
new batch. Otherwise, a dialog window prompts the operator to service the mixer in
some other way.
Steps 3 through 6 are repeated as long as the mixers are in operation.
7. After the last batch of syrup has been processed, the application returns the interface
board to its original state by taking it offline.