Getting started with Dracal command-line tools

 

rocket launch with coding symbol

Introduction

The use of Dracal instruments goes hand in hand with the free software resources provided to you. These tools are currently divided into two categories: graphical interface and command-line tools.

The DracalView graphical interface allows you to instantly visualize and record data from your Dracal sensors, regardless of their type, whether they are directly connected to your computer via USB or through SensGate. Its download is accessible with a single click on the software page of the website, and Windows and Mac users can instantly use it. Linux users need to compile the tool, but a short step-by-step documentation allows Linux users to become functional within minutes.

However, to integrate Dracal sensor data into your systems, it is necessary to be able to use our command-line tools. The purpose of this page is to indicate where the command-line tools are located on your computer and how to call them for the first time.

1. Available Tools

Here is a brief description of the command-line tools that are provided to you: 

dracal-usb-get: Allows access and integration of data from instruments connected via USB. A user guide, code examples and an example of integration in LabVIEW are available.

dracal-sensgate-get: Allows access and integration of data from instruments connected through SensGate. A user guide, code examples and an example of integration in LabVIEW are available. 

dracal-usb-set: Tool required only for using the virtual COM port communication mode (VCP option).

dracal-usb-cal: Tool for calibrating Dracal instruments without using the graphical interface. A user guide is available.

2. Download

To simplify our software offering, all our tools are made available by downloading the DracalView application. Therefore, make sure you have downloaded it beforehand.

3. Locating and Running Command-Line Tools

3.1 Windows Users

After installing DracalView, you will find the command-line tools in the application's installation directory. Usually, it will be "C:\Program files\DracalView" or "C:\Program files (x86)\DracalView".

To run the tools, you must use a terminal instead of double-clicking on the associated icons in the file explorer. Open a terminal:

 

In the terminal, navigate to the application directory. For example, if you used the default directory, running the following command will take you to the right place:

C: \Users\MyUser> cd C:\Program Files (x86)\DracalView
C:Program Files (x86)DracalView> 

Running the dir command will help you identify the available tools for your instruments.

In Windows, a shortcut is created when downloading DracalView, named "Dracal Tools". Typing "Dracal Tools" in the search bar and clicking on the suggested shortcut will open a command-prompt window already positioned in the DracalView directory:

 

 

You can then use the command-line tools simply by calling the tool by its name, followed by the supported arguments. It is generally recommended to start with the -h (or -help) argument to discover the options available for each tool. For example:

C:Program Files (x86)DracalView> dracal-usb-get -h 

Usage: ./dracal-usb-get [arguments]

Valid arguments:
    -V           Display version information
    -v           Verbose mode
    -h           Displays help
    -l           List and display info about available sensors
    -s serial    Use USB sensor with matching serial number. Default: Use first found
    -i id<,id,id...>  Use specific channel(s) id(s) or 'a' for all. Default: 0
    -x num       Set number of fractional digits [0-6]. Default: 2
    -R num       If a USB command fails, retry it num times before bailing out
    -T unit      Select the temperature unit to use. Default: Celsius
[...]

3.2 Mac OS X Users

In Mac OS X, we assume you placed DracalView in the Applications directory. To view the command-line tools from the file explorer, right-click on the DracalView application and click on "Show Package Contents > Contents > MacOS". The list of available tools should be there:

To run the tools, you need to open a terminal:

And navigate the same path as mentioned above:

MyUsers$ cd /Applications/DracalView.app/Contents/MacOS/
MyUsers$ ls

dracal-sensgate-logtool    dracal-usb-get   	 usbtenkical
dracal-sensgate-scan    dracal-usb-set   	 usbtenkiget
dracal-usb-cal   	 dracalview   	 usbtenkiset

You can then use the command-line tools by calling the tool by its name, preceded by "./", followed by the supported arguments. It is generally recommended to start with the -h (or -help) argument to discover the options available for each tool. For example:

MyUsers$ ./dracal-usb-get -h

Usage: ./dracal-usb-get [arguments]

Valid arguments:
    -V           Display version information
    -v           Verbose mode
    -h           Displays help
    -l           List and display info about available sensors
    -s serial    Use USB sensor with matching serial number. Default: Use first found
    -i id<,id,id...>  Use specific channel(s) id(s) or 'a' for all. Default: 0
    -x num       Set number of fractional digits [0-6]. Default: 2
    -R num       If a USB command fails, retry it num times before bailing out
    -T unit      Select the temperature unit to use. Default: Celsius
[...]

Linux Users

The Dracal application and tools need to be compiled under this operating system to support different Linux distributions. Specific documentation is dedicated to compiling Dracal tools under Linux, which requires "extracting the archive to the location of your choice".

It is then indicated: "At this location, simply run the make command. The /build folder created there contains two others, including /bin", which contains the executable files of the command-line tools. If we consider, for example, that the archive was extracted to a directory named MyDracalon the Desktop, it will be possible to access the command-line tools like this:

user@MyLinux:~$ cd Desktop/MyDracal/DracalView-3.2.1/client/build/bin/
user@MyLinux:~/Desktop/MyDracal/DracalView-3.2.1/client/build/bin$ ls
dracal-sensgate-get      dracal-usb-cal  usbtenkical
dracal-sensgate-logtool  dracal-usb-get  usbtenkiget
dracal-sensgate-scan     dracal-usb-set  usbtenkiset

You can then use the command-line tools by calling the tool by its name, preceded by "./"followed by the supported arguments. It is generally recommended to start with the -h (or -help) argument to discover the options available for each tool. For example:

user@MyLinux:~/Desktop/MyDracal/DracalView-3.2.1/client/build/bin$ ./dracal-usb-get -h

Usage: ./dracal-usb-get [arguments]

Valid arguments:
    -V           Display version information
    -v           Verbose mode
    -h           Displays help
    -l           List and display info about available sensors
    -s serial    Use USB sensor with matching serial number. Default: Use first found
    -i id<,id,id...>  Use specific channel(s) id(s) or 'a' for all. Default: 0
    -x num       Set number of fractional digits [0-6]. Default: 2
    -R num       If a USB command fails, retry it num times before bailing out
    -T unit      Select the temperature unit to use. Default: Celsius
[...]

Next Steps

At this stage, you are ready to continue exploring the command-line tools provided for integrating your data. As pointed out in the beginning of this page, several resources are available, including documentation for the tools themselves, getting-started guides, and ready-to-use code examples in the website's Resources section. If you wish to contribute to the Dracal community and share your code examples with us, we will happily make them available to all users in the appropriate resource on our website.