Go to Post Diversity means diversity in ideas too. Some of the robots from the singapore competition might have employed strategies or ideas that we may not even have come up with in North America. - J Flex 188 [more]
Home
Go Back   Chief Delphi > Technical > Programming > NI LabVIEW
CD-Media   CD-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
Reply
 
Thread Tools Rate Thread Display Modes
  #1   Spotlight this post!  
Unread 11-02-2011, 06:51
Itamar's Avatar
Itamar Itamar is offline
Registered User
FRC #1943 (NeatTeam) & FRC #4590 (GreenBlitz)
Team Role: Mentor
 
Join Date: Jan 2010
Rookie Year: 2010
Location: Israel
Posts: 83
Itamar is an unknown quantity at this point
Event listening for a counter.

Hey.
I read for the past few days about interrupts, events and counters.
All I want to do is hook an interrupt\event to a counter, so that a certain VI is called the moment the counter's value changes?

Is this even possible?

Thanks
Itamar.
Reply With Quote
  #2   Spotlight this post!  
Unread 11-02-2011, 09:58
Joe Ross's Avatar Unsung FIRST Hero
Joe Ross Joe Ross is offline
Registered User
FRC #0330 (Beachbots)
Team Role: Engineer
 
Join Date: Jun 2001
Rookie Year: 1997
Location: Los Angeles, CA
Posts: 8,563
Joe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond repute
Re: Event listening for a counter.

There are probably a lot more efficient ways to do what you want. What is the high level task you are trying to accomplish?
Reply With Quote
  #3   Spotlight this post!  
Unread 11-02-2011, 20:10
Itamar's Avatar
Itamar Itamar is offline
Registered User
FRC #1943 (NeatTeam) & FRC #4590 (GreenBlitz)
Team Role: Mentor
 
Join Date: Jan 2010
Rookie Year: 2010
Location: Israel
Posts: 83
Itamar is an unknown quantity at this point
Re: Event listening for a counter.

more efficient?
I don't believe explaining the algorithm is neccessery right now. Basically, I would like to stop a motor from running the moment a microswitch is clicked.
This is normally a very easy task to accomplish, but my code has many other VIs to run and take care of, so I wanted to try using events of interrupts.
So this is not really about efficiency, it's more about how much time it takes for the motor to stop, and I believe that by using an event the response would be immediate.
Reply With Quote
  #4   Spotlight this post!  
Unread 12-02-2011, 00:45
jhersh jhersh is offline
National Instruments
AKA: Joe Hershberger
FRC #2468 (Appreciate)
Team Role: Mentor
 
Join Date: May 2008
Rookie Year: 1997
Location: Austin, TX
Posts: 1,006
jhersh has a reputation beyond reputejhersh has a reputation beyond reputejhersh has a reputation beyond reputejhersh has a reputation beyond reputejhersh has a reputation beyond reputejhersh has a reputation beyond reputejhersh has a reputation beyond reputejhersh has a reputation beyond reputejhersh has a reputation beyond reputejhersh has a reputation beyond reputejhersh has a reputation beyond repute
Re: Event listening for a counter.

Using a limit switch input on a Jaguar is probably the fastest way to stop a motor.

-Joe
Reply With Quote
  #5   Spotlight this post!  
Unread 12-02-2011, 01:18
WizenedEE's Avatar
WizenedEE WizenedEE is offline
Registered User
AKA: Adam
FRC #3238 (Cyborg Ferrets)
Team Role: Leadership
 
Join Date: Jan 2011
Rookie Year: 2010
Location: Anacortes, WA
Posts: 395
WizenedEE is a name known to allWizenedEE is a name known to allWizenedEE is a name known to allWizenedEE is a name known to allWizenedEE is a name known to allWizenedEE is a name known to all
Re: Event listening for a counter.

Quote:
Originally Posted by Itamar View Post
more efficient?
I don't believe explaining the algorithm is neccessery right now. Basically, I would like to stop a motor from running the moment a microswitch is clicked.
This is normally a very easy task to accomplish, but my code has many other VIs to run and take care of, so I wanted to try using events of interrupts.
So this is not really about efficiency, it's more about how much time it takes for the motor to stop, and I believe that by using an event the response would be immediate.
With parallel loops, it doesn't have to run all the code before going onto the next loop, which would provide fast stopping for the motor. Just put the speeds of the motors in a global variable and ship it over to periodic tasks. You can also read the sensor in periodic tasks.

And yes, if your switch is normally closed, wiring it straight up to the jaguars is much easier (and safer!) assuming you don't ever want to go past the limit switch (it is limiting...)
Reply With Quote
  #6   Spotlight this post!  
Unread 14-02-2011, 14:08
Itamar's Avatar
Itamar Itamar is offline
Registered User
FRC #1943 (NeatTeam) & FRC #4590 (GreenBlitz)
Team Role: Mentor
 
Join Date: Jan 2010
Rookie Year: 2010
Location: Israel
Posts: 83
Itamar is an unknown quantity at this point
Re: Event listening for a counter.

After reading your post I tried using parallel loops and it works better, but I still can't shake the feeling it would work much better if I used events.
Interrupts and events are used all the time. are you telling me it is impossible to perform in LabVIEW? Doesn't make much sense.
Reply With Quote
  #7   Spotlight this post!  
Unread 14-02-2011, 14:15
jhersh jhersh is offline
National Instruments
AKA: Joe Hershberger
FRC #2468 (Appreciate)
Team Role: Mentor
 
Join Date: May 2008
Rookie Year: 1997
Location: Austin, TX
Posts: 1,006
jhersh has a reputation beyond reputejhersh has a reputation beyond reputejhersh has a reputation beyond reputejhersh has a reputation beyond reputejhersh has a reputation beyond reputejhersh has a reputation beyond reputejhersh has a reputation beyond reputejhersh has a reputation beyond reputejhersh has a reputation beyond reputejhersh has a reputation beyond reputejhersh has a reputation beyond repute
Re: Event listening for a counter.

Quote:
Originally Posted by Itamar View Post
After reading your post I tried using parallel loops and it works better, but I still can't shake the feeling it would work much better if I used events.
Interrupts and events are used all the time. are you telling me it is impossible to perform in LabVIEW? Doesn't make much sense.
Using the Jaguar's limit switch inputs is the fastest available way to stop a motor and it takes no resources on the cRIO.

If for some reason you are opposed to that solution, you can use the interrupt palette in LabVIEW to connect an interrupt directly to the digital input that your switch is connected to. You then put a separate parallel loop waiting for the interrupt to occur. Then do what you need to when it stops waiting.

There is an example for how to use interrupts in LabVIEW. Look at that first.

-Joe
Reply With Quote
  #8   Spotlight this post!  
Unread 14-02-2011, 14:21
Mark McLeod's Avatar
Mark McLeod Mark McLeod is online now
Just Itinerant
AKA: Hey dad...Father...MARK
FRC #0358 (Robotic Eagles)
Team Role: Engineer
 
Join Date: Mar 2003
Rookie Year: 2002
Location: Hauppauge, Long Island, NY
Posts: 8,795
Mark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond repute
Re: Event listening for a counter.

The LabVIEW interrupt vi palette is at:
WPI Robotics Library -> Utilities -> Interrupts
__________________
"Rationality is our distinguishing characteristic - it's what sets us apart from the beasts." - Aristotle
Reply With Quote
  #9   Spotlight this post!  
Unread 14-02-2011, 21:35
Itamar's Avatar
Itamar Itamar is offline
Registered User
FRC #1943 (NeatTeam) & FRC #4590 (GreenBlitz)
Team Role: Mentor
 
Join Date: Jan 2010
Rookie Year: 2010
Location: Israel
Posts: 83
Itamar is an unknown quantity at this point
Re: Event listening for a counter.

I managed to use the Interrupt vis, but came across a problem.
My algorithm is consisted of two digital inputs, each performs half of the process. Firstly I used an interrupt to have immediate responses to the first digial input. it worked great. but when I added a second interrupt for the second digital input, not only that the new interrupt didn't work, it stopped the old one from working.

Any ideas what could cause this? Is there an interrupt-limit I'm not aware of?
Reply With Quote
  #10   Spotlight this post!  
Unread 15-02-2011, 18:56
jhersh jhersh is offline
National Instruments
AKA: Joe Hershberger
FRC #2468 (Appreciate)
Team Role: Mentor
 
Join Date: May 2008
Rookie Year: 1997
Location: Austin, TX
Posts: 1,006
jhersh has a reputation beyond reputejhersh has a reputation beyond reputejhersh has a reputation beyond reputejhersh has a reputation beyond reputejhersh has a reputation beyond reputejhersh has a reputation beyond reputejhersh has a reputation beyond reputejhersh has a reputation beyond reputejhersh has a reputation beyond reputejhersh has a reputation beyond reputejhersh has a reputation beyond repute
Re: Event listening for a counter.

There is a limit of 8 interrupt inputs.

Perhaps you are putting the wait for both of your inputs in the same loop. If you do that you are waiting for both inputs, not one or the other.

-Joe
Reply With Quote
Reply


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT -5. The time now is 09:23.

The Chief Delphi Forums are sponsored by Innovation First International, Inc.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi