LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Running a LV program from a second LV program?

I have a LV program that controls a pump. Basicly, the pump speed is set and the pressure is measured, but the program is quite large. This program is complete and will be delivered with the pump to customers.
 
Now to the problem: I have another LV program that I would like to integrate the pump program with. I would like to set the pump speed and display the pressure on the second programs Front Panel.
 
Any suggestions on how to do this without making too much changes (preferably none) to the pump program?
0 Kudos
Message 1 of 10
(4,242 Views)
All you have to do is make your pump vi a subvi of your new main program. And for passing information you can do this many ways. The best way to do it is to wire an indicator to the output of the pump VI or you can use references or globals. I suggest looking at the help examples and reading the manual on how to use SubVI's.



Joe.
"NOTHING IS EVER EASY"
0 Kudos
Message 2 of 10
(4,232 Views)
Two options come to mind:
1. Treat the pump control program like a driver where you call the pump control vi as subvi's
2. Call the control program dynamically, you should be able to use any program as a dynamic vi
 
The only changes (depending on your architecture for the control program) might be that you will have to make the settable controls inputs to the vi so that calling program can pass values the the control program through a wire.
 
I am not sure how you approached this problem but I would first have written a driver where each vi represents a discrete function like set SetPumpSpeed, GetPumpPressure, OpenPumpConnection, ClosePumpConnection (how do you communicate with the pump).  The I would provide a "Soft panel" which is just a vi to allow the basic or even full control of the pump.  When I want to use the pump in a large scale application I would call the pump driver subvi's directly.
Paul Falkenstein
Coleman Technologies Inc.
CLA, CPI, AIA-Vision
Labview 4.0- 2013, RT, Vision, FPGA
0 Kudos
Message 3 of 10
(4,231 Views)

What is considered "quite large" 10, 100, 1000+ vis?

This can also help determine how to call the pump program.  Very large subvi hierarchies can be called dynamically to avoid loading the vi into memory until need, improving application performance and managing the resources better.

Paul Falkenstein
Coleman Technologies Inc.
CLA, CPI, AIA-Vision
Labview 4.0- 2013, RT, Vision, FPGA
0 Kudos
Message 4 of 10
(4,228 Views)
I have been thinking about making it a subVI, but...
 
I think I made the desciption of the pump program a bit brief. The pump program controlls the pump speed with a PID controller continuously (a DAQPAD-6015 is connected to the pump and pressure sensor), so it can't just run when called as i subVI from the main program.
 
What I have in mind, but don't know how to implement, are to different programs running at the same time in parallell, passing data between them.
 
I'm not sure what you mean by "dynamic VI"? 
0 Kudos
Message 5 of 10
(4,220 Views)
If the pump vi has to be running all of the time then just put it in it's own seperate loop and use ques or variables or references to pass the data. Again it really depends on the structure of the pump VI.
 
 
 

Message Edited by jhoskins on 09-08-2005 09:11 AM




Joe.
"NOTHING IS EVER EASY"
0 Kudos
Message 6 of 10
(4,215 Views)

thank you for the answer!

I've been think about that already. The problem is that I want to keep the pump program as it is. If I put it into a loop in the main program I will have two versions of the program, one that is put into the main program and the original standalone pump program. The two programs will be delivered to customers as executables and I want to avoid to have two differerent versions of the same pump program to support.

No way this could be done??

0 Kudos
Message 7 of 10
(4,205 Views)
To control a LabVIEW exe from a second program, build it as an ActiveX server (Application Settings tab). Then you can use methods/properites such as Set Control Value/Get Control Value. No changes to the code of the original is required.
0 Kudos
Message 8 of 10
(4,197 Views)
Can the pump program be running at all times, or just when called as a server? The pump needs to be controlled continously so the program has to be running in the "background".
 
 
0 Kudos
Message 9 of 10
(4,164 Views)
An executable built as an ActiveX server runs just like any other executable you build. All that you're doing is exposing some properties and methods that can be optionally read/written by another program.
0 Kudos
Message 10 of 10
(4,150 Views)