LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

merge two programs to one

Solved!
Go to solution

I have developed two complete programs, but due to a change in plans, I need to effectively merge them into a single program.

Each program utilizes an event structure and a producer-consumer architecture.

 

I also need to rearrange the visual layout of the front panel, and I'm not satisfied with the idea of showing both front panels as they currently are.

Each event contains many items, and I'm wondering if there is a better way to handle this than manually adjusting each one.

Combining the event structures into one seems to be the biggest challenge.

 

Any suggestions or guidance on how to merge these two programs efficiently would be greatly appreciated.

 

labmaster.

0 Kudos
Message 1 of 4
(429 Views)
Solution
Accepted by topic author labmaster

Here's how I would do it:

  1. Copy the entire block diagram of one onto the block diagram of the other (this will bring all the FP controls with it (but not any decorations)).
  2. Write a script to merge the event structures.
  3. Manually fix everything else.
0 Kudos
Message 2 of 4
(391 Views)
Solution
Accepted by topic author labmaster

The nice things is that LabVIEW is fully parallel.

 

If each program is well written and relatively independent of the other one, you can just place all code from both programs side-by side running completely independently. You can place the front panel of each on two pages of a large tab control (don't even connect the tab control terminal to anything, it is just a cosmetic element!). The event structure can remain, each in their own toplevel while loop.

 

All that is left is adding some small modification to stop both programs at the end.

 

Minor adjustments are for example needed if you have a filtering "panel close?" event in each part that gets discarded. Only one will detect that event. Whatever event structure sees it first will discard it.

0 Kudos
Message 3 of 4
(384 Views)

I have intermittently worked with and programmed in LabVIEW for such a long time, yet I had never imagined or attempted to use more than one event structure.

Following your advice, I tried placing event structures in two while loops to run them in parallel, and to my surprise, it worked! Why is that? Haha.

My previously rigid preconceptions led me to ask such a naive question.

Thank you all very much.

 

labmaster.

0 Kudos
Message 4 of 4
(334 Views)