View Single Post
  #3   Spotlight this post!  
Unread 23-10-2008, 00:47
Joe Hershberger Joe Hershberger is offline
National Instruments
AKA: jhersh
FRC #2468 (Appreciate)
Team Role: Mentor
 
Join Date: Nov 2005
Rookie Year: 1997
Location: Austin, TX
Posts: 148
Joe Hershberger is a name known to allJoe Hershberger is a name known to allJoe Hershberger is a name known to allJoe Hershberger is a name known to allJoe Hershberger is a name known to allJoe Hershberger is a name known to all
Re: State machine in LabVIEW?

Quote:
Originally Posted by JBotAlan View Post
Hey,
EDIT: For that matter, how do I regulate a feedback loop to run exactly every X milliseconds?
Be warned... When you say exactly, be sure that's what you need. If you use a timed loop to do everything, you will have lots of problems. It's not like there is a turbo button on the controller and making everything on the controller high priority will keep the CPU from being lazy. Consider the timed loop to be a timer interrupt service routine. Only put the things in it that NEED to be exact... and it had better be a small amount of code.

For the general case, a simple "Wait Until Next ms Multiple" VI will do the trick. It takes into account the time that the code in the loop takes to execute and should give you a consistent loop rate.

-Joe
Reply With Quote