from labjack import ljm import time import sys handle = ljm.open(ljm.constants.dtT7, ljm.constants.ctANY, "ANY") name = "FIO2" counterName = "DIO2_EF_READ_A" #Configures the counter ljm.eWriteName(handle, "DIO2_EF_ENABLE", 0) ljm.eWriteName(handle, "DIO2_EF_INDEX", 8) ljm.eWriteName(handle, "DIO2_EF_ENABLE", 1) while True: #read and print the actual state from FIO2 FIO2_state = ljm.eReadName(handle, name) print("\n%s state : %f" % (name, FIO2_state)) #Read and print the value of the counter (DIO2_EF_READ_A) counter = ljm.eReadName(handle, counterName) print("\n%s state : %f" % (counterName, counter)) time.sleep(1) ljm.close(handle)