LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

GOOP QUESTION

Hi,
I've a question about GOOP.
I've an array of Objects refs but i don't know its size until runtime;
these objects own to a class that has a method called Run, which is a
continuos loop.
In a main VI I'd like to launch this method for each object in the
array.
The problem is that the run method, obviously, doesn't terminate so,
for exaple, if i use a for loop with autoindexing and i put the array
outside the loop and the run method inside, this loop only execute the
first iteration waiting for the "run vi" to stop. I've tried to set
the run method as reentrant, but this didn't solve the problem.
Do you have any suggestions?

Thanks in advance,
Luca Tascedda
0 Kudos
Message 1 of 5
(2,456 Views)
Hi Luca

I do not have much GOOP experience, but using VI-server it is easy to open a VI reference and execute VIs without waiting for the individual VIs to finish.
See attached zipfile. All VIs should reside in the same directory.
I would think that you can find something like this in GOOP.

Regards
M ;o)
0 Kudos
Message 2 of 5
(2,456 Views)
Thank you for your answer michael...i'll try to work at it!
Does anyone know a general solution in goop that avoids using the vi server? I think this problem is very common, because active objects are fundamental in oo programming of real-time systems.
0 Kudos
Message 3 of 5
(2,456 Views)
> Thank you for your answer michael...i'll try to work at it!
> Does anyone know a general solution in goop that avoids using the vi
> server? I think this problem is very common, because active objects
> are fundamental in oo programming of real-time systems.

If you were to do this in most other languages, you would somehow spin
up a thread. One way to do this in LV is to have a parallel loop that
keeps running as long as the object is active. This is easy for a
static number of object instances, like singletons, but not good for
dynamic number. In those cases, the correct approach is to use the VI
Server. You are using it to dymanically get an instance to a reentrant
VI, not necessarily having anything to do with remote execution
or
communication with another computer. Ideally, you will wrap the VI
Server implementation inside of a method for your class and hide the
details. The method will take initialization data and return with a
reference to an object that is either active, or in the process of
becoming active, depending on its implementation.

Greg McKaskle
0 Kudos
Message 4 of 5
(2,456 Views)
Thank you very much Greg,
i'll try to use th vi server and hide that impementation inside my run method
0 Kudos
Message 5 of 5
(2,456 Views)