LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Display Indictor value when boolean is true

Hey,

 

This ia a very basic issue I have been facing for quite some time and am unable to figure out a solution for this.

 

I have an indicator display that has to update the value it shows only whenever a boolean is ON. The indicator displays the average of ten samples, and has to update only after ten samples have been acquired. The boolean goes ON after the acquisition of every tenth sample.

 

I have tried keeping the indicator in a case structure, but it ends up displaying 0 all the time. I then tried to pass the wire through the case structure keeping the indicator outside, and even that didn't work. 

 

Can you please suggest a solution ?

 

Thank you

Dheeraj Bharadwaj
IIT-Madras
0 Kudos
Message 1 of 7
(3,023 Views)

THis sounds trivial.

 

Make sure the case structure calculates the average and updates the indicator every 10 iterations.

Please show us your code so we can see what you are doing wrong. Thanks.

0 Kudos
Message 2 of 7
(3,021 Views)

Show us your code

--------------------------------------------------------------------------------------------------------
Kudos are always welcome if you got solution to some extent.

I need my difficulties because they are necessary to enjoy my success.
--Ranjeet
0 Kudos
Message 3 of 7
(3,019 Views)

Hi,

 

PFA an image of my program. 

 

I don't want to hide the inidicator. I just need it to update itself at the end of every fixed number of cycles.

 

I know this problem is quite trivial, which is why this is quite frustrating,

 

Thanks

Dheeraj Bharadwaj
IIT-Madras
0 Kudos
Message 4 of 7
(2,997 Views)

BTW, The "AnalogAverage" is the indicator I am trying to update every fixed number of cycles.

Dheeraj Bharadwaj
IIT-Madras
0 Kudos
Message 5 of 7
(2,995 Views)

You are not showing your program, but just a picture. That's not the same. For example we cannot see what's in the other cases.

 

I don't see why placing the "Analog average" indicator inside the case structure would not solve the problem.

 

You should really keep the "total" inside a shift register also. I see many problems with you code overall (e.g. race conditions).  For example the "No of data pts acquired" is read from the local variable before the terminal has been updated, while the  "total" contains the updated value of the iteration. You are mixing stale and current values in the same operation!

Why the weird mix of representations I16 data, I32 counts, I64 total, etc.? Your code is peppered with coercion dots.

Several of your case structures can be combined into one. Keep it simple!

What determines the loop rate?

 

 

Message 6 of 7
(2,991 Views)

Try something like this....

 

0 Kudos
Message 7 of 7
(2,977 Views)