LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Max/Min Display

When I right click on the while loop and click set breakpoint, a red rectangle appears around the outside of the while loop, while my red rectangle is inside the while loop.  It only appeared after I tried to run it the first time.  Before I click stop, the rectangle flashes red and blue.   I think it just means there is a problem.
0 Kudos
Message 11 of 31
(2,527 Views)

Hi rmichels,

 

Try this - with your mouse on the block diagram, hold Shift and right-click and select the tool that looks like a small red stop sign. Then, click the white space within your while loop to remove the breakpoint. Let us know if that helps.

 

Regards,

 

Dan Richards

Dan Richards
Certified LabVIEW Developer
0 Kudos
Message 12 of 31
(2,518 Views)

Try this, change the VI to run mode (ctrl-m) click inside the while loop. This should remove the break point.

 

Ton

Free Code Capture Tool! Version 2.1.3 with comments, web-upload, back-save and snippets!
Nederlandse LabVIEW user groep www.lvug.nl
My LabVIEW Ideas

LabVIEW, programming like it should be!
Message 13 of 31
(2,499 Views)

OK.  Thanks.  I got rid of the break point now.  Sorry Dan, I misunderstood you at first.  Now my VI will run but the shift registers don't seem to be doing their job.  It's just as if I ran the HRR signal directly into the statistics express VI and it recalculates max and min starting from scratch each time.

 

Also, I still don't know what to do about my time axis issues.  They are all inconsistent both in format and value and if I change the format, it changes back as soon as I run it.

I've attached my VI again. 

 

Thanks,

Richard

0 Kudos
Message 14 of 31
(2,476 Views)

Hi again,

 

Glad to hear you're clear on that one! Let's focus now on the problem with the shift registers, as you put it.

 

I have another concern when I see your VI. You have two While Loops, both running continuously, one within the other. I just want to make sure that you understand what that means for your program's execution. Here's what it means when I see it:

 

1. Outer Loop will execute once and wait for everything within it, including the inner While Loop, to finish executing.

2. Inner Loop will execute until you press the Stop button.

3. After Stop button is pressed, outer While Loop will execute again and wait for inner While Loop.

 

What would you like the functionality of the inner while loop to do for you?  

 

Again, perhaps I do not understand your needs, but regarding your problems with timestamps, etc., I would highly recommend reading up on using Dynamic Data: <http://zone.ni.com/reference/en-XX/help/371361E-01/lvconcepts/dynamic_data_type/> That help article will be somewhat useful. It's important to know that Dynamic Data is usually used as a substitute for Waveform data and usually includes arrays of data values, rather than one sample, as you created with your simulation express VI. Currently you are only putting out one value from your generator. If you just need a random number, why not use a random number generator? If you need data, why not create more than one sample for your code to analyze?

 

Maybe we should take a huge step back and have you explain what you want your code to do in general terms. That might help get to the bottom of the issues more quickly.

 

Regards,

 

Dan Richards

Dan Richards
Certified LabVIEW Developer
0 Kudos
Message 15 of 31
(2,449 Views)

I only added the inner loop to add shift registers to store 1 iteration of max and min values and then compare to the next incoming value from my main while loop.  So I only need the inner loop to go through 1 iteration each time my main loops does one.  I see how the logic doesn't really work now.   I just tried both using a for loop with N=1 and just adding shift registers to my main loop and wiring them in (removing the inner loop).  Both have exactly the same effect as the inner while loop.

 

OK.  What I will end up having is 6 thermocouples, 4 current signals from pressure transducers hooked up to bidirectional probes and O2, CO2 and CO measurements from a gas analyzer.  The values from the thermocouples and the pressure transducers will be averaged, which is why I only have 1 signal for each at the moment.  It is more to test the functionality of everything and taking averages is pretty simple.  I will be getting a DAQ from NI hopefully by next week so I can actually connect the instrumentation and try using the DAQ Assistant express VI. 

So what will happen is, the thermocouple measurements will be averaged, the pressures will be converted to velocities and then averaged and both will be delayed to match the time delay of the gas analyzer.  The velocities will also be time averaged over 5 seconds or so to smooth things out because we have a lot of turbulence in our system.  Then these data and the gas concentrations move through some calculations to come up with a Heat Release Rate and everything will be written to file.  Rinse and repeat.    I just want to show max and min values for a few different parameters so I can see the peaks reached and I want the times synchronized and in the same format.  Samples should be taken every second.

 

There must be a simple way to show max and min values and have them transferred to the next iteration.  Maybe I need an example of shift registers in action to better understand them.

Anyways, my needs are pretty simple.  Just one iteration after another with a few simple calculations, displays etc.  Just gotta get these wrinkles smoothed out.

 

Thanks,

Richard

Carleton University

0 Kudos
Message 16 of 31
(2,426 Views)

If you only added the inner while loop so you could have shift registers,
then trade the 'while' loop for a 'for' loop.

You can have shift registers in a 'for' loop too. 


Set the for loop to 1 iterations, this way the outerloop and inner loop each run 1 time per iteration. 

Message Edited by Cory K on 10-01-2008 04:33 PM
Cory K
0 Kudos
Message 17 of 31
(2,411 Views)

I tried that before I sent the last message.  It worked exactly the same way as having the while loop.

 

Richard

0 Kudos
Message 18 of 31
(2,371 Views)

Hi Richard,

 

I may be confused, but it looks to me like you are taking a signal, combining with another signal, taking the max and min of both of those signals and then going back and combining those max and min values with the original signal... over and over and over, until you have the same number of combined signals as iterations in your loop. If you replace the while loop with a foor loop that has no shift registers, then you're essentially doing the same thing but without sending the max/min values through each iteration.

 

And I'm not sure what the arrays are doing. In one array, you're looking at the 0th element and in the other you're looking at the 100th element, but there's no data in the array so it's basically an uninitialized 1D Array.

 

If you want to look at data and find out where the maximum or minimum point in the data is, then you are using the correct VI's. If you want to compare your signal to a max value and choose between the two, then you'll hvae to compare each element individually or an average of the elements. Currently, you have all data coming into that inner loop as a huge chunk of data. If you could convert it to an array (From Dynamic Data) and then index it in a for loop, then you could go through each element and compare it to a max or min value and manipulate data accordingly. Again, I could be confused about the functionality you need. Thanks for your patience with us. I think the size of your program can be overwhelming and you may have some other things going on in your VI that are confusing.

 

I think the best approach would be to take this issue one step at a time. I would HIGHLY recommend making a new VI that performs one part of what you're trying to do with the fewest number of subVI's and coding possible. Essentially, you would knock out as much as possible from your main code and try to get the functionality you want with test data or something.

 

We look forward to hearing from you again.

 

Regards,

 

Dan Richards

Dan Richards
Certified LabVIEW Developer
0 Kudos
Message 19 of 31
(2,351 Views)

Hello, I corrected your VI because you use shift register the wrong way. I initialised two variables, Minimum and maximum in the left hand of your main while loop. These are initialisers of the shift registers I created to vehicle your variables. Then I deleted your while loop, and instead, just took the actual min and max of your signal, compare it to the absolute minimum and maximum I stored in the shift register, and put the best value again in the shift register.

 

The shift registers are like a way to save values from one iteration to the other. You have to initialize them and then, update their value in the while loop. I didn't even tried to run your simulation, but anyway, this is the way you should use shift registers

 

Bests 

Message 20 of 31
(2,349 Views)