Use this code to read .adicht (Labchart) files into Python. Interfacing with the ADIstruments DLL is done via cffi.
pip install adi-reader
import adi
f = adi.read_file(r'C:\Users\RNEL\Desktop\test\test_file.adicht')
# All id numbering is 1 based, first channel, first block
# When indexing in Python we need to shift by 1 for 0 based indexing
# Functions however respect the 1 based notation ...
# These may vary for your file ...
channel_id = 2
record_id = 1
data = f.channels[channel_id-1].get_data(record_id)
import matplotlib.pyplot as plt
plt.plot(data)
plt.show()
For upgrading to 3.8, I installed Python 3.8. Within the interpreter I ran the following:
Jim note to self, rather than installing Anaconda I simply:
C:\Users\RNEL\AppData\Local\Programs\Python\Python39-32\python
import subprocess
import sys
#https://stackoverflow.com/questions/12332975/installing-python-module-within-code
def install(package):
subprocess.call([sys.executable, "-m", "pip", "install", package])
install("cffi")
import os
#This would need to be changed based on where you keep the code
os.chdir('E:/repos/python/adinstruments_sdk_python/adi')
# For 64 bit windows
exec(open("cffi_build.py").read())
#------------------------- ONLY IF 32 BIT WINDOWS -------------------
# For 32 bit windows
exec(open("cffi_build_win32.py").read())
pip install twine
. Then I changed my drive e:
changes to the E drive and then cd'd to the directory to run:
python setup.py sdist bdist_wheel
twine upload dist/*
This was written extremely quickly and is missing some features. Feel free to open pull requests or to open issues.