LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How do I count the number of current running clones of a vi?

My event idea is unnecessary complex, just add a AE to the reentrant vi that adds when started and removes when quitting, then you can check from anywhere without hassle.

/Y

G# - Award winning reference based OOP for LV, for free! - Qestit VIPM GitHub

Qestit Systems
Certified-LabVIEW-Developer
0 Kudos
Message 11 of 28
(871 Views)

If they are running in paralle, you can have a race condition when they terminate. You will need an action engine of some sort to do it correctly.

0 Kudos
Message 12 of 28
(866 Views)

Hi 

--------------------------------------------------------------------------------------------------------
Kudos are always welcome if you got solution to some extent.

I need my difficulties because they are necessary to enjoy my success.
--Ranjeet
0 Kudos
Message 13 of 28
(847 Views)

Hi Yamaeda

                            What do you mean by "Start and Quit-event". How you are implementing this

--------------------------------------------------------------------------------------------------------
Kudos are always welcome if you got solution to some extent.

I need my difficulties because they are necessary to enjoy my success.
--Ranjeet
0 Kudos
Message 14 of 28
(847 Views)

@Ranjeet_Singh wrote:

Hi @Yamaeda

                            What do you mean by "Start and Quit-event". How you are implementing this


My guess would be by user events in the clones.

 

Now back to the topic at hand- How many clones of a vi are running in an app instance?  DETT should provide the trace if you need it.

 

My previous post should find the number dynamically (untested)

 

The BIG question is why you would want to know?  You told LabVIEW to launch as many clones as are needed by preallocating clones.  As many as are needed are running,- No more, No less.  The exact number is trivia that LabVIEW can manage very well, as you requested, thank you. 

 

You may very well have a use case I haven't thought of but, perhaps if we knew why, we could solve the need with other mechanisms (assuming is clone? does not work for your needs)


"Should be" isn't "Is" -Jay
0 Kudos
Message 15 of 28
(839 Views)

I dont want to know but mlwarren wants to know. But according to me this is perfect question becasue may be this is required in their project and by helping them this can be good experiece for us also. We dont know what environment you, me or mlwarren is working so we can never know what is good or bad for them.

 

Sometimes we not told labview how many clones needs to be created instead this will be created dynamically as per the requirement.

 

 

--------------------------------------------------------------------------------------------------------
Kudos are always welcome if you got solution to some extent.

I need my difficulties because they are necessary to enjoy my success.
--Ranjeet
0 Kudos
Message 16 of 28
(834 Views)

@Ranjeet_Singh wrote:

I dont want to know but @mlwarren wants to know. But according to me this is perfect question becasue may be this is required in their project and by helping them this can be good experiece for us also. We dont know what environment you, me or @mlwarren is working so we can never know what is good or bad for them.

 

Sometimes we not told labview how many clones needs to be created instead this will be created dynamically as per the requirement.

 

 


Ranjeet

I understand.  The source and reasoning of the requirement may suggest a solution.  Thats why I asked the leading question,"Why do you want to know after asking LabVIEW to manage it for you?"   Don't get defensive.  You contributions are appreciated.


"Should be" isn't "Is" -Jay
0 Kudos
Message 17 of 28
(831 Views)

Hi 

                                 Friend sorry i though in other way and by the way it was kind of defensive only Smiley Very HappySmiley Wink

--------------------------------------------------------------------------------------------------------
Kudos are always welcome if you got solution to some extent.

I need my difficulties because they are necessary to enjoy my success.
--Ranjeet
Message 18 of 28
(824 Views)

@JÞB wrote:

 

My previous post should find the number dynamically (untested)


I didn't test either, but I'm pretty sure that clones (or at least dynamic clones) are not returned by the All VIs property.


___________________
Try to take over the world!
0 Kudos
Message 19 of 28
(816 Views)

@Ranjeet_Singh wrote:


Logging them at creation time will only work if you do it before you run the VI and it won't help when the VI stops and you have to remove the VI from the list. If you find it more convenient to work with DBs, then go ahead and do that (although I think it's a bad idea for something like this). Just be aware that updating a DB by reading-processing-writing will create a race condition unless you can absolutely guarantee that there is only one client doing it at any one time. That's one of the reasons people use transactions or stored procedures.

 

As for FGVs, you don't have to use them (although it tends to be helpful to be well versed in commonly used techniques). There are other ways that this could be solved without using a DB.


___________________
Try to take over the world!
0 Kudos
Message 20 of 28
(814 Views)