beautypg.com

Multiple channel types – Measurement Computing Personal Daq rev.6.0 User Manual

Page 128

background image

Multiple Channel Types

This section demonstrates how to configure
multiple channels on a Personal Daq and
acquire data using these channels in the
same scan sequence. After all of the prior
code has been executed, the transfer can be
started and the acquisition can be armed in
the same manner as shown in the other
models. Functions used include:

Obtain list of installed
devices.

Obtain properties of each
device in the device list.

Open the first Personal Daq/56
device found.

Set channel options.

Set format of data returned by
the transfer functions.

Configure the trigger event.

Configure the acquisition.

Set the sample rate
(sample frequency).

Configure acquisition buffer.

Multiple Channel Types Model for Personal Daq/56

Configure a scan group of
channels.

DaqSetOption

DaqGetDeviceList

DaqGetDeviceProperties

DaqOpen

DaqAdcSetDataFormat

DaqAdcSetScan

DaqAdcSetTrigEnhanced

DaqAdcTransferSetBuffer

DaqAdcSetAcq

DaqAdcSetRate

Yes

Is Device a

PDAQ56

?

No

VBdaqGetDeviceList&(ByRef

deviceList() As String, ByRef
deviceCount&)

VBdaqGetDeviceProperties&(ByVal

daqName$, deviceProps As
DaqDevicePropsT)

VBdaqOpen&(ByVal daqName$)
VBdaqSetErrorHandler&(ByVal

handle&, ByVal handler&)

VBdaqSetOption&(ByVal handle&,

ByVal chan&, ByVal flags&,
ByVal optionType&, ByVal
optionValue!)

VBdaqAdcSetDataFormat&(ByVal

handle&, ByVal RawDataFormat&,
ByVal PostProcFormat&)

VBdaqAdcSetScan&(ByVal handle&,

channels&(), gains&(),
flags&(), ByVal ChanCount&)

VBdaqAdcSetTrigEnhanced&(ByVal

handle&, ByRef
triggerSources&(), ByRef
gains&(), ByRefadcRanges&(),
ByRef trigSense&(), ByRef
levels!(), ByRef hysteresis!(),
ByRef chan&(), ChanCount&,
opstr$)

VBdaqAdcSetAcq&(ByVal handle&,

ByVal Mode&, ByVal
preTrigCount&, ByVal
postTrigCount&)

VBdaqAdcSetRate&(ByVal handle&, ByVal Mode&, ByVal acqState&, ByVal regRate!, ByRef

actualRate!)

VBdaqAdcTransferSetBufferSingle&(ByVal handle&, buf!(), ByVal ScanCount&, ByVal
transferMask&)

The definitions below will be used to specify the channel count, scan count, data buffer size, starting
channel, and acquisition clock frequency respectively. This model assumes the use of a Personal Daq/56
device, on which there are 10 analog input channels, 2 digital I/O ports, and 4 frequency input channels
available that will be configured for use in the same scan sequence. The acquisition will consist of 10
scans per channel. The first channel in the channel sequence array is 1. The rate at which channel scans
are collected is 0.1 Hz.

Const ChanCount& = 16
Const ScanCount& = 10
Const TotalCount& = (ScanCount& * ChanCount&)
Const startChan = 1
Const Freq! = 0.1

We define constants for the various flags that will be placed in the flag sequence array. The flags that are
ultimately placed in the array depend on the channel type of the channel specified in the same subscript of
the channel sequence array.

Const CtrFlags& = DafCtrPulse Or DafScanDigital
Const DigFlags& = DafScanDigital
Const FreqFlags& = DafCtrFreq Or DafScanDigital
Const AnaFlags& = DafAnalog Or DafDifferential Or DafMeasDuration610

A-10 API Custom Program Modules Appendix A,

878495

Personal Daq User’s Manual

This manual is related to the following products: