LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Activate buzzer and LED every 5th data streaming value update

Dear LabView community,

 

I am currently a student who has a very limited computer coding background. My supervisor wants me to start testing testing next week, so i am under a bit of pressure to get my VI code up an running.

The VI (version 9) which i have created calls for one double data point from another separate software (dll plugin) each time the iteration run. 

 

The streamed data  into labview (volts which is converted to acceleration G’s in the vi) of which is leg accelerations during continous treadmill running. I have set up a moving average based on 5 previous acceleration peaks. The moving average is being constantly updated during the continous running of the vi.

 

The thing that i am having trouble with is implementing a buzzer/LED feedback system to set off at every 5th moving average update. At present the buzzer/LED is set up on going off on each moving aveage change/update.an i implement the buzzers/LED to go off every 5th moving average change?

 

Could you implement this logic in my VI and show me in a png/jpeg format? See attachment.

 

 Also is there a way to set the LED boolean lights to stay on for lets say 0.5 of a sec?

 

Thank you so much 

0 Kudos
Message 1 of 15
(3,888 Views)

I have made some changes to clean things up and make your code a little better.

 

The shift registers -- leave separation between single SR, otherwise they look stacked which doesn't change the functionality, but in the mind of anyone else looking at your code, will appear to be stacked SRs.

Feedback node--use the iteration terminal if you want to count the loop iterations.  What's the purpose behind this?

Case structure (Peak Detect Enable)--Use the Select function to switch between two different values.  The case will work, but this is cleaner.

The stop button--I assume this is for testing purposes only?  In your final version, you will want a way to exit the loop gracefully, rather than a hard stop from the operator.  Or is this a separate dialog that will open to the user?

 

I added code to your buzzer/LED section of code to only work on the 5th multiple of testing.  See if this will work for you.

-----------------------------------------------------------------------------------------
Reese, (former CLAD, future CLD)

Some people call me the Space Cowboy!
Some call me the gangster of love.
Some people call me MoReese!
...I'm right here baby, right here, right here, right here at home
0 Kudos
Message 2 of 15
(3,883 Views)

Hi MoReese,

 

Could you send me the vi for version 9? As I cannot open your attactment.

The purpose of the vi is to provide real-time (biofeedback) to runners while they are running continously on a treadmill. The feedback is based on peak tibial accelerations (5 previous peaks), for example if the threshold is set at greater or equal to 10g then the high shock buzzer/LED boolean will come on. The aim is to get runners to reduce their peak accelerations to an acceptable level while they are running (no buzzer sound/green LED boolean). 

Also could you help me increase the LED/booleans duration once they are activated as true?

 

Thank you so much!!!!

 

Ad  

0 Kudos
Message 3 of 15
(3,879 Views)

Sorry about that.  Here you go.

-----------------------------------------------------------------------------------------
Reese, (former CLAD, future CLD)

Some people call me the Space Cowboy!
Some call me the gangster of love.
Some people call me MoReese!
...I'm right here baby, right here, right here, right here at home
0 Kudos
Message 4 of 15
(3,876 Views)

Hi Mo,

 

It still says it a version newer 10.0 vi, i have 9.0 labview.

 

Sorry about this.

 

Thanks for your support.

0 Kudos
Message 5 of 15
(3,874 Views)

Let's try it again.

-----------------------------------------------------------------------------------------
Reese, (former CLAD, future CLD)

Some people call me the Space Cowboy!
Some call me the gangster of love.
Some people call me MoReese!
...I'm right here baby, right here, right here, right here at home
0 Kudos
Message 6 of 15
(3,870 Views)

Hi Mo,

 

Yes the VI loop is working. My only concern is that I want the threshold set buzzers/LED booleans to go off at the actual 5th multiple average value rather in what I think is happening, is that the buzzers/LEDs are activating on the multiple change of 5th value above the set threshold. For example the high shock threshold is set greater than 10g, then the buzzer/LED is activating once 5 values are above 10g.  Can you change this to make the thresholds go off at the 5th multiple change of the average value?

 

I wish i could be you a drink in return!

 

Thank you so much 

0 Kudos
Message 7 of 15
(3,860 Views)

Here.  I only changed the Equal to Zero funtion to Not-Equal to Zero so that the LEDs should turn off when the iteration is a multiple of 5.  I believe the logic is correct.  I also included an elapsed time counter to keep the LEDs on for 1/2 sec.  Your VI is broken, so I could not test it in your application, but this might give you an idea of how the Elapsed Timer works; however, it sounds like you want the LEDs to turn off every 5th cycle, in which case you may not need the timer.

-----------------------------------------------------------------------------------------
Reese, (former CLAD, future CLD)

Some people call me the Space Cowboy!
Some call me the gangster of love.
Some people call me MoReese!
...I'm right here baby, right here, right here, right here at home
0 Kudos
Message 8 of 15
(3,850 Views)

Hi Mo,

 

The VI you created seems to be using the 5th multiple of each iteration of the wire loop surrounding the whole code. What i want is to enable the 5 multiple change from the moving average (labelled SHOCK RATING AVERAGE 5 PEAK VALUE) . So somehow i would like to be able to connect your iteration  rule to the average iteration change rather than the wire loop streamed data iteration. The beeps/LEDs are activating off at every peak acceleration (see bitmap for the example of data being streamed in). Can you do this?

 

Thanks again

 

Adam

 

0 Kudos
Message 9 of 15
(3,825 Views)

Hi Mo,

 

Just had a quick idea. Could i create a type of node from the shock rating indicator and run track loop off that, then implement this into the buzzer/LED threshold examples?

 

Ad 

0 Kudos
Message 10 of 15
(3,823 Views)