Atmospheric pressure, temperature and relative humidity data acquisition in LabVIEW
Atmospheric pressure, temperature and relative humidity measurements
Dracal USB all-in-one sensors and DAQ
Dracal Technologies' PTH-series USB sensors offer a simple and dependable solution for accurate atmospheric pressure, temperature and relative humidity measurements, easily integrating with your existing system. For enhanced accuracy, an optional user-calibration feature allows customization to meet your specific needs. Additionally, the Virtual COM protocol option ensures smooth integration across various platforms, providing versatile data communication capabilities. These durable USB sensors are accompanied by free, user-friendly USB DAQ software for visualization and logging, along with a full set of code examples to facilitate fast integration with platforms like LabVIEW, Python, C++, and others.
What will your configuration be?
Select the configuration of your choice from the table below. For each of these four configurations, a downloadable template is available in step 5 below.
- The two rows represent the 2 possible operational mode of our instruments, which is USB or VCP. Instruments in USB mode have to be querried by our free command-line tools, while those with VCP mode can be querried directly from the instrument, without the need of our free, but proprietary, tools.
- The two columns represent the way to connect the instrument to the PC, which is either directly via a USB port on your PC, or wirelessly (Wi-Fi/Ethernet) using our SensGate gateway.
- The instrument used is any of Dracal 3-in-1 atmospheric pressure, temperature and relative humidity USB sensor of the PTH series.
PC-connected |
Wi-Fi/Ethernet-connected |
|
USB |
CONFIGURATION 1 Dracal 3-in-1 USB sensors physically connected to a PC via USB and systems that can invoke our free command-line tools. |
CONFIGURATION 3 Dracal 3-in-1 USB sensors that connect wirelessly to a PC via a SensGate and systems that can invoke our free command-line tools. |
COM |
CONFIGURATION 2 Dracal 3-in-1 USB sensors physically connected to a PC via USB and systems that prefer to talk directly to the device via the COM protocol. |
CONFIGURATION 4 Dracal 3-in-1 USB sensors that connects wirelessly to a PC via a SensGate and systems that prefer to talk directly to the device via the COM protocol. |
Step 1. Get your equipment
Whichever your set-up, you will need the following three elements:
- 1 X PC (Windows, Mac or Linux) with LabVIEW installed
- 1 X Dracal PTH-series all-in-one atmospheric pressure, temperature and relative humidity sensor
Additional equipment/option for your specific set-up is:
PC-connected |
Wi-Fi/Ethernet-connected |
|
USB |
CONFIGURATION 1
|
CONFIGURATION 3
|
COM |
CONFIGURATION 2
|
CONFIGURATION 4
|
Step 2. Download the free DracalView software & tools
Download our free USB DAQ (Windows, Mac, Linux), which includes the DracalView graphical interface and interfacing tools. When you receive your Dracal USB temperature and relative humidity sensor, you'll be able to get to work straight away, using the DracalView GUI to quickly visualize your temperature and relative humidity measurements. For calibratable models, calibration can also be performed intuitively with DracalView.
Step 3. Switch your sensor to Virtual COM mode (configs. 2 & 4 only)
* For more information on VCP, consult the complete VCP documentation.
For users that chose to work in virtual COM mode, switch your device from USB to VCP mode. This is done via our command line tool dracal-usb-set
(quick start guide with command line tools here). To do this, execute the command set_protocol VCP
followed by the the reset
command to create a virtual device disconnection. In the following example, this procedure is illustrated on a device whose serial number is E16026
.
C:Program Files (x86)DracalView> dracal-usb-set -s E16026 set_protocol VCP
C:Program Files (x86)DracalView> dracal-usb-set -s E16026 reset
If only one Dracal sensor is connected to your computer when executing these commands, you can omit to specify the serial number of your device (as there is only one) by using the option -f
as in the following example:
C:Program Files (x86)DracalView> dracal-usb-set -f set_protocol VCP
C:Program Files (x86)DracalView> dracal-usb-set -f reset
Note for Windows users: When executing the command reset
, the following echo will be returned in your terminal:
C:Program Files (x86)DracalView> dracal-usb-set -f reset
USB control message error: usb_control_msg: sending control message failed, win error: The device does not recognize the command.
This behaviour is normal and confirms that the disconnection was successfully completed.
Step 4. Connect the SensGate to your network (configs. 3 & 4 only)
Step-by-step procedure to connect your SensGate to an existing network here. If you prefer to create your own sub-network for your project, follow this step.
Step 5. Download and run your ready-made LabVIEW model
Each of the above configurations is associated with a downloadable template in the table below. Click on the images to enlarge them and get a better view of the block diagram and main window of the proposed template.
Models 1) & 3) leverage Dracal's command line tools, ideal for Dracal sensors connected via USB either to the computer or, with some minor adjustments, to a SensGate (Wi-Fi/Wireless gateway). This solution is for instruments without the virtual COM protocol option. This method is simple and effective, allowing LabVIEW to directly access sensor data using preconfigured commands that retrieve real-time measurements. With these tools, users can easily integrate temperature, relative humidity and temperature readings, as well as all virtual channels (e.g. dew point, altitude) into their LabVIEW project within minutes.
For users who have opted for the serial protocol, the models 2) and 4) offer a different approach, communicating with the instruments via a virtual serial port. In model 2), the VISA (Virtual Instrument Software Architecture) functions built into LabVIEW make this integration straightforward, facilitating direct read/write commands to the sensor. This model gives users better control over data acquisition and allows for more advanced customization in LabVIEW. In model 4) for Wi-Fi/Ethernet connectivity, the REST API available in SensGate enables direct access to your sensor data via an HTTP block.
PC-connected |
Wi-Fi/Ethernet-connected |
|
USB |
CONFIGURATION 1 |
CONFIGURATION 3 |
COM |
CONFIGURATION 2 |
CONFIGURATION 4 |
Conclusion
Obtaining atmospheric pressure, relative humidity, and temperature data in LabVIEW takes just minutes. With Dracal’s extensive library of code examples, all four configurations are fully supported, ensuring effortless integration regardless of your chosen communication protocol (USB or VCP) or connection method (USB, Wi-Fi, or Ethernet).