LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Limiting data collected from a loop

Solved!
Go to solution

I'm making a VI (LabVIEW 2016) to calibrate a thermometer I have hooked up to a 6008 Daq box.  My goal is to stick the thermometer probe in a beaker of water that is slowly being heated.  This beaker will also have a non-LabVIEW thermometer reading out the actual temperature.  Before the VI starts the user will set the starting temperature of the water being heated.  Then after starting the VI whenever the temp increases by 0.1*C the user will click a button and the program will record the temperature set by the user (based off the starting temp + 0.1) and the raw value off the temp probe.  This will continue sufficiently long to record values across the probe's intended use scale.  Then the program will save the values off both the probe and actual thermometer to a text list.  These data will then be plotted and a calibration curve set.  

 

My question is, in the attached VI how do I get only one data point per temp increment?  As it sits now I get a data point for each iteration of the loop.  I only want to record the values when the actual temperature changes, but I want to keep the loop speed up to make sure no data points are missed.

 

In the attached VI there is an option to simulate data, as I am sure these forum users don't have access to / want to set up an actual probe to test.  Any advice on the above question would be appreciated.

 

Thanks!

0 Kudos
Message 1 of 9
(3,113 Views)

I haven't looked at your code, but I would offer this idea:

 

Instead of triggering a measurement from a button, why don't you monitor the temperature continuously, and then record a line in a file or on a chart every 0.1 degree, or whatever?

Steve Bird
Culverson Software - Elegant software that is a pleasure to use.
Culverson.com


Blog for (mostly LabVIEW) programmers: Tips And Tricks

0 Kudos
Message 2 of 9
(3,102 Views)

I guess my first question is more of a end user issue.

 

You want the end user to click the button on each .1 degree rise? 

 

How slow is the water being heated? How long do you expect them to sit there? Is this just "busy work"?

 

But anyway I would put a case in your loop to log a measurement only when the button is pressed.

========================
=== Engineer Ambiguously ===
========================
0 Kudos
Message 3 of 9
(3,100 Views)
Solution
Accepted by topic author athiggins

Use "built array" instead of "insert into array" when appending (no need for index), then place it inside a case structure that turns true whenever the temperature has changed by .1 degrees. Wire the array across unchanged in the false case.

 

Keep the temperature of the last addition in a shift register and compare with the current temperature at each iteration to decide if the case should turn true. If true, place the new comparison temperature in the shift register.

 

You could even do autoindexing with a conditional tunnel.

 

See how far you get....

Message 4 of 9
(3,097 Views)
Message 5 of 9
(3,075 Views)

Hi CostalMaineBird, thanks for your ideas, but I need to have the push button option.  I don't have a way to wire up the accurate thermometer to LabVIEW, so I need the manual control to tell the program when the temperature increases.  Yes, it is busy work, but it shouldn't need to be done very often.  Thank goodness for undergrads and their button pushing abilities!

 

0 Kudos
Message 6 of 9
(2,996 Views)

Hi, altenbach,

 

I found your answer and draft super helpful for what I am trying to do! However, my problem is a little different, I just didn't want to create another post in the endless sea of them.

Basically, I want to be able to create a matrix that has about 10 columns, every time a specific condition is true I want the first 5 data points/columns in the row to be recorded and the second 5 data points not to be recorded and just say 0, and every time another specific condition is true I want the first 5 data points/columns in the row to be 0 and the second 5 data points to be recorded.

 

Could you please help me with that?

 

Thank you.

0 Kudos
Message 7 of 9
(1,392 Views)

I think your problem is quite different, so you probably should have started a new thread, especially if this thread is already marked as solved. If somebody now solves your problem, you have no way to mark it as solved.

 

Sorry, you need to be much more specific describing your problem.

 

  • In LabVIEW, a "matrix" is a special datatype for linear algebra. I think you are talking about a 2D (or 1D?) array instead.
  • How many columns is "about 10 columns"? Is that number fixed or can it vary. How many rows are there? Can the number of rows vary? Since you never talk about the number of rows, could it be that you only have a 1D array?
  • You talk about all these specific conditions. How many are there? Can more than one be true at the same time?
  • Where does the new data come from? What should happen if you get more than 5 data points?
0 Kudos
Message 8 of 9
(1,387 Views)

You are right. I have started a new post (https://forums.ni.com/t5/LabVIEW/Save-only-one-data-point-per-variable-input-when-condition-are/m-p/...) and made my question more simply. Hope its more clear in the other post and would appreciate any help.

 

Thank you.

0 Kudos
Message 9 of 9
(1,357 Views)