Go to Post The world is run by those who show up. - AdamHeard [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 30-01-2013, 23:01
chriz4gx chriz4gx is offline
Registered User
AKA: Christopher Villar
FRC #2871 (Beantown Botz)
Team Role: Programmer
 
Join Date: Jan 2013
Rookie Year: 2012
Location: Boston,MA
Posts: 45
chriz4gx is an unknown quantity at this point
Programming Window Motor with Timer

How would I go about programming a window motor to run for only a certain amount of time. To be more specific I'm trying to make it that when you click a button, it turns on that window motor for a certain amount of time like 1 second then it shuts off, and if I were to hold this button down then the window motor would just keep running. Please provide a example if you have one. Thxs in advance
Reply With Quote
  #2   Spotlight this post!  
Unread 30-01-2013, 23:35
Alan Anderson's Avatar
Alan Anderson Alan Anderson is offline
Software Architect
FRC #0045 (TechnoKats)
Team Role: Mentor
 
Join Date: Feb 2004
Rookie Year: 2004
Location: Kokomo, Indiana
Posts: 9,113
Alan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond repute
Re: Programming Window Motor with Timer

Do it in two parts. The first part is to read the button, and whenever the button is pressed set a value to be one second in the future. Leave the value alone when the button is not pressed. The second part is to compare the current time to that value, turn on the motor whenever the value is in the future, and turn off the motor whenever the value is in the past.

I figure you'll have some specific questions to ask now. I'm willing to give specific answers to them. Ask away!
Reply With Quote
  #3   Spotlight this post!  
Unread 31-01-2013, 00:07
chriz4gx chriz4gx is offline
Registered User
AKA: Christopher Villar
FRC #2871 (Beantown Botz)
Team Role: Programmer
 
Join Date: Jan 2013
Rookie Year: 2012
Location: Boston,MA
Posts: 45
chriz4gx is an unknown quantity at this point
Re: Programming Window Motor with Timer

Are there any examples you can direct me to? I understand what you explained the hard part would be implementing it in Labview, since I'm still learning as I go.
Reply With Quote
  #4   Spotlight this post!  
Unread 31-01-2013, 12:13
Alan Anderson's Avatar
Alan Anderson Alan Anderson is offline
Software Architect
FRC #0045 (TechnoKats)
Team Role: Mentor
 
Join Date: Feb 2004
Rookie Year: 2004
Location: Kokomo, Indiana
Posts: 9,113
Alan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond repute
Re: Programming Window Motor with Timer

Here's an example. It's a VI snippet, so you can just drag it into a LabVIEW block diagram and it'll be live code. It's designed to drop into Teleop. Change the RefNum names to match what you opened in Begin.vi.

The motor will run when the button is pressed, and it will continue running for one second after the button is released. If that's not what you wanted, there are a couple of simple modifications that can change the behavior.
Attached Thumbnails
Click image for larger version

Name:	Motor with one-second hold.png
Views:	54
Size:	32.9 KB
ID:	13734  
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 23:00.

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