03-24-2015 06:04 AM - edited 03-24-2015 06:15 AM
Greetings. I am a beginner in Labview. I have stuck in this problem regarding the comparision. I have to feed back the new maximum value to the comparator for the next comparision. I mean the design should be like
Max = a, if a<b, then Max =b;
03-24-2015 06:41 AM
ksherlock,
you need to compare your new data vs the previous data in the > . instead of running the results of the > function to the shift register, run the output of the convert from dynamic data to the bottom of the > function. This will compare the previous reading to the current reading.
You can then go from there to a True false case or comparison select function from the >function to output the the shift register, so you always are outputing the maximum value.
03-24-2015 06:43 AM
Maybe you team up with sanju on this very same topic?
03-25-2015 12:16 AM
Done with that problem. But again I am stuck with this boolean push button.
When the condition becomes true it passes 0 to shift register and when it is released it is still passing the same value 0.
May be its not coming out of the loop? What else could be the problem? Suggest something..
Thanks in advance for any assistance. 🙂
03-25-2015 01:37 AM
You seem to be dealing with arrays containing a single element. It probably would be simpler to use scalars, right?
Your boolean is switch action, thus it will switch whenever you press it (the release is ignored). If you want it to revert if the button is released, use "switch until released" mechanical action instead. Still, a latch actions is probably more appropriate here. Try to learn the differences.
03-25-2015 02:09 AM
Thankyou for your response altenbach
I have done all the changes as per you said. But the problem is still all the same.
Even after changing the mechanical action of the button , it is giving the true condition. It is not passing the initial constant value given to shift register .
03-25-2015 03:01 AM - edited 03-25-2015 03:03 AM
Hi sherlock,
But the problem is still all the same.
Do you ever think about the VI you created?
Your DAQAssistent is set to read 100 samples at 1kHz samplerate. You only use the very first sample of those 100 samples per read operation to get the max value. Do you think this is the correct approach?
Also starting the MAX() operation with a preset value of 1.003 doesn't seem right to me. What happens when your voltages stay below 1 V?
It is not passing the initial constant value given to shift register .
Why should it? You have wired the zero constant instead of your "1.003" initial value…
03-26-2015 06:44 AM
Sherlock,
You need to take all the data that you aquire in each interation and find the maximum value, and then send that to the max min function.
When the VI starts the value on the outside of the loop only go into the shift register for the 1st iteration, after that your select function will control the value in the shift register.