|
|
|
![]() |
|
|||||||
|
||||||||
![]() |
| Thread Tools | Rate Thread | Display Modes |
|
#1
|
||||
|
||||
|
Hi all,
We are using pneumatics to arm our and release our kicker. I want to automate the process where once a button is pressed a cylinder is retracted (i know how to program a solenoid) to fire, then autonomously two different cylinders extend to grab the kicker and pull back to rearm the kicker. My question is how to automate the process. Thanks for any help. |
|
#2
|
||||
|
||||
|
Re: How to automate between extending and retracting of cyinders
Quote:
- ready to fire - firing - arming ... and cycle through the states. (You may need additional states for delays or limit switch events depending on your design) See the LVMastery video on state machines. ~ |
|
#3
|
|||||
|
|||||
|
Re: How to automate between extending and retracting of cyinders
If it's always going to be the same automated tasks in the same order with the same timing, and if you're never going to want to control any of the same actuators manually at the same time, there's another way to do it that might be simpler. Add a parallel task (you can put it in the Periodic Tasks vi) that consists of a never-terminating while loop. Inside that loop, use a flat sequence with each step of the process in its own frame alongside an appropriate delay. In the very first frame, put a while loop that terminates only when a global variable is set true. Set that variable false again in the very last frame. In your main code, whenever the automatic sequence is needed, set that global variable true and the parallel task will do its thing.
|
|
#4
|
||||
|
||||
|
Re: How to automate between extending and retracting of cyinders
Quote:
Greg, if you are reading, could you please comment on how the RTOS handles a parallel task which is doing nothing but cycling in a while loop waiting for a global boolean to change state? Is the RTOS smart enough to reduce that task's time slice so as not to waste processing resources? ~ |
|
#5
|
|||
|
|||
|
Re: How to automate between extending and retracting of cyinders
Quote:
As long as the number of globals used to trigger parallel tasks stays small and the polling rate is kept in check, I feel OK recommending their use, but they are certainly not the best notification mechanism. Once you are looking for something new to learn, feel free to look at the other notification mechanisms. The RT FIFO gives lots of control and is the more deterministic choice. Others include the Notifier, Semaphore, Rendezvous, Queue, and the Occurrence. These provide non-polling, more event-driven mechanisms to coordinate multiple tasks. Greg McKaskle |
|
#6
|
|||||
|
|||||
|
Re: How to automate between extending and retracting of cyinders
An Occurrence would be a much better choice than a continuously-polled global variable. There are a few reasonable ways to create it and pass it to both Teleop and the sequence task; I would probably create it in Begin and wire it to a global variable for use elsewhere.
|
![]() |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Retracting a cylinder? | greatman05 | Pneumatics | 5 | 11-02-2010 15:24 |
| Data delay between Crio and DS | Tom Line | NI LabVIEW | 9 | 17-02-2009 08:40 |
| how to generate P.W.M pulse between 0-100 d.c | yossi56 | Programming | 3 | 01-03-2008 14:15 |
| How do I get distance between Camera and the target? | sjung9442 | Programming | 5 | 27-01-2006 09:44 |
| Retracting power wiring ? | mdatkins | Electrical | 5 | 09-02-2005 07:50 |