LJFuse makes communicating with a LabJack device simple on Linux and Mac OS X. Really simple. Trivial, really.
Introduction
It’s been said (many, many, times) that everything’s a file in UNIX. LJFuse adopts that philosophy and makes the connections on a LabJack device into files on the filesystem. To do so, it uses FUSE on Linux and MacFUSE on Mac OS X.
For example, to read analog input AIN0, read a file named “AIN0”.
$ cat MyU6/connection/AIN0
3.300
To set DAC0 to 2.4V, write “2.4” to a file named “DAC0”.
$ echo 2.4 > MyU6/connection/DAC0
$ cat MyU6/connection/DAC0 # Read the DAC0 to verify it was set
2.400
To set FIO0 to digital output high, write a “1” to “FIO0”.
$ echo 1 > MyU6/connection/FIO0-dir # Set the direction to output
$ echo 1 > MyU6/connection/FIO0 # Set the state to output high
$ cat MyU6/connection/FIO0 # Read the value back
1
You can do this from any program that knows how read and write files. Your program doesn’t need to know about USB communication, drivers, or the LabJack API. The details are hidden by LJFuse.
Quickstart
Check the requirements (in short, a working LabJackPython installation on Linux or Mac OS X), and download the source code for LJFuse from GitHub. Click the “ZIP” or “Download Source” button on the GitHub page to download.
Connect a LabJack and run LJFuse like this:
$ python ljfuse.py
p.
Comments
No comments yet. Speak up. We're listening.