LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

I'm having problems in a GOOP application with multiple instances of the same object running simultaneously.

I?ve written an application to control a system with multiple lamps. Each lamp in the system has its own power supply. Each lamp object contains a reference to its power supply. The application contains an array with the references to all the lamps in the system. Each lamp is in charge of monitoring itself and setting its power supply?s voltage according to the applications commands, therefore each lamp needs that its ?run me? method will run as long as the application is running i.e. the run method has to be reentrant. Because there are multiple lamps and because the ?run me? methods for each lamp run simultaneously, to over come this problem each lamp has a met
hod ?run? that calls ?run me? with ?RUN VI? invoke node with the ?Wait until done? set to false. When I run the application, it seems to work but if I check the AO there is no change in the output, and the lamps seem to be reading their input from the same channel. I can?t seem to find the problem, I think that the fact that the method is reentrant causes some sort of mix-up in the separate object references. Also because the method is reentrant I can?t debug it (with one lamp it seems to work ok). Does anyone have any idea what could be causing this problem.

P.S I'm having problems attaching my sample program to this message. You can contact me at nimrod_rooz@hotmail.com to recive the sample program I wrote.
0 Kudos
Message 1 of 4
(2,417 Views)
When invoking the "Run VI" method on a VI, reentrancy is disabled so there is only one instance of the VI running. If you check the error ouputs of the "Run VI" method, you will see that only the first call returns no error; subsequent calls return an error indicating that the VI is already running.
Reentrancy works only when opening a strict VI reference and invoking the "Call VI" method, which can't be set to return immediatly; the diagram has to wait until it returns.

The solution is to save the "Run Me.vi" as "Run Me.vit" to make it a template. When a reference is opened to a template, a new instance is created in memory that can run independently of the other.


LabVIEW, C'est LabVIEW

0 Kudos
Message 2 of 4
(2,417 Views)
Jean, Thanks for your answer, I've tried checking the invoke node that calls the "Run VI" method but it doesnt return an error any of the times its called even that the Vi that it called is still running. I also tried your solution of changing the object's "Run" method to a template but that doesnt work either. I can't seem to post the sample progam that demonstrates the problem, is it possible to send it to you by email, contact me at nimrod_rooz@hotmail.com
0 Kudos
Message 3 of 4
(2,417 Views)
Sorry n.rooz,

I am still with LabVIEW 6.0. Your code is 6.1


LabVIEW, C'est LabVIEW

0 Kudos
Message 4 of 4
(2,417 Views)