User manual
Chapter 3 Software Overview
© National Instruments Corporation 3-13 NI-DAQ User Manual for PC Compatibles
The parameter DoneFlag equals 1 if the acquisition was over when the
Analog Alarm Event fired. Otherwise, it is 0. Scans equals the number of
the scan that caused the Analog Alarm Event to fire.
Using Multiple Controls
In general, a program might contain any number of General DAQ Event,
Analog Trigger Event, and Analog Alarm Event controls. Just like regular
Visual Basic controls, there are two ways you can place multiple controls
on a Visual Basic form:
• You can create control arrays by copying and pasting a control that
already exists on the form. Each individual element in the control array
is then distinguished by the
Index
property, and the event procedures
is an extra parameter
Index as Integer
. The first element has
Index = 0
, the second element has
Index = 1
, and so on. You have
only one procedure for each type of event custom control; however,
you can determine which control array element caused the event to
occur by examining the
Index
property.
• You can place multiple controls from the Visual Basic Tool Box onto
the form. Each individual custom control of the same type is then
distinguished by the number after the name of the custom control,
such as
GeneralDAQEvent1
,
GeneralDAQEvent2
, and so on.
Consequently, you can have separate procedures for each custom
control, such as
GeneralDAQEvent1_Fire,
GeneralDAQEvent2_Fire
, and so on.
General DAQ Event Example
The following steps provide an outline of how to use the General DAQ
Event control in a Visual Basic program. A working knowledge of Visual
Basic is assumed; otherwise, this example is complete, except for error
checking:
1. To use the GeneralDAQEvent control, you must first include the proper
control into your project.
• If you are using Visual Basic 4.0 (32-bit), select the
Tools»Custom Controls option, and select the National
Instruments GeneralDAQEvent custom control.
• If you are using Visual Basic 5.0, select the
Project»Components option, and select the National
Instruments GeneralDAQEvent custom control. In either
version, if you do not find the custom control listed, click on the
Browse button and find the custom control in the NI-DAQ
subdirectory under your Windows directory.










