View Single Post
  #3   Spotlight this post!  
Unread 25-10-2015, 10:34
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,748
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: Autonomous Independent Cluster Input

Parallel operations cannot share data through synchronized data flow wires. If they did, they'd no longer be parallel and independent.

So there are a number of additional language constructs in LabVIEW to support the sharing of data when in a parallel, non-sequential situation. The easiest to use, and the one the framework suggests in the attached comment, is the variable. In this case, the global variable. Write to it in the Vision loop and read from it in the auto loop and it probably does what you need. The only additional consideration you may want is to initialize it so that things don't misbehave if vision is removed or failing to function how it is supposed to.

Just to look at alternatives.

When you do not want to miss a value, you may want to use a queue. Vision would enqueue information, and autonomous would dequeue and process it. Because the information in the queue can get stale pretty quickly, I don't think a queue is a good idea.

When you want a more event-driven form of execution, you may want to use a notifier. This is a special form of single-element-queue with overwrite. The vision loop would post a notification to auto when it sees something, and the auto would automatically sleep until something is posted.

Other data sharing mechanisms exist as well, and the functional global lets you build your own that are custom suited to your task.

But in the case of vision and auto, a simple global variable is really pretty good approach.

Greg McKaskle
Attached Thumbnails
Click image for larger version

Name:	From Clipboard 2.png
Views:	15
Size:	39.1 KB
ID:	19372  
Reply With Quote