08-30-2008 06:34 AM
Hello,
I am in the process of a creating two sepearte main VI programs. Program (1) will be the program the user interfaces with and updates dynamically (using the front panel to change values, addresses, and states of power supplies, DMM channels, analog I/O, digital I/O, etc). Program(2) will be a separate program running through automated tests (current/voltage sweeps, data acquisition, etc). Normally I would like to incorporate both programs into a single VI, but the shear number of front panel controls and indicators makes it more practical to run separate programs on separate monitors (dual-screen setup). My question is, how do I go about passing the dynamic updates of program (1) into program (2)? For example, if I use event structures for both programs, and change the power supply voltage in program (1), how do I go about updating program (2) with this new value? From what I remember it isn't possible to have a program running and being used as a subVI as well. Any thoughts or recommendations? It would help tremendously to get this type of setup working.
08-30-2008 07:09 AM
If I understand correctly...
You can run one exe, one application, with two vis with their front panel open simultaneously.
You can pass the data through them with, functional globals.
Is this what you need ?
08-30-2008 07:11 AM
08-30-2008 07:15 AM
from what I understand, take a look at shared variables, and on the main vi 1 put a while loop aside from the event structure with the update of
your indicators from the shared variables
08-30-2008 03:52 PM
09-01-2008 12:16 AM
You can use a simple boolean variable.
When it is set to true you will ignore every front panel activity
09-02-2008 08:52 AM
I would strongly recommend you avoid shared variables and globals for this sort of application. Neither are thread-safe and both will cause many problems due to race conditions. You can avoid such problems by using a thread-safe storage mechanism. The most commonly used is the functional global (aka LabVIEW 2 global, shift register global, or action engine). I prefer to use single-element queues, since they are more scalable and work better with object-oriented design techniques. You can find examples and information about both of these techniques on this forum, and both work well.
Let us know if you need more information.
09-02-2008 07:19 PM
09-02-2008 07:20 PM
09-03-2008 08:04 AM - edited 09-03-2008 08:05 AM
Several things you can do to improve: