User manual

Chapter 3 Software Overview
© National Instruments Corporation 3-15 NI-DAQ User Manual for PC Compatibles
7. Go to the code window, pull down on the Object combo box, and
select GeneralDAQEvent1. The only Proc for this control object is
Fire. Within the subroutine, enter the following code:
If (DoneFlag% <> 1) Then
Text1.Text = Str$(Scans&)+"scans have been
acquired."
Else
Text1.Text = "Acquisition is complete!"
er% = DAQ_Clear(1)
End If
8. Make sure that you stop any ongoing acquisition when you stop the
program. To do so, call the
DAQ_Clear
function before the
End
statement in the subroutine
Command2_Click(_)
. Place another
button on your form and label it
Exit
. The subroutine should have
code as follows:
er% = DAQ_Clear(1)
End
9. Run the program. Because you are not going to display the data onto a
graph, it does not matter what the data is; however, when you click on
the Click Me! button, the text box should update its contents every
second. After all the scans are acquired, you should see the text box
displayacompletionmessage.Ifyourunintoerrors,refertothe
NI-DAQ Function Reference Online Help file for guidance.
10. Click on the Exit buttontostoptheprogram.
Analog Input Function Group
The analog input function group contains two sets of functionsthe
one-shot analog input functions, which perform single A/D conversions,
and the data acquisition functions, which perform multiple clocked,
buffered A/D functions. Within the analog input functions, single-channel
analog input (
AI
) functions perform single A/D conversions on one
channel. Within the data acquisition functions, there are high-level,
low-level, and low-level double buffered functions.
If you are using SCXI analog input modules (other than the SCXI-1200)
you must use the SCXI functions first to program the SCXI hardware.
Then you can use these functions to acquire the data using your DAQ
device or SCXI-1200 module.