Measurement Computing Personal Daq rev.6.0 User Manual
Page 130

A-12 API Custom Program Modules Appendix A,
878495
Personal Daq User’s Manual
If the handle is still –1 at this point, we know that either a Personal Daq/56 device was not located on the
system, or that whatever Personal Daq/56 device was located on the system could not be properly opened.
If handle& = -1 Then
Print "Cannot open PersonalDaq!"
Exit Sub
End If
An iteration on the channel count is used to initialize the scan sequence arrays and configure the frequency
and pulse counter channels. The following table indicates the content of the scan sequence arrays after this
iteration is completed:
Subscript
Gain Sequence Array
gains()
Channel
Sequence Array
channels()
Flag Sequence
Array
flags()
Analog Input Channels
0 PGainX1
1
(startChan)
AnaFlags
1 PGainX1
2
AnaFlags
2 PGainX1
3
AnaFlags
3 PGainX1
4
AnaFlags
4 PGainX1
5
AnaFlags
5 PGainX1
6
AnaFlags
6 PGainX1
7
AnaFlags
7 PGainX1
8
AnaFlags
8 PGainX1
9
AnaFlags
9 PGainX1
10
AnaFlags
Digital Ports
(
Does not apply to Personal Daq/54
)
10 PGainX1
1
(startChan)
DigFlags
11 PGainX1
2
DigFlags
Frequency Input / Pulse Count Channels
(
Does not apply to Personal Daq/54
)
12 PGainX1
1
(startChan)
FreqFlags
13 PGainX1
2
FreqFlags
14 PGainX1
3
CtrFlags
15 PGainX1
4
CtrFlags
For i = 0 To ChanCount
If (0 <= i) And (i < 10) Then
' Analog input channels
chans&(i) = startChan + 1
flags&(i) = AnaFlags
ElseIf (10 <= i) And (i < 12) Then
' Digital I/O ports
chans&(i) = startChan + (i - 10)
flags&(i) = DigFlags
ElseIf (12 <= i) And (i < 14) Then
' Frequency input channels configured for frequency input
chans&(i) = startChan + (i - 12)
flags&(i) = FreqFlags
The VBdaqSetOption function is used to set individual channel options. The sequence of calls below
configures the current channel chans&(i&) to measure 0 pulses per scan (DcotpDaqPulses) based on time
measurements between the successive rising edges of the input signal, disables debouncing, sets the
minimum and maximum values for the frequency range (maximum frequency range value is 1000 Hz), and
configures the measurement rate to be 1 Hz.