I just got a LabJack U6 and am trying to write a program using LabJack Python. The basis for my script/program is the streaming example given in the examples folder of the source code. I've got the Mux80 and four of the CB37 boards. I'm going to be using over 30 T-type thermocouples to measure temperature data. I basically want to log the data into a CSV or excel and then graph these against time. The area where the logging will happen I imagine is located in place of the two print statements.
if r['missed'] != 0: missed += r['missed'] print "+++ Missed ", r['missed'] # Comment out these prints and do something with r print "Average of" , len(r['AIN0']), "AIN0," , len(r['AIN1']) , "AIN1 reading(s):", print sum(r['AIN0'])/len(r['AIN0']) , "," , sum(r['AIN1'])/len(r['AIN1']) dataCount += 1 packetCount += r['numPackets']
Since there is so much data and it may take time to convert the voltages to temperature readings, log and then graph in real time, I wanted to know the best way to add in these steps without missing samples/packets. Would I have to start some sort of parallel process or thread and then in place of those two print statements, I just add the 'r' dict to some global queue that the thread keeps working on at its own pace? Thanks for any help or suggestions.