View Single Post
  #3   Spotlight this post!  
Unread 19-10-2010, 05:26
Greg McKaskle Greg McKaskle is offline
Registered User
FRC #2468 (Team NI & Appreciate)
 
Join Date: Apr 2008
Rookie Year: 2008
Location: Austin, TX
Posts: 4,751
Greg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond repute
Re: How do I use interrupts?

Quote:
Is it possible to use interrupts to execute a certain VI the second a microswitch is clicked?
You probably don't really mean the same second, as in within a second, but what time do you mean?

If you open the Periodic Timing VI, there is a loop that defaults to run once every 100ms and another that defaults to run every 10ms. You can add more loops or change those to run faster, if that is what you need.

As a way to bound the problem, calculate how far the thing your are measuring will move in a millisecond. Use that to scale your timing needs.

As for actually using interrupts, I didn't see an example, but it looks like you'd bundle together the Digital info for the digital channel monitoring the switch, then loop handling the interrupts as they are returned, then cleanup at the end. Determin if this is the correct transition for your digital line, or if you want to interrupt on both open and close and update the Booleans on Open accordingly. Note that the attached image doesn't have the rest of the framework or the watchdog in place and assumes that you will incorporate this into the framework.
Attached Thumbnails
Click image for larger version

Name:	Clipboard 1.png
Views:	61
Size:	11.7 KB
ID:	9359  
Reply With Quote