Chief Delphi

Chief Delphi (http://www.chiefdelphi.com/forums/index.php)
-   NI LabVIEW (http://www.chiefdelphi.com/forums/forumdisplay.php?f=182)
-   -   Issue with Solenoid Timing. VI Included. (http://www.chiefdelphi.com/forums/showthread.php?t=82053)

robotic321 06-02-2010 17:36

Issue with Solenoid Timing. VI Included.
 
1 Attachment(s)
Hi. I made my own SubVI to shutoff a solenoid after X amount of time, problem is, the robot stops for X amount of time. What i want to do is to set a solenoid to on/ off if its off already, but if its on, wait 0.5 secs and then shut it off for 1.5 secs. Can anyone help me achieve this without turning off the robot for X amount of time?

Joe Ross 06-02-2010 18:39

Re: Issue with Solenoid Timing. VI Included.
 
Your VI looks reasonable to me. How are you calling it?

robotic321 08-02-2010 12:11

Re: Issue with Solenoid Timing. VI Included.
 
Yes. Should i post the teleop vi too since it is where my VI is?

robotic321 11-02-2010 14:47

Re: Issue with Solenoid Timing. VI Included.
 
Bump..Please assist in this matter. 1793 will greatly aprreciate it.

OSU_Springer 11-02-2010 15:17

Re: Issue with Solenoid Timing. VI Included.
 
I'm guessing, since you have your timed sequence built within your teleop, what is happening is that your teleop VI gets to the timed sequence and executes that loop. The problem is, while the loop is executing, the system never runs another iteration until that loop is done. That being said, what you need to do is move the timed sequence outside of the teleop vi. You will have to pull information from either the periodic tasks from main.vi, or have some way to pull time data from the cRio and compare the start time of the solenoid to the current time, and based on that have the solenoid go false if the time is greater than the period you're looking for.

Hope this is helpful.

Ziaholic 11-02-2010 16:19

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.


All times are GMT -5. The time now is 11:55.

Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi