
DNA/DNR-AI-217 Simultaneous Sampling Differential Analog Input Board
Chapter 2 17
Programming with the High Level API
Tel: 508-921-4600 www.ueidaq.com Vers: 4.5
Date: April 2013 DNx-AI-217 Chap2x.fm
© Copyright 2013
United Electronic Industries, Inc.
2.4 Configuring
the Timing
You can configure the AI-217 to run in simple mode (point by point) or high-
throughput buffered mode (ACB mode), or high-responsiveness (DMAP) mode.
In simple mode, the delay between samples is determined by software on the
host computer. In buffered mode, the delay between samples is determined by
the AI-217 on-board clock and data is transferred in blocks between PowerDNA
and the host PC.
The following sample shows how to configure the simple mode. Please refer to
the “UeiDaq Framework User’s Manual” to learn how to use other timing modes.
2.5 Open Circuit
Detection
The AI-217 can source a 100mA current through each input channel to detect
whether the circuit is close or open. This can be enabled on a per channel basis.
Use the AI channel object method "EnableOpenCircuitDetection()" to
turn on the feature on any input channel (0 to 15).
The example below shows how to turn on open circuit detection on all channels:
Once the session is started, you can retrieve the result of the open cicuit
detection with the channel object method "IsCircuitOpen()":
// configure timing of input for point-by-point (simple mode)
aiSession.ConfigureTimingForSimpleIO();
// turn on open circuit detection on all channels
for(int ch=0; ch<session.GetNumberOfChannels(); ch++) {
CUeiAIChannel* pChan =
dynamic_cast<CUeiAIChannel*>(session.GetChannel(ch));
pChan->EnableOpenCircuitTest(true);
}
// return if circuit is open
for(int ch=0; ch<session.GetNumberOfChannels(); ch++) {
CUeiAIChannel* pChan =
dynamic_cast<CUeiAIChannel*>(session.GetChannel(ch));
if(pChan->IsCircuitOpen())
{
std::cout << "Open circuit detected on channel " <<
pChan->GetIndex() << std::endl;
}
}
Commenti su questo manuale