Example 7: Serial Polls Using Ni-488.2 Routines - National Instruments NI-488.2M Software Reference Manual

For os/2
Hide thumbs Also See for NI-488.2M:
Table of Contents

Advertisement

Application Examples

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. The
consistency 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 equipped with an IEEE 488.2 interface board
and fitted with the NI-488.2M software. 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 strain gauge to see if it requested service.
5.
Once the application has determined which strain gauge 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.
NI-488.2M SRM for OS/2
2-16
© National Instruments Corp.
Chapter 2

Advertisement

Table of Contents
loading

Table of Contents