LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Naming Timed Loops in Re-entrant VIs

Hey there,

 

Just a quick question regarding naming timed loops in re-entrant VIs.

 

Is this required if the structure name is never used (eg. synchronising etc, aborting etc.) ie. is the structure name critical for basic timed loop operation?

Just wondering if I can save on some logic in the SubVI to generate the names.

 

Thanks!

0 Kudos
Message 1 of 15
(4,106 Views)

Am not able to understand your question. Naming Timed loops in Re-entrant vi's?. What does it mean are you talking about the label of the timed loop or the vi name that contains timed loop.?

-----

The best solution is the one you find it by yourself
0 Kudos
Message 2 of 15
(4,102 Views)

Thanks for your reply.

 

By timed loop name I'm refer to the Structure Name. Normally Labview generates a random one when a loop is placed.

 

I was wondering whether using a Timed Loop (with this auto name) in a re-entrant SubVI would cause any issues or unexpected behaviour ie. is the Structure name critical for any operation besides being able to reference the structure for functions such as synchronsing or external aborting.

0 Kudos
Message 3 of 15
(4,100 Views)

Its not a random name it will have a default name and will add numbers if you place more than one. But I don't think keeping a timed loop inside a re-entrant vi is a right way. Later you may have undesirable effect if you have more than one instance of that vi. what exactly you want to achieve by using timed loop in a clone vi?

-----

The best solution is the one you find it by yourself
0 Kudos
Message 4 of 15
(4,096 Views)

@P Anand wrote:

Its not a random name it will have a default name and will add numbers if you place more than one. But I don't think keeping a timed loop inside a re-entrant vi is a right way. Later you may have undesirable effect if you have more than one instance of that vi. what exactly you want to achieve by using timed loop in a clone vi?


Have you looked at a timed loop?  There is, in fact, a random name assigned to each timed structure.  It may not be visible anywhere except the loop configuration dialog, but it's there.  Also, your statement doesn't make much sense.  Why would you expect that a timed loop inside a reentrant VI would cause any more problems than running two timed loops in a parallel in two non-reentrant VIs?

 

I haven't tested it, but I doubt there's any problem putting a timed loop inside a reentrant VI.

0 Kudos
Message 5 of 15
(4,079 Views)
I have tried to use a timed loop in a vit which spawns multiple instances at run time. The loops all get the same name and this crashed LabVIEW in my case. I found no fix for this behaviour so I sacrificed the timed loop and used a while loop instead. I would be interested in other users experiences.
Michael.
Message 6 of 15
(4,073 Views)

@nathand wrote:

@P Anand wrote:

Its not a random name it will have a default name and will add numbers if you place more than one. But I don't think keeping a timed loop inside a re-entrant vi is a right way. Later you may have undesirable effect if you have more than one instance of that vi. what exactly you want to achieve by using timed loop in a clone vi?


Have you looked at a timed loop?  There is, in fact, a random name assigned to each timed structure.  It may not be visible anywhere except the loop configuration dialog, but it's there.  Also, your statement doesn't make much sense.  Why would you expect that a timed loop inside a reentrant VI would cause any more problems than running two timed loops in a parallel in two non-reentrant VIs?

 

I haven't tested it, but I doubt there's any problem putting a timed loop inside a reentrant VI.


Ofcourse YES.. Differentiate While loop and Timed loop and use it sensibly .  If you are making it as a clone can you gaurentiee that more than two instances will not be created at any time ?. what is the purpose you got to use a timed loop inside a clone vi ? Testing a timed loop inside a re-entrant vi doesn't make any sense make an application and prove it that the timed loop is better than normal while loop in a re-entrant vi. Smiley Mad
.

-----

The best solution is the one you find it by yourself
0 Kudos
Message 7 of 15
(4,066 Views)

I just tested this: simple shared-clones reentrant VI, containing only a timed loop and an indicator on the iteration counter, set so the front panel opens when running.  I put two instances on the block diagram of another VI and ran it in LabVIEW 2011.  No crash, works exactly as expected.  I'm attaching the VIs.

 

Rivers Daddy - out of curiousity, in which version of LabVIEW was this?  Have you tried using VIs instead of VITs?  It's now possible to use reentrant VIs instead of VITs in most cases.

 

P Anand - there are lots of things you can do with a timed loop that you can't do with a normal while loop, such as using a specific timing source.  Why should you not do this inside a reentrant VI?  I wasn't trying to argue it's better or worse, just that your statement that it was a bad idea seemed a bit dismissive when you don't know what the user's application is and provided little explanation for your position.

 

Download All
0 Kudos
Message 8 of 15
(4,051 Views)
I never complain that it's bad to use timed loop inside a clone my only point was that what is the exact need to use it. Generally timed loops we use to have it in time critical applications for the rest we normaly use while loop. And also I am not against timed loop but without the exact need of timed loop I normally won't go for it and also I always try to give simple solution to the user.
-----

The best solution is the one you find it by yourself
0 Kudos
Message 9 of 15
(4,045 Views)

@nathand wrote:

I just tested this: simple shared-clones reentrant VI, containing only a timed loop and an indicator on the iteration counter, set so the front panel opens when running.  I put two instances on the block diagram of another VI and ran it in LabVIEW 2011.  No crash, works exactly as expected.  I'm attaching the VIs.


Seems fine when opening multiple references with Open VI Reference and using the Run VI method, too.

0 Kudos
Message 10 of 15
(4,039 Views)