View Single Post
  #6   Spotlight this post!  
Unread 11-02-2010, 16:19
Ziaholic's Avatar
Ziaholic Ziaholic is offline
Elec/SW Mentor
AKA: Marc
FRC #1164 (Project NEO)
Team Role: Mentor
 
Join Date: Jan 2008
Rookie Year: 2002
Location: Las Cruces, NM
Posts: 194
Ziaholic is a jewel in the roughZiaholic is a jewel in the roughZiaholic is a jewel in the roughZiaholic is a jewel in the rough
Re: Issue with Solenoid Timing. VI Included.

I'm at work and don't have access to your VI.

Does your VI have either a shift-register or a feedback node? In order to perform tasks that take longer than a standard loop-time (20 msec), you have to insert loop-to-loop memory. Typically this is done with a shift register.

When you enter the first state, you capture the current time, add an offset (your 0.5 or 1.5 seconds become 500 or 1500 msec) and store that in the shift register. Then, every time through the loop, you look at the current time, compare it to the stored/offset time, and once you exceed the timer, you exit the state and enter into the new state on the next go-round.

I posted a somewhat-related example in another thread ... (clicky) ... I have a couple diagrams in post #11 that show a 30 msec example ... and there are other posts above and below mine that also have some good advice when performing timed tasks.

G/L.
__________________
----
There are 10 types of people. Those who understand binary, and those that do not.
Team #1164 - Project NEO Robotics
Reply With Quote