![]() |
2010 FRC LabVIEW framework architecture questions
1) What does the "execute" case of Teleop do if it overruns?
- ignore (drop) new DS packet and keep executing the current iteration? - queue the new packet for immediate execution as soon as the current iteration finishes? - abort and re-start with new packet data? - re-enter? - something else? Is an error message given? 2) same questions, but for Autonomous Iterative 3) Are the "Periodic Tasks" preemptive and rate monotonic? ie if a 100ms task takes 60ms to run, that does not interfere with a 40 ms task, right? How are overruns handled in the Periodic Tasks? Can a Periodic task be faster than 20ms? If so, I assume it can interrupt the "Teleop execute" code, right? ~ |
Re: 2010 FRC LabVIEW framework architecture questions
I've marked my responses with **s.
1) What does the "execute" case of Teleop do if it overruns? - ignore (drop) new DS packet and keep executing the current iteration? ** By default, this is the behavior. Once finished, it will wait for the next packet arrival. ... Is an error message given? ** Not unless the code lasts long enough to get a watchdog error. 2) same questions, but for Autonomous Iterative ** Same answer, in fact the same code schedules both. 3) Are the "Periodic Tasks" preemptive and rate monotonic? ie if a 100ms task takes 60ms to run, that does not interfere with a 40 ms task, right? How are overruns handled in the Periodic Tasks? Can a Periodic task be faster than 20ms? If so, I assume it can interrupt the "Teleop execute" code, right? ** Since the loops are scheduled to a pool of OS threads, that is most likely implementation. The normal loops will have the same scheduling activity as the same-priority threads within the OS. Ditto, since the framework defaults to having the periodic, vision, and teleop tasks run at the same priority, the scheduling is the same as same priority OS threads. Greg McKaskle |
Re: 2010 FRC LabVIEW framework architecture questions
Quote:
~ |
Re: 2010 FRC LabVIEW framework architecture questions
Hi Greg,
Take a look at this post: http://www.chiefdelphi.com/forums/sh...d.php?p=923860 What would be the proper way to set this up? Set up a "Periodic Task" running at 5ms (200Hz) to grab accelerometer data? I wonder how much code the VI would generate for this seemingly simple task? This task would obviously have to preempt Teleop execute in order to run properly. I would think that the 5ms task would contain a ring buffer to hold the 10 samples, and that's all it would do (to keep it short). Then, a 20ms task would grab a copy of the ring buffer and do the averaging and other calculations. Instead of a separate 20ms Periodic Task, should this be coded directly in Teleop execute? What special precautions does the LabVIEW programmer need to take, to assure that the 5ms task is not writing data to the ring buffer while the 20ms task is attempting to read it? Or is that all handled automagically by the LabVIEW compiler and the RTOS? ~ |
Re: 2010 FRC LabVIEW framework architecture questions
Quote:
Greg McKaskle |
Re: 2010 FRC LabVIEW framework architecture questions
Quote:
If you really want to read the accelerometer with the best timing, you set up a DMA channel to implement the ring or buffer. You can then run your acquisition on multiple channels at 5kHz or so. The RT loop can then do the processing on the buffer. To the other question, value updates and data transfers are atomic, and that includes arrays, clusters, etc. I wouldn't necessarily say it is automagic, but it is certainly nice, especially when you like correct answers. Greg McKaskle |
Re: 2010 FRC LabVIEW framework architecture questions
Quote:
~ |
Re: 2010 FRC LabVIEW framework architecture questions
Quote:
~ |
Re: 2010 FRC LabVIEW framework architecture questions
Quote:
Quote:
Note that the timed loop structure is a special case in all of this since internally it implements its own scheduling and determines what to expose to the system scheduler. Greg McKaskle |
| All times are GMT -5. The time now is 11:04. |
Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi