Custom Scripts | LabJack
« Close

Datasheets and User Guides

App Notes

Software & Driver


Custom Scripts

The possibilities for what to do in a custom script are almost endless. Some options:

  • After a log file has been created, it can be copied to alternate locations using the cp command or copied to remote servers using the scp command.
  • Data can also be uploaded to public cloud storage locations such as AWS, Dropbox, or Google Drive by calling custom python programs.

Data Logging Scripts

Data Viewing Scripts


Windows Batch Scripts & Commands

There are a plethora of online resources tailored to scripting for Windows machines. Here are a few good resources:

Before running any scripts, it is recommend to look into the "CMD" command. At the start of each defined script, we recommend adding either:

// Terminate the CMD shell after executing the specified command.
cmd /c [your command..........]

// Leave the CMD window open after executing the specified command.
cmd /k [your command..........]

SCP & Linux commands on Windows

After installing a variety of Linux command line utilities onto a Windows machine, users can configure LJLogM to perform a lot of powerful features. Internally, we use and suggest others to download the tools provided by Cygwin and GnuWin32. Once installed and properly configured, users can copy files created by LJLogM to a remote host with SCP by following the following syntax:

scp "<file-path>" [email protected]_host:/remote/directory

There are many examples for how to use SCP online, here is a link to one: Linux - How to Securely Copy Files using SCP examples as well as a Stack Exchange topic: Use scp to transfer a file from local directory X to remote directory Y.

Going Further, Python and Node.js

If there aren't any existing Windows batch commands or Linux bash commands that accomplish the task at hand, look into installing tools like Python or Node.js to greatly enhance what can be done with LJLogM's scripting capabilities. Both Python and Node.js have a plethora of online libraries that can be leveraged to perform tasks that need to be automated. After installing python or installing node.js head back to Google and start searching for cool places to upload files. There are more tutorials out there than you can shake a stick at.

Scripting with MATLAB

If the logged data needs to be analyzed and a variety of complex calculations need to be performed, consider writing a MATLAB program that reads in a log file and have it perform calculations either during an experiment (after each log file is created) or when the log session completes. 

Quickly read a .csv file using the "readtable" function and generate XY Plots.

Additional Potential Integrations