Go to Post "If a student CAN do it, a student SHOULD do it." - Mr. Lim [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 12-02-2012, 10:29
cilginbilgin cilginbilgin is offline
Registered User
FRC #2905
 
Join Date: Jan 2010
Location: Istanbul,Turkey
Posts: 188
cilginbilgin is a jewel in the roughcilginbilgin is a jewel in the roughcilginbilgin is a jewel in the roughcilginbilgin is a jewel in the rough
Question Re: Restricting Window Motors Number of Turn

Quote:
Originally Posted by Ether View Post
Since you're using a window motor, and it looks like you've got hard stops at each extreme, you may be able to get by without a sensor if the load on the damper is known and sufficiently consistent so you can time it properly.

We tried to figure out how to restrict window motors and we created a while loop in the timed.vi because using while loop in the teleop.vi is not recommended. Are we supposed to put the while loop in the timed vi or in which vi should we use the while loop??? Thanks in advance!!!
Reply With Quote
  #2   Spotlight this post!  
Unread 12-02-2012, 15:02
Ether's Avatar
Ether Ether is offline
systems engineer (retired)
no team
 
Join Date: Nov 2009
Rookie Year: 1969
Location: US
Posts: 8,065
Ether has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond repute
Re: Restricting Window Motors Number of Turn

Quote:
Originally Posted by cilginbilgin View Post
We tried to figure out how to restrict window motors and we created a while loop in the timed.vi because using while loop in the teleop.vi is not recommended. Are we supposed to put the while loop in the timed vi or in which vi should we use the while loop??? Thanks in advance!!!
I'm not a LabVIEW guru and I don't have LabVIEW installed here so I'm not equipped to give you LabVIEW-specific examples, but I think you want to put the equivalent of this into the periodic tasks vi:

Code:
while (1) {

if (!run_me) {sleep(20ms); continue;}

run_me= false;

doSomething;

sleep(3000ms);

doSomethingElse;

}
"run_me" is a boolean global variable. Whenever your TeleOp code sets it to "true", the code in red runs once.

The "doSomething" would be to turn your motor on. The "sleep(3000ms)" would be how long you want to leave the motor running. The "doSomethingElse" would be to turn the motor off.

The "sleep(20ms)" is there to limit how fast the code polls "run_me" while waiting for it to become true. Without the sleep, this loop would always want a slice of CPU time. That would waste resources. Make the 20ms as long as tolerable and only as short as necessary.

Perhaps a knowledgeable LabVIEW person could post a code snippet.


Last edited by Ether : 12-02-2012 at 15:07.
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 11:44.

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