LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

max value feedback

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;

 

 

 

0 Kudos
Message 1 of 8
(3,328 Views)

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.

 

 

Message 2 of 8
(3,306 Views)

Maybe you team up with sanju on this very same topic?

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 3 of 8
(3,302 Views)

 

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. 🙂

 

0 Kudos
Message 4 of 8
(3,264 Views)

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.

Message 5 of 8
(3,259 Views)

Thankyou for your response  

 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 .

0 Kudos
Message 6 of 8
(3,246 Views)

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…

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
Message 7 of 8
(3,229 Views)

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.

 

 

Message 8 of 8
(3,193 Views)