LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Connecting 2 lab view codes through tabs

(Excuse me if I do not explain things correctly; I am new to Lab VIEW and I am currently learning through the course videos).

 

I am trying to add two different lab view codes into one panel by adding a tab. I quite simply copy and pasted the existing user interface of the existing lab view code and added it to a new tab, and I copy pasted the block diagram to the new code's block diagram. If I move around the block diagram to connect it to the existing code, should the 2 lab view codes successfully connect (given I do it correctly)? Or are there more nuances to be aware of? I am aware this is quite vague, so let me know if there are any other details. I also guess the real question is how would I go about connecting the two codes? I guess it would be pretty subjective, but are there are tips or guidelines to follow? I'm not entirely sure where to even start. 

0 Kudos
Message 1 of 4
(688 Views)

Hi hutchacre,

 


@hutchacre wrote:

Or are there more nuances to be aware of? I am aware this is quite vague, so let me know if there are any other details. I also guess the real question is how would I go about connecting the two codes?


Well, it is a very vague question!

How should we know how to "connect your code" when we don't know anything about your code?

 

Why do you need to "connect code" when the (sub)VIs can run on its own?

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 2 of 4
(638 Views)

I don't quite understand your question, but if you have 2 separate VIs that works well on their own i wouldn't copy their code, but use them as SubVIs in a new main (a 3rd VI).

This is an excellent use case for Subpanels, either side by side, or e.g. on a tab each. Just create a reference to both VIs and insert into the panels.

G# - Award winning reference based OOP for LV, for free! - Qestit VIPM GitHub

Qestit Systems
Certified-LabVIEW-Developer
0 Kudos
Message 3 of 4
(605 Views)

A tab is mostly a decorative element that lets you limit the number of front panel elements visible in a given scenario (i.e. tab state). The code does not need to care what the tab state is and just react to user input, exactly the same as if the two front panel groups would be located side-by-side on a larger front panel. In most of my programs, the tab terminal is not even connected to anything because the code does not need to know, or can deduce the current tab from what control was just operated.

 

So lets get a bit more details on your problem before we can give further advice. What do the two codes do? What is your definition of "connect"? Do they communicate or are they completely independent? If they are completely independent, you can just place the two "codes" side-by-side in their own top-level loop and LabVIEW will run them in parallel if done correctly

 

 

0 Kudos
Message 4 of 4
(587 Views)