Go to Post (OK, now that I have said this, just watch someone like Kevin Watson have a working solution by this Friday... :yikes: ) - dlavery [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 30-03-2009, 20:04
RoboMaster's Avatar
RoboMaster RoboMaster is offline
Alum, former programmer&co-captain
FRC #2472 (The Centurions)
Team Role: Mentor
 
Join Date: Apr 2008
Rookie Year: 2008
Location: Minnesota, Twin Cities
Posts: 268
RoboMaster has a brilliant futureRoboMaster has a brilliant futureRoboMaster has a brilliant futureRoboMaster has a brilliant futureRoboMaster has a brilliant futureRoboMaster has a brilliant futureRoboMaster has a brilliant futureRoboMaster has a brilliant futureRoboMaster has a brilliant futureRoboMaster has a brilliant futureRoboMaster has a brilliant future
How can you make "instances" of a subVI in LabVIEW when it is used repeatedly?

I posted this this question that I have at ni.com/first, which is National Instrument's FIRST community; pretty much like a forum. It's a great resource and if you haven't heard of it, may you be shamed . Anyways, you can reply there or here, I don't care. Here's the link to that post; if you have this same question, people's answers over there will probably be helpfull too: http://decibel.ni.com/content/message/4811

Here is my copied question:
The other programmers on my team and I would like to know how to create/use "instances" of a subVI in LabVIEW (this is the programming term that is used by the other programmers, to which I am new to). If we could have someone direct us to where we can find out about this or explain it to us personally, that would be much appreciated. Let me describe our situation to explain better.

We have implemented acceleration control and traction control on each of our 4 wheel motors. This requires that we run a joystick/encoder/constant value into a bunch of code to get our motor value. Since it's big and bulky and the same oporation for each motor, we made a subVI for this section of code. We used the "select VI" option in the palete of the block diagram to insert this subVI into our main VI four times, one subVI for each motor. But when we tried out our code, the VI was calling up the same exact subVI file four times and was running it four times at the same time. This of course caused major problems and slowed down our robot a lot. We came up with a "duct-tape-like" solution and just make four files of the subVI and named the 4 files like "subVI", "subVI_1", "subVI_2", etc. Then we just used those four subVIs individually in our program. With our traction control section, we didn't even bother making subVIs and the guys who were working on that just coped the raw code four times (yes, that part of the code is very large).

I am pretty experiened in LabVIEW but am not as familiar with programming in general, while the other two programmers on our team are very experienced with C. They explained to me how something called "making instances" of the subVI is what needs to be done, and that LabVIEW probably has that capability to do this (like C does, supposedly), but we don't know what to do to "make it happen". This would automatically make copies of a subVI if it is used multiple times in a VI and call up those, not the same subVI simultaniously.

We would appreceate if someone could tell us how to do this. It's really late in the season and our code works, but this definitely sounds like a usefull skill to have for future years and such.
Thanks so much!
__________________
My engineering blog: noeticbrainwaves.blogspot.com

I'm not slacking, my code's compiling
...and I'm using LabVIEW

Last edited by RoboMaster : 30-03-2009 at 20:07. Reason: added a link to my post at ni.com/first
Reply With Quote
  #2   Spotlight this post!  
Unread 30-03-2009, 21:37
RyanCahoon's Avatar
RyanCahoon RyanCahoon is offline
Disassembling my prior presumptions
FRC #0766 (M-A Bears)
 
Join Date: Dec 2007
Rookie Year: 2007
Location: Mountain View
Posts: 689
RyanCahoon has a reputation beyond reputeRyanCahoon has a reputation beyond reputeRyanCahoon has a reputation beyond reputeRyanCahoon has a reputation beyond reputeRyanCahoon has a reputation beyond reputeRyanCahoon has a reputation beyond reputeRyanCahoon has a reputation beyond reputeRyanCahoon has a reputation beyond reputeRyanCahoon has a reputation beyond reputeRyanCahoon has a reputation beyond reputeRyanCahoon has a reputation beyond repute
Re: How can you make "instances" of a subVI in LabVIEW when it is used repeatedly?

As was posted there, you need to enable reentrant execution

Quote:
Originally Posted by sciencewhiz
You need to enable reentrant execution in the VI properties (go to File->VI Properties, choose the Execution category, and select the Reentrant execution and preallocate clone for each instance).

On LabVIEW RT, you won't be able to debug your VI, but it sounds like that's done already, so that should be all you have to do.

This might satisfy more the the computer science behind it: http://wiki.lavag.org/Reentrant_VI
__________________
FRC 2046, 2007-2008, Student member
FRC 1708, 2009-2012, College mentor; 2013-2014, Mentor
FRC 766, 2015-, Mentor
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

Similar Threads
Thread Thread Starter Forum Replies Last Post
Can you "flip" your robot to give you a 60" width? Beamer159 Rules/Strategy 11 09-01-2008 21:12
How do you make your compressorless system work, when all valves "bleed" air slowly? kmcclary Pneumatics 9 17-02-2007 21:01
You know Chief Delphi has to many "You know ____ when...." threads when... Mike Ciance Chit-Chat 18 01-06-2004 15:10
how tall is the ramp when in "up" and "balanced" position??? archiver 2001 1 24-06-2002 00:54


All times are GMT -5. The time now is 08:32.

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