Go to Post Leave FIRST? That's an option? =) - treffk [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 31-01-2015, 13:49
Zephex Zephex is offline
Registered User
FRC #2213
 
Join Date: Dec 2014
Location: Israel
Posts: 2
Zephex is an unknown quantity at this point
Issues with multi-tasking




Alright, so as you guys can see in the pictures above I'm reading the values from X2 and Y2 and putting them into the motor, and I'm also using a gyro in order to stabilize the robot. Problem is, since I can't use a delay function, I'm forced to use a wave function. What I first wanted to ask is if there's a way to not use the wave function and somehow use the delay one without it stopping my enitre loop since I always have to check the values of the gyro. The second question is(if I must use the wave function) why when I'm putting 2 seconds in the frequency(Time2 box), its not actually doing the action for 2 seconds? basically what I'm trying to multitask, since I need to always check the gyro values.

Thanks in advance guys!
Reply With Quote
  #2   Spotlight this post!  
Unread 31-01-2015, 14:31
plnyyanks's Avatar
plnyyanks plnyyanks is offline
Data wins arguments.
AKA: Phil Lopreiato
FRC #1124 (The ÜberBots), FRC #2900 (The Mighty Penguins)
Team Role: College Student
 
Join Date: Apr 2010
Rookie Year: 2010
Location: NYC/Washington, DC
Posts: 1,114
plnyyanks has a reputation beyond reputeplnyyanks has a reputation beyond reputeplnyyanks has a reputation beyond reputeplnyyanks has a reputation beyond reputeplnyyanks has a reputation beyond reputeplnyyanks has a reputation beyond reputeplnyyanks has a reputation beyond reputeplnyyanks has a reputation beyond reputeplnyyanks has a reputation beyond reputeplnyyanks has a reputation beyond reputeplnyyanks has a reputation beyond repute
Re: Issues with multi-tasking

What's the reason for using a wave function?

If I understand your goals correctly, a better approach will be to, on a button press say, store the current time + your delay in a shift register, and compare the stored value to the current time every iteration. Then, you can put your deferred action into a case structure and process it there.
__________________
Phil Lopreiato - "It's a hardware problem"
Team 1124 (2010 - 2013), Team 1418 (2014), Team 2900 (2016)
FRC Notebook The Blue Alliance for Android
Reply With Quote
  #3   Spotlight this post!  
Unread 31-01-2015, 15:44
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: Issues with multi-tasking

"Multitasking", or parallel execution of independent tasks, is something that LabVIEW does without effort. However, I want to understand what you want the code to do before I give advice that might not be appropriate. Is this supposed to be part of your Autonomous?
Reply With Quote
  #4   Spotlight this post!  
Unread 01-02-2015, 09:55
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,752
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: Issues with multi-tasking

Can you tell where this code is located? If it is teleOp, I suspect you do not need a loop at all.

So a better description of where the code runs or what it is meant for will help.

Greg McKaskle
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 21:31.

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