Go to Post Let me live in my delusional world where minibots never happened and the Tetrix kit doesn't exist. - Andrew Schreiber [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 10-01-2012, 13:56
mbone206 mbone206 is offline
Registered User
FRC #0223
 
Join Date: Jan 2009
Location: New Jersey
Posts: 59
mbone206 is an unknown quantity at this point
Robot Global Data VI -- organizing separate cluster/data type

I would like to organize my Global variables that can be better, making future changes and sharing with other programmers cleaner. So, for certain task/control systems I decided to create a cluster for each on Robot Global, ie.. Cluster for Accelerator controls/indicators, robot arm controls system, ect...

I am having trouble modifying/using these clusters. I am not sure if I am doing it correct? Also, do I make clusters in Robot Global VI a type def, strict type def? If yes, how?

Can someone assist how you arrange / organize you Global Variables? Easy to read, share, modify further down the road?

Thanx
Mark
Reply With Quote
  #2   Spotlight this post!  
Unread 10-01-2012, 14:06
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: Robot Global Data VI -- organizing separate cluster/data type

The key to having the SW adapt to type changes is to use a typedef or strict typedef.

Strict Typedef: any modification to the control definition is propagated (including visual styling, color, etc.)
Typedef: datatype changes are propagated (color, size, style is ignored)
Neither: no automatic updates, no master definition file.

A global is simply the storage, and can be any of the above. The read and write to the global will always update, but data flowing through the connectors to subVIs and types that you want to match will be more convenient using typedefs.

Clusters group the data values together and guarantee that all values are read or written at the same time. If you group elements that update at different rates or locations in the program, you can actually make it more difficult by grouping them into a cluster.

So, in summary, these three distinct features are for somewhat uses. I think you are probably more interested in using typedefs than the others.

Greg McKaskle
Reply With Quote
  #3   Spotlight this post!  
Unread 10-01-2012, 14:40
mbone206 mbone206 is offline
Registered User
FRC #0223
 
Join Date: Jan 2009
Location: New Jersey
Posts: 59
mbone206 is an unknown quantity at this point
Re: Robot Global Data VI -- organizing separate cluster/data type

Thanx Greg

Sounds like it will not be a good ideal creating clusters in Global VI.... Correct

So, when will be the correct time creating type def? Maybe when using a state machine?


Mark
Reply With Quote
  #4   Spotlight this post!  
Unread 10-01-2012, 15:39
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: Robot Global Data VI -- organizing separate cluster/data type

There is very little overhead for using a typedef. For debugging purposes, I believe that the files are actually downloaded sometimes, but it is a matter of choice and development habits. There is a small time cost to making typedefs, but as your code evolves, most of those will be smoother if you use a typedef than if you did not.

My own habits are to use typedefs when it is code I intend to keep, but if I'm doing a quick prototype I will not. If that prototype turns out really well and I'm going to keep it, then making the typedefs is an easy step.

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 20:48.

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