04-08-2010 07:15 AM
Solved! Go to Solution.
04-08-2010 07:29 AM
PinkLady4128 wrote:
The case structure is as follows:
If 1: count up and if count reaches 10 then green LED on (represents muscle
active)
If 0: count up and if count reaches 10 then red LED on (represents muscle
inactive and should be exercised.)
What is the count interval? How is the count increment triggered (time ie: every second?)
My question is how could I reset the case structure to start again: i.e, If
Case=0 and the inactive time reaches 10 and RED LED comes on, I want this to then
turn off and put the count back to 0 if it switches to Case=1.
Do you want the reset to occur automatically and restart? Do you want someone to notice the RED LED? If it resets, do you want to start again but keep the RED LED on which also indicates that the motor is running?
(The idea is that this RED LED is representing a Vibrate motor (which I
will output to using DAQ). The motor will switch on as the RED LED does to indicate to
a user muscle should be exercised but I do not want the motor to be on constant, I
need it to turn off when the muscle is exercised and then restart the count again)
So while it is counting, if there is muscle movement detected, do you want the motor to stop and the RED LED to turn off?
I probably haven't explained this very well but I have attached my VI.
You forgot to attach your VI
04-08-2010 08:03 AM
What is the count interval? How is the count increment triggered (time ie: every second?)
The count is just an increment loop in the case structure. When this reaches 10 the LED comes on. But at the minute it just continues to increment all the time, never goes back to 0, and LED is on.
Do you want the reset to occur automatically and restart? Do you want someone to notice the RED LED? If it resets, do you want to start again but keep the RED LED on which also indicates that the motor is running?
I want the reset to occur when the signal goes back to a high state ( i.e. there is muscle movement)
So while it is counting, if there is muscle movement detected, do you want the motor to stop and the RED LED to turn off?
This is exactly what I want if high signal detected stop the motor and LED (The RED LED is just a representation of when the motor is on or off (they are synchronous) - I plan to output the LED state to a DAQ to give voltage to the motor)
But I would also like for the count to go back to 0 when this happens..So that if the signal goes low again it begins to count again and motor vibrates when low for 10 counts again.
I have attached the VI this time
Thanks for your time.
04-08-2010 10:09 AM
PinkLady4128 wrote:What is the count interval? How is the count increment triggered (time ie: every second?)
The count is just an increment loop in the case structure. When this reaches 10 the LED comes on. But at the minute it just continues to increment all the time, never goes back to 0, and LED is on.
What I meant was how long between each count. If each loop iteration takes 10 ms to complete, do you want the LED to light up in 100ms?
I haven't looked at the code yet, and will look at it soon.
04-08-2010 10:19 AM
04-08-2010 12:21 PM
Have a look at the attached VI. I saved it to LV8.0 because I didn't know which version you were using.
Hope I understood what you were looking for.