Automatic flexible configuration for the T7 | LabJack
 

Automatic flexible configuration for the T7

9 posts / 0 new
Last post
CMartin
cmartin's picture
Automatic flexible configuration for the T7

I wrote a C-header that lets me configure the T7 through a .conf text file.  It has come in so handy, that I figured there's probably at least one other human being in the world who might find it useful.  I've set up a git repository here: https://github.com/chmarti1/lab.git   Check out the README.md to get started. 

  • The lconfig.h header file has detailed documentation in its comments.
  • There are example .c codes implement the header
  • lconfig.py is a Python module that parses the config
  • loadall.py is a Python module that parses the data files that the data file stream creates
  • The make*.sh files are my lazy version of a make file.

$ git clone https://github.com/chmarti1/lab.git

As of this posting, there is one known bug in version 1.2, that is discussed here.  The bug creates unexpected behaviors when attempting to continuously stream two analog outputs.

CMartin
cmartin's picture
Version 2.02 is up.  There's

Version 2.02 is up.  There's much better documentation and some pre-compiled command line utilities for burst and stream operations.  More features are coming.

CMartin
cmartin's picture
Version 2.03 is up.  I've

Version 2.03 is up.  I've included automatic configuration for most of the flexible digital I/O features supported by the T7.  Below is an example configuration file that the LCONFIG code uses to automatically configure PWM output on FIO0 and counter input on FIO2.

I haven't updated the pretty documentation yet, but detailed authoritative information on the configuration parameters and their behaviors is commented into the header file above the load_config() definition.


connection usb
serial 470014042

fiofrequency 1250

fiochannel 0
fiosignal pwm
fiodirection output
fioedge rising
fioduty 0.25

fiochannel 2
fiosignal count
fiodebounce fixed
fiousec 100

CMartin
cmartin's picture
Version 3.00 is tested and

Version 3.00 is tested and posted.  LCONFIG has grown into more than a configuration system.  It includes a fully configurable software trigger with pre-trigger buffering, fully configurable function generator DAC channels, it supports most of the T7's FIO extended features, it includes two command-line utilities for Linux, and it has detailed documentation.

Version 3.00

The Python data analysis tools are now out of date, but they should still be backwards compatible to the analog settings.

Nick.Busigin
Hi Chris,

Hi Chris,

Thanks for sharing! 

Nick

CMartin
cmartin's picture
You bet, Nick.  The

You bet, Nick.  The repository is still a little messy; I really need to prune it.  If you have any difficulty getting up and running with it, post your questions here and I'll try to help out!

CMartin
cmartin's picture
https://github.com/chmarti1

https://github.com/chmarti1/lab

It has been a while since I've posted here, but the C- configuration code is now up to version 3.03.  The system includes text file configuration for streaming:

  • single-ended / differential AI
  • AI resolution
  • AI range
  • AI settling time
  • AI sample rate
  • Software trigger AI channel
  • Software trigger AI threshold
  • Software trigger rising, falling, or any edge
  • Digital hardware trigger on a counter input channel
  • Configurable pre-triggering

All streaming is handled automatically through a ring buffer implemented in the lconfig binaries, which also handles tests for software trigger events.

The drun and dburst linux binaries implement continuous long-interval streaming directly to a file and high speed short-interval streaming to memory before being saved to a file.  They are documented using -h switches, and are highly configurable.

For aplications that need FIO extended features, the LConfig system exposes API funcitons for interfacing with the FIO registers autoatically using the same configuration file interface as the AI streaming configuraiton parameters.

I use the LConfig system in my lab on the Linux Mint OS, but it should also be compatible with Ubuntu and many other Linux distros.  I have not tested the code for Windows compatibilitiy.

CMartin
cmartin's picture
https://github.com/chmarti1

https://github.com/chmarti1/lconfig

Version 3.04 has been forked to a new distribution, more appropriately named "LCONFIG"  The documentation has been updated, and I've finally added more robust post-processing and in-configuration calibration of signals.

I decided to make a fork to separate the specialized codes I use in my lab from the extensible utilities that folks here are likely to find useful.  I hope folks enjoy!

-

Chris

Nick.Busigin
Thanks once again for sharing

Thanks once again for sharing Chris!

Nick