Go to Post You can't lose if you submit an animation. Even if you don't win an award, your team wins by just doing it. - David Brinza [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 23-01-2015, 16:39
wt200999's Avatar
wt200999 wt200999 is offline
Texas Instruments
AKA: Will Toth
FRC #3005 (Robochargers)
Team Role: Mentor
 
Join Date: Mar 2006
Rookie Year: 2004
Location: Dallas, Texas
Posts: 323
wt200999 has much to be proud ofwt200999 has much to be proud ofwt200999 has much to be proud ofwt200999 has much to be proud ofwt200999 has much to be proud ofwt200999 has much to be proud ofwt200999 has much to be proud ofwt200999 has much to be proud ofwt200999 has much to be proud of
Send a message via MSN to wt200999
Re: Using shared variables instead of global variables

The Shared Variable is meant for sharing data over a network while hiding the network implementation. I can't speak much to the performance, but I can recommend other ways to help.

Ideally you should try to reduce the number of global variables that you use in the first place. If you are getting lost in the number of global variables that you are using, you are probably using too many. There are a number of ways to reduce the number of globals.

The easiest way would be to send a cluster using the global, instead of using single data types and multiple globals.

If you want to get into the more advanced LabVIEW topics, you can change your architecture to use other message passing schemes (Notifiers, Queues etc). Depending on your implementation, you could possibly get away with not using any global variables at all.
__________________
Programming in LabVIEW? Try VI Snippets!

FIRST LEGO League 2004 - 2005
FRC Team 870 Student 2006 - 2009
FRC Team 3005 Mentor 2013 -
Reply With Quote
  #2   Spotlight this post!  
Unread 23-01-2015, 17:00
GuyM142's Avatar
GuyM142 GuyM142 is offline
Registered User
AKA: Guy
FRC #3339 (BumbleBee)
Team Role: Mentor
 
Join Date: Jul 2013
Rookie Year: 2012
Location: Israel
Posts: 157
GuyM142 is just really niceGuyM142 is just really niceGuyM142 is just really niceGuyM142 is just really niceGuyM142 is just really nice
Re: Using shared variables instead of global variables

Quote:
Originally Posted by wt200999 View Post
The Shared Variable is meant for sharing data over a network while hiding the network implementation. I can't speak much to the performance, but I can recommend other ways to help.

Ideally you should try to reduce the number of global variables that you use in the first place. If you are getting lost in the number of global variables that you are using, you are probably using too many. There are a number of ways to reduce the number of globals.

The easiest way would be to send a cluster using the global, instead of using single data types and multiple globals.

If you want to get into the more advanced LabVIEW topics, you can change your architecture to use other message passing schemes (Notifiers, Queues etc). Depending on your implementation, you could possibly get away with not using any global variables at all.
We are working with state machines so that we have a state machine for every sub-system on the robot. for example: Tote grabbing arms
For each state machine we have commands/actions like open or close.

Then, in the Teleop.vi we send different commands to the state machines which run in parallel, based on driver's input.

*We have an enum typeDef for each state machine and for each set of actions.

for example:
the grabber state machine is in close state,
pressing button 1 sends "open" to the grabber state machine,
the grabber state machines then moves to "moving to open" state,
and when it detects it reached the target it moves to "open".

Which architecture do you recommend using?
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 08:49.

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