|
|
|
![]() |
|
|||||||
|
||||||||
![]() |
|
|
Thread Tools | Rate Thread | Display Modes |
|
|
|
#1
|
||||
|
||||
|
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?
|
|
#2
|
||||||
|
||||||
|
Re: Issue with Solenoid Timing. VI Included.
Your VI looks reasonable to me. How are you calling it?
|
|
#3
|
||||
|
||||
|
Yes. Should i post the teleop vi too since it is where my VI is?
|
|
#4
|
|||
|
|||
|
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. |
|
#5
|
||||
|
||||
|
Re: Issue with Solenoid Timing. VI Included.
Bump..Please assist in this matter. 1793 will greatly aprreciate it.
|
|
#6
|
||||
|
||||
|
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. |
![]() |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| solenoid with compressor vi | ElanaC | NI LabVIEW | 42 | 29-12-2010 13:38 |
| Solenoid Programming Issue. | Dr. Manhattan | Pneumatics | 2 | 10-02-2009 17:42 |
| Issue with Color Tracking Example (C/C++) and with Counters, Encoders, and Ultrasonic | BradAMiller | Programming | 3 | 19-01-2009 21:24 |
| Timing with the Driver Station | Zorkinian | Programming | 6 | 10-01-2009 09:42 |
| Playbook now included with Team 340 database | archiver | 2001 | 0 | 24-06-2002 01:33 |