04-11-2012 10:58 PM
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!
04-12-2012 12:07 AM
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.?
04-12-2012 12:16 AM
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.
04-12-2012 12:39 AM
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?
04-12-2012 11:21 AM
@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.
04-12-2012 11:53 AM
04-12-2012 12:11 PM
@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.
.
04-12-2012 01:04 PM
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.
04-12-2012 01:14 PM
04-12-2012 01:29 PM
@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.