07-16-2013 09:58 AM
I am building an application that will read from two inputs. One being a particle counter and the other a thermocouple using the USB-TC01. The goal of this program is to report the two temperatures when the particle counter first reads 1,000 and 10,000 particles. The counter is set-up to take readings every six seconds, and it is possible to take a reading of say 1,200 counts then the next reading only read out 900 counts. So I want the temperature that is displayed to be from the first time the particle counter reads above 1,000counts.
Attached is my current VI, I had thought about putting the indicators inside an Event Structure that built an array and only reading the first element in that array. The way I have it set-up now doesn't seem to work.
Are there any ideas of how to grab these two temperatures to display them on the front panel?
07-17-2013 01:17 PM
Realize this is a loaded noob question but any help is appreciated.
My two events are in a sequence structure inside a while loop My particle counter is in the first frame, thermocouple in the second
What will be the easiest way to pull a temperature and place for a given particle count?
I tried an event structure in the last sequence of my sequence structure, it doesn't seem to be working
07-17-2013 02:07 PM
While there may be better ways, I'd just make a boolean indicator/control (hidden on front panel) for each important temperature display. When the program starts, set them to true. When you make the first temp reading for a particle count, set the corresponding boolean to false. Now in the future, you can check the boolean first to determine if you should update the temperature measurement. If the boolean is false, a reading was already made so another one isn't needed.
07-17-2013 02:55 PM
Thanks for the reply. But I don't think I explained my test very well.
I am using this test to heat oil and measure the temperatures when the particle counter determines it is "smoking"
1,000 counts is considered to be partial smoke and 10,000 counts is completely smoking.
So I need to grab the two temperatures when I pass these count limits. The biggest problem is that I have multiple cycles between 1,000 and 10,000 counts so my "temperature @ 1,000 counts" keeps getting updated every cycle.
I have a similar setup to what you suggested except I set booleans to false and once they read true (ie the counts are >1000) then I should read my temp measurement but when I set it up this way in an event structure the event never occurs, or constantly replaces my temperature for every cycle after that.
07-17-2013 03:17 PM
My point was to use a SECOND boolean to determine if you should update the temperature info or keep the current data. You obviously check to see if the particle count is larger than 1,000 (or 10,000) and you'll get a boolean true or false. If true, use the second boolean to control whether or not the temp value is updated (ie if it's the first measurement or not).
07-17-2013 09:48 PM
It looks like you are trying to pass reference information to an Instrument Assistant and send it to the VISA Close function at the same time. This can be problematic right now since by the time the while loop starts the reference has already been closed. Try deleting the Visa Close from your code. The resource itself is being Opened and Closed by the Instrument I/O Assistant. This application sounds time sensitive so I would consider looking toward more low level coding instead of DAQ and Instrument Assistant since they constantly open and close references during loop iterations which takes a lot of time.
07-19-2013 07:32 AM
Did not think of using a second boolean, now I see what you're saying, I'll give this a shot.
07-19-2013 07:56 AM
I've used the VISA close function because if I don't about half the time it tells me my visa is correct but cannot be accessed, i.e. it didn't close properly the last time, so I figured if I start the program by closing it I can avoid this problem. This is a big problem when I have to stop the program prematurely (trouble shooting) and I guess the VISA remains open. This part seems to be working fine, but if there is a better way of doing this I'm open to it.
The program is somewhat time sensitive, I measure for 3 seconds then pause for 3 seconds. So I need to read data every 6 seconds, I don't think I need to be concerned with a few extra milliseconds? I could be wrong. Even though technically I would want the temp reading from my DAQ assistant to be at the same time as my Instrument reading, over the course of 6 seconds my temperature will only increase less than 1degree C so if my DAQ reading is 1-3seconds after my instrument reading that will be ok.