LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

I need a loop generator

Hello folks,

I build a VI that manages the velocity control of a motor. Inside the VI I run a timed loop forever.

As my project uses 6 motors. I need to run 6 of those VIs in parallel.

Everything remains the same except for the communication channels (Tasks).
I've collected those Tasks inside an array

Is there a way of using a loop construction to generate these 6 VIs.
Hence the outer for loop needs to finish while the inner VI keeps running?

Maybe there is already some reading material available and I'm just seraching under the wrong subjects.


Phili
0 Kudos
Message 1 of 5
(2,649 Views)
Hello Phili,

I assume the 6 VIs are 6 instances of the same VI, is that right ?

If yes, I think you can save one a *.vit, VI template... I don't know exactly how it works but no doubt you will find some documentation about that in LabVIEW examples (Help >> Find examples). I have never used templates, but a co-worker of mine has and as far as I cam remember it was in doing pretty much waht you are asking for...

Hope this can help you a bit...

We have two ears and one mouth so that we can listen twice as much as we speak.

Epictetus

Antoine Chalons

0 Kudos
Message 2 of 5
(2,639 Views)
Hello TiTou,
as you expected,  all VIs are instances of the same VI.

I will look at templates then 🙂

Thank you for the hint.

Phili
0 Kudos
Message 3 of 5
(2,637 Views)
I looked at the template VIs and Call by Reference.

But I can barely belive that clipping and merging path names would be the only solution to my problem.

Additionally I found that one experiences problems using this on a RT system as the reference points to the host system.

I here is an .llb of the topic. I would like the for loop to "create" 3 instances of those 4ever vis.

How can I do that on an RT PXI system most elegantly?


Have a great weekend.
Phili
 

Message Edited by phili on 03-24-2006 10:16 AM

0 Kudos
Message 4 of 5
(2,622 Views)

I had a similar need not too long ago except I was running under Fieldpoint RT some of the time and from a Windows PC some of the time.

I learned that templates are not supported under Fieldpoint RT -- perhaps this restriction also holds for PC-based LabVIEW RT?  I ended up with 2 work-arounds:

1. Poor-man's template: I would manually perform a file copy from the "template" vi to uniquely-named instance vi's.  These simply had a numeric value appended to the base filename, just like a real template vi would have done.  Here are the pros/cons.  The file copy was VERY slow under Fieldpoint because the file system is implemented on slow flash memory.  It took many seconds to instantiate a handful of vi's through the file copy process.  This is unlikely to be a problem on a PC-based file system.  Unlike real templates, these didn't prompt you to save if you closed the front panels.  I had to manage deleting the files when done -- not a big deal, just another bit of housekeeping.  And because they were regular vi's, the front panels could be opened for interaction and monitoring of the control loops.

2. Reentrant vi.  This launched separate instances reasonably quickly.  However the front panels could not be used for interaction or monitoring.

I used technique 1 for most of the development so I could use the front panels for debug purposes.  Then I switched to technique 2 for the final app to get rid of delays when instantiating vi's.

-Kevin P.

CAUTION! New LabVIEW adopters -- it's too late for me, but you *can* save yourself. The new subscription policy for LabVIEW puts NI's hand in your wallet for the rest of your working life. Are you sure you're *that* dedicated to LabVIEW? (Summary of my reasons in this post, part of a voluminous thread of mostly complaints starting here).
0 Kudos
Message 5 of 5
(2,601 Views)