04-19-2016 03:55 AM
Hi,
I'm using a Measurement Computing USB-Temp in order to acquire temperature with several sensors. I've made the attached program for two sensors. The problem is : I have to add a waveform for every sensor I have. So the program will rapidly become unreadable if I want seven or eight sensors.
Do you know a way to correct it ? Maybe with arrays...
Sorry for bad english
Solved! Go to Solution.
04-19-2016 04:20 AM - edited 04-19-2016 04:22 AM
Yes - instead of having a single waveform on your shift register, change that to an array of waveforms. You can then have your data acquisition in a For loop for the number of sensors you have.
Here's a very simple of example of how you can modify your program:
Also, be aware that because you are continuously building a waveform, if you run your program for a long time you will eventually run out of memory. You might want to consider looking at the Producer/Consumer architecture so that your logging happens while the data is being acquired, instead of just at the end (it also means you have data if your computer crashes 🙂 ).
04-19-2016 04:46 AM
Thank you for your answer ! This is what I needed.
What do you mean by "a long time" ? Is it an hour or a day 🙂 ?
What if I create a conditional structure in the while loop that save the data when the user press a button ? It would avoid the loss of data.
Thanks again
04-19-2016 05:00 AM
04-19-2016 06:16 AM
Okay thanks !