DAQControl

DAQControl is a test software application intended for demonstrating the command-response operation of openDAQ. The software has been created using Python 3.6.

It has an interface divided into three tabs, the first of them dedicated to analog inputs and output, the second one dedicated to digital inputs-outputs and the third one controlling the timer/counter utilities of the device.

Python repository for openDAQ DAQControl (Github)

 

Connection

The first thing that we must do to use this software is connecting to the openDAQ. The instrument uses a VCP driver to communicate via USB with the computer, so a new serial port will appear in your PC after you plug it.

If you are working in Windows, you can go to System/Device Manager, in the Control Panel, to check the name of the port that the openDAQ device is using.

The name of the port could be something like /dev/ttyUSB0 in Linux or dev/tty.SLAB_USBtoUART in Mac. Ports are listed in /dev/ directory at both OS.

To work with openDAQ you must select the appropriate port number in the program settings. 

After connection, information about the device hardware and firmware versions will be displayed in the bottom of the application.

 

Analog I/O Tab

In the Analog I/O tab we will find controls to manage and configure software controlled analog acquisition for openDAQ, tools to configure the DAC output, and some utilities to work with the analog data received. 

We can distinguish the following parts in this tab:

Main Toolbar:

Besides the connection configuration icon, which we have already used to connect with the device, the rest of the tools in the main bar apply to this analog tab, and they are the following ones (left to right order):

  • Export to CSV: Export the graph data to a text file in CSV format, which is readable from Excel and similar programs.
  • Manual axis settings: Allows to manually define maximum and minimum axis settings, linear or logarithmic scale, and customized titles.
  • Zoom home: Restore default zoom.
  • Pan: Drag and drop over the graph window with the mouse to select the viewing area.
  • Manual zoom: Select an area over the graph window to zoom over it.
  • Export PNG: Export a picture of the graphic area. 

Analog Input:

  • Ch+: Set up the positive channel for the analog acquisition. It can be any input from A1 to A8.
  • Ch-: Set up the negative channel for the analog acquisition. In [N] version, it can be any input from A1 to A8 or AGND. For [S] version, negative channel must be the adjacent analog input couple (A7 for A8, A6 for A5, and so on), or GND for a SE reading.
  • Range: Input amplification range for the selected analog inputs. To get the best resolution of the signals that you are connecting to the analog inputs, you should select the biggest amplification that fits that signal but is not too large. Product of maximum voltage with amplification must keep in the maximum range for the device, thus ±12V. For example, voltage range of x8 would be fine to read a signal of around ±1V in magnitude.
  • Period: The sampling rate to get a chart graph of the selected inputs. Note that in this demo all the control is carried out by the software, so the period will not be calculated with high precision. You can select periods from 0.1 to 65535 seconds.
  • Play & Stop: Those two buttons will start or stop respectively the analog acquisition process. Once started, the analog acquisition will continue indefinitely until the Stop button is pressed, or the software is closed.
  • Last value: A text output where the last received analog value is displayed, for more information.

Analog Output

This is a numeric control where the analog output of openDAQ (DAC) can be set to a specific value. It can also be modified when the software is also capturing analog input data.

Graph                     

In the graph area, a plot of analog input versus time will start to be represented after Play button is pressed. The graph will be cleared out every time the acquisition begins.

 

Digital I/O Tab

The digital tab has controls and indicators to handle the terminals D1 to D6 of the device.

First, any of these terminals can be configured as an input or as an output, using the adequate radio button.

Each connection has an icon representing its last state, which may be a high output (D3 in the figure), a low output (D1 and D2), a high input (D4 and D6) or a low input (D5). All I/Os will be updated every time that the state of any output is changed by the user.

 

 

Timer-Counter Tab

This tab has controls to manage Timer 1 utilities of openDAQ. You can read more deeply about these functions in the device Manuals.

Capture

This will start capture mode of openDAQ, which is useful to detect the period and the duty cycle of an incoming signal. The signal that is to be analyzed must be connected to terminal D5 of the openDAQ.

The peripheral works better if a first indication of an approximate period for the desired signal is introduced by the user prior to the measurement (estimation).

The interface allows selecting which part of the signal is going to be measured (total period, high or low times).

Results will be displayed in the text indicator, with an update rate of 1 second. Units are ms for period and Hz for frequency.

Counter

This control will start a hardware counter on terminal D5.

Rising edges of an incoming digital signal though this pin will be counted by the hardware and the total amount will be displayed on the text indicator.

Results are updated every second approximately. The count will restart from 0 every time the Start Counter button is pressed.

PWM

PWM control configures port D5 as a modulated square wave output, 0 to +5V of total amplitude. User must configure the period of the output signal, in microseconds (µs), and its duty cycle (ON time), in percentage (%).

Set PWM button sets this port as an output and starts PWM generation. Stop PWM disables the signal generation.

Encoder

OpenDAQ has an embedded utility on its firmware that allows direct reading of incremental quadrature encoders. These sensors measure position and orientation, and its outputs are two square complementary signals (phases A and B). By monitoring the number of pulses and the relative phase of signals A and B, the position and direction of the encoder can be determined.

The encoder input of openDAQ is based on external interrupts at pin D6. Quadrature encoders must be connected to digital pins D5 and D6.

Its functionality consists on counting number of edges coming through the digital input D6 while getting the direction of the movement, by reading D5 on each interrupt.

The utility has two modes:

§  Linear encoder, for longitudinal sensors.

§  Rotary encoder, for rotational sensors. This type of encoders has an additional parameter, which is its resolution. This is the number of pulses for a complete turn of the encoder. The software uses this information to display a progress bar indicating the relative position of the encoder within one turn.

The software will start displaying the encoder relative position after that the Start Encoder button is pressed, and will stop with a click on Stop Encoder. The count is updated every 500ms approximately.

 

See also EasyDAQ Demo