(only for devices with 32-bit CPU, see feature-matrix / "DAQ")
The data acquisition unit (called DAQ hereafter) is a multi-channel digital
sampler for signals received via CAN, or signals digitized by the
onboard analog inputs, etc.
Samples acquired by the DAQ are first stored in a FIFO (circular buffer for all channels). This FIFO can be used as data source to plot the sampled data as a function of time with high resolution. In addition, certain devices can access the data in the FIFO via script, to process them in many ways (e.g. Fast Fourier Transform to analyse a signal's spectrum; e.g. find peak frequencies and magnitudes of vibrations in real time, etc).
For 'normal' displays (numeric, or as diagramm with sampling rates below 10 Hz), the DAQ unit is not required.
In most cases, the DAQ is used as fast-sampling sampling buffer for Y(t)-diagrams.
When triggered (or periodically), the contents of the DAQ's channel memories can be plotted into the UPT's Y(t)-diagram, using the interpreter command dia.plot_daq .
Normal sources for the measuring channels of the DAQ unit are defined on the Variables property of the programming tool. Use the checkmark in the right part of the definition screen:
To connect a variable to one of the DAQ channels, just set the checkmark Connect to DAQ Channel.
The programming tool will try to find the next unused DAQ channel, and automatically enter the channel number (index running from 0 to 7) into the edit field right next to the checkbox.
This way, the DAQ will know how to receive, and decode, a certain signal.
To disconnect a variable from the DAQ, uncheck the option. This will automatically remove the DAQ channel number from the variable definition table.
On a sufficiently large screen, you can see the DAQ channels 'occupied'
by UPT display variables in the last column of the variable definition table:
The above screenshot was taken from application 'DAQ_test.cvt'.
In this example, the DAQ was used for a fast-running Y(t)-diagram.
In addition to UPT-'display'-variables, a DAQ channel can also be connected
to any of the 'onboard' analog inputs (if such inputs exist). This allows
sampling those inputs faster than possible by other means (like polling
system.analog_in in a script).
To assign DAQ channels to analog and similar inputs at design time, select
'Options'..'Data Aquisition Unit' in the programming tool's main menu,
then select the channel (0..7) in the sub-menu, and enter the one of the following keywords in the input box (instead of the name of a display variable):
The names (tokens) listed above can also be used in the channel definitions of a diagram (Y(t) or X/Y plotter).
If a DAQ channel is already 'occupied' by a variable, it will have the variable's name shown in the list (see screenshot).
By clearing or overwriting the name in the input box, the old variable will be 'disconnected' from the DAQ, and the channel can be connected somewhere else (see list above).
All channels connected to the Data Acquisition Unit are sampled at the same rate (same number of samples per second).
Since the DAQ is usually (but not necessarily) used to collect data for a diagram,
the sampling rate will be automatically set to match the diagram's 'timebase'-setting.
But in some cases, you may want to use the DAQ unit for other purposes (without a diagram, for example to collect data in the DAQ's array for processing via script). To define the DAQ sampling rate, and allow the DAQ to 'collect data' even if there is no diagram, select
'Options'..'Data Aquisition Unit'..'Sample Rate' in the programming tool's main menu,
and enter the desired sampling rate (measured in Hz aka 'samples per second) in the dialog box.
Besides feeding diagrams with fast-sampled input, the DAQ unit can also be used for digital
signal processing via script. The script command
can be used in your scripts to read data from a DAQ channel into an array variable.
An example using this function can be found in the test/demo application 'DAQ-Test'
(in the programming tool, under programs/DAQ_Test.cvt ). This demo uses the DAQ to
retrieve blocks of samples from the microphone input (or other analog inputs),
then uses an FFT to calculate the short-time spectrum, logarithmizes the result,
and plots the spectrum into a diagram as explained here.
daq.read_channel( <DAQ channel number>, <destination array> );
A few DAQ examples are in the file DAQ_test.cvt
(located in the programming tool's "programs" folder). The application consists of several display pages:
On the first display page ("Analog"), the DAQ is used to collect samples from analog inputs (and, when available, the microphone input) for a simple Y(t)-diagram (here: digital storage oscilloscope for low-frequency signals). This simple example does not require a script - just connect a diagram channel to a DAQ channel, the firmware will to the rest.
For the second display page ("CAN"), the DAQ collects samples from received CAN messages, with 1000 samples / second (more would be possible from the DAQ's point of view, but it's not realistic with a CAN bus at 500 kBit/second).
The third display page uses the DAQ to collect 'audio samples' as explained here, which are then processed via script (using the FFT) as explained here. .
Last modified: 2018-12-08 by WB / MKT Systemtechnik .