data acquisition data acquisition (daq) basics connecting signals simple daq application computer...
TRANSCRIPT
Data Acquisition
• Data acquisition (DAQ) basics• Connecting Signals• Simple DAQ application
Computer
DAQ Device
Terminal Block
Cable
Sensors
DAQ – Data Acquisition
• Plug-in board for a computer with:– Analog input channels– Analog output channels– Counters– Digital I/O
• Controlled by a suite of LabVIEW VIsFunctions>>Data Acquisition
Data Acquisition Terminology
• Resolution - Determines How Many Different Voltage Changes Can Be Measured– Larger Resolution More Precise Representation of Signal
• Range - Minimum and Maximum Voltages– Smaller range More Precise Representation of Signal
• Gain - Amplifies or Attenuates Signal for Best Fit in Range
Hardware Connections
BNC-2120
SCB-68
SC-2075
Basics of the DAQ – Data Acquisition Library
• Every DAQ functions uses a consistent set of inputs and output parameters and they work consistently among the various I/O boards , even across Labview platforms.
• For instance , you can wire a data array from an analogue acquisition directly to a Waveform Graph , and you van intermix the DAQ error I/O chain with I/O chain for the file function.
• Easy I/O is the express way to access I/O.– A need very little to know about the DAQ library or particular I/O board in
order to• Acquire analog data• Drive analog outputs • Access digital I/O
– The missing capabilities are continuous buffered I/O operations , triggering, and the various utility operations.
Basics of the DAQ – Data Acquisition Library
• Intermediate I/O offer much more functionalities than easy I/O such as– Advanced buffer management such as circular buffering
– Extended timing and triggering operations
– Timeout limits
– Calibration and hardware configuration control
– Direct access to status
• Advanced I/O provides access to the lowest level of programming in the DAQ library. Additional capabilities are– Multiple buffering
– Full access to all status information
– Direct control of polarity and gain
– Sampling rate specification
Buffer (F
IFO
)B
uffer (FIF
O)
A/DA/DSignalSignalDriverDriver
SoftwareSoftwareNI-DAQNI-DAQ Labview VILabview VI
RAM RAM BufferBuffer
DisplayDisplay
Hard driveHard drive
InternetInternetOrOr
otherother
DAQ boardDAQ board
ExternalExternalTriggerTrigger
Buffers
• A buffer is an area of memory in the PC ( not on the board) reserved for data to reside temporarily.
• Use buffer I/O when– A need to acquire or generate many samples at rate faster than is
practical to display , store on hard drive , or analyze in real time
– Sampling period must be precise and uniform throughout the data samples.
• Use nonbuffered I/O when– The data is small and short
– Reduce memory overhead
Triggering
• Triggering refers to the method of initiate , terminate , or synchronize a DAQ event
• Software triggering is easy such as control the trigger by using a Boolean front panel control to start or stop DAQ.
• Triggering are either– External or
– Internal
• Use software triggering when– The user needs to have explicit control
– Timing the events
Conventions in DAQ
• Device is a number that specifies the data acquistion board that you wish to access assigned by NI-DAQ. It is a user assigned number also known as logical slot number.
• Channel used to specify which physical inputs or outputs to access.• Each channel becomes a member of group. Available groups types
are analog input , analog output , digital I/O and counter-timer.
• Task ID is created by group configuration and carries information about DAQ operations between the various VIs such as device , type of operation , list of channels , group , size of the data buffer in memory and status of data acquisition operation.
Analog Input ( Easy I/O)• AI Sample Channel is used to obtain one sample from the specified
channel and device.• AI Sample Channels is used to obtain one sample from the
specified channels and device.• AI Acquire Waveform (s) is used to obtain one waveform( a set of
sample over a period of time) from the specified channels at the specified sampling rate.
AI Sample Channel AI Sample Channels AI Acquire waveform
Analog Output ( Easy I/O)• AO Update channel (s) set the specified voltage at the specified
output channel. It remains constant at the output till changed.
• AO Generate waveform (s) generate waveform at the specified output channel. The waveform data , in volts , should be provided as components of the waveform input. The update rate specifies the time between points .
AO Update channel
AO Update channels
AO Generate waveform
AO Generate waveforms
Analog I/O .. Intermediate• In Easy I/O , every call AI Sample Channel a setup of the
hardware informing sampling rate ..etc. so it is easy but with a lot of overhead.
• The Intermediate I/O offers more functionality and flexibility, such as– Controlling sampling rate
– Using external triggering and
– Performing continuous operations.
• The first VI is AI(O) Config that do setup and produces task ID which will be used by other VIs to identify the device and channels on which to operate
AI Config AI Start AI Read AI Clear
Analog Input• AI Config configure the analog input operation for a specified channels ,
configure the hardware , and allocates a buffer in computer memory.
• AI Start a buffered analog input operation. It controls the rate of data acquisition , the number of points to acquire , and the use of any hardware trigger options.
• AI Read reads data from the buffered allocated by AI Config . T controls the number of points to read from the buffer , the location of the buffer to read from , and whether to return binary data or scaled voltage.
• AI Clear will clear the analog input operation , de-allocate the buffer from computer memory, and frees any DAQ board resources such as counters.
AO Config AO Start AO Write AO Clear
Analog Output• AOConfig configure the analog output operation for a specified channels ,
configure the hardware , and allocates a buffer in computer memory.
• AO Write will write data in waveform data (an array of waveforms) into the buffer . The data should be one waveform per channel in the channel list.
• AO Start a buffered analog output operation. It controls the update rate of data generation , the number of points to acquire , and the use of any hardware trigger options.
• AO Clear will stop the analog output operation , de-allocate the buffer from computer memory, and releases any DAQ board resources such as counters.
output channel (0)
input channels (0)
4.00amplitude
signal type
update rate
output buffer size
0continuous output
acquired datascan backlog
number of scansto read at a time
code
10800timeoutcode
status
Compute Waveform.vi
0continuous acquisition
scan rateinput buffer size
device
Acquisition1. AI Config : Configure the
channel and buffer
2. AI Start : Start the acquisition
3. AI Read : Read from the buffer
4. AI Clear : Clear the buffer and de-allocate resources.
Generation1. AO Config : Configure the
channels and buffer2. AO Write : Write data to the
buffer3. AO Start :Start the generation4. AO Write: Write new data to
the buffer5. AO Wait [ optional]: Wait for
buffer to empty6. AO Clear : Clear the buffer
and de-allocate resources.
Digital I/O• A digital line is equivalent to an analogue channel : a path where a digital
signal is set or retrieved . Digital lines are either input lines or output lines , but sometimes they can be bi-directional ( on most boards , bi-directional lines are not supported.)
• A port is a collection of digital lines that are configured in the same direction and can be used at the same time. The number in each port depends on the boards. Ports are specified as digital channels just like analogue channels.
• Port width is the number of lines in a port.
• State refers to the one of the two possible cases ( TRUE or FALSE).
• A pattern is a sequence of digit states ( e.g “1101” where MSB is on the left)
• NI uses TTL positive logic ( 0-0.8 for “0” and 2.2-5.5 for “12)
Digital I/O.. Easy• Read from Digital Line reads the logical state of digital line.
• Read from Digital Port reads the state of all lines in a port. Pattern returns the digital lines states as decimal number.
• Write to Digital Line sets a particular line on a port to a logical high or low state.
• Write to Digital Port outputs a digital pattern to specified port.
Read fromDigitalLine
Read fromDigitalPort
Write toDigitalLine
Write toDigitalPort