Scripting Tools
We have an open-source library ( www.docs.endaq.com or pip install endaq) to not only parse our IDE files, but also perform calculations, generate plots/dashboards, batch process, etc. If interested in writing Python code to interface with data recorded by an enDAQ device - that is the preferred library/tool to use. For more visit the open-source library article.
This is for legacy customers: And as of enDAQ Lab 2.0, Lab provides a Scripting menu that enables advanced users to programmatically interact in Python with many of the components of enDAQ Lab. The scripting interface uses Python version 2.7 until Lab 3.0 which uses Python 3. This page aims to familiarize you with the various features that the Scripting menu offers.
In this Article
Fully Functioning Python Library
We have an open-source library to not only parse our IDE files but also perform calculations, generate plots/dashboards, batch process, etc. If interested in writing Python code to interface with data recorded by an enDAQ device - this is the preferred library/tool to use. Install our open-source Python library with:
pip install endaq
Our documentation is hosted at www.docs.endaq.com. The source code is on github.
A Google Colab notebook was the subject of the following webinar and went through a few examples to showcase our open source library.
Open-Source idelib Library
We have published our idelib which is a Python API for accessing the .IDE files enDAQ sensors create. This library is available here, even available on PyPi to install with pip install idelib.
- https://pypi.org/project/idelib/
- https://github.com/MideTechnology/idelib
- https://travis-ci.com/github/MideTechnology/idelib
Editing in Lab
Note that using the endaq-python open-source library is not readily made possible with this current architecture, a new software package that will include the endaq-python library is in development.
Enabling the Scripting Menu
Scripting is disabled and hidden by default. To use it, it must first be enabled in the Preferences In the main window’s menu bar, select Edit → Preferences to bring up the preferences dialog:
In the dialog, check the Enable Scripting box:
Click Save to save the change and close the dialog. You should now have a Scripting menu in the menu bar of the main window:
Editor
The Script Editor is a text editor for writing Python scripts to run in enDAQ Lab’s Python environment. This is a great tool to use if you want to execute a longer set of instructions at once, or make a set of instructions that you can reuse in the future.
To open the Script Editor, go to the main window’s menu bar and select Scripting → Open Script Editor:
The Scripting Editor should then open in a new window:
From this window, you can perform many of the common text editor functionalities, like opening/saving files, find and replace, etc., through the File and Edit menu items.
Once you have a complete script, you can run your code by clicking Script → Run Script. This will run your code in the Python Console, where you can view any outputs or errors.
Python Console
The Scripting menu makes available a Python Console, where users can dynamically interact with the enDAQ Lab application. This is a great tool to use if you want to investigate your data, test out an experimental scripting idea, or just want to explore enDAQ Lab’s Python API.
To open the Python Console navigate to the main window’s menu bar, select Scripting → Open Python Console:
The Python Console should open in a new window:
This window behaves much like a Python Console on the command-line; Python code statements typed in will be executed in the enDAQ Lab environment on pressing Enter: