07-02-2017 04:26 PM
I have an issue that is probably simple that i cant seem to get working. I have create two VIs that act as one working program. The first part of the programs does measurements, while the second displays the results. They both have their own Front Panel. The only connection between the two parts are 2 different arrays that are only handled on the block diagram and are not seen on the Front Panel IMG _2. I am able to drop the Second Vi into the block diagram of the first but cant do anything with it since there are no terminals specified. This is because there are no objects for me to connect to them on the Front Panel. When i copy the entire second VI into the first, highlight all the code, and select Create Sub-Vi the result is not a single VI icon, but an icon with some indicators IMG_2b
My goal is to have the second Vi launch when the first completes. Each front panels needs to be independent. Any help would be appreciated
Solved! Go to Solution.
07-02-2017 07:05 PM
Your description and heavily truncated images are insufficient to describe the problem. You you want to define the order of the subVIs, you can use a flat sequence. Typically, you should at least have error terminals. This allows you to define execution order by the data dependency of the error wire.
Feel free to attach simplified versions of your VIs or at least provide a more detailed description What do the subVIs do? How do they terminate?
07-03-2017 04:14 AM
Create a 3rd Main.vi and drop both the others in this one. The main vi needs a flat sequence, or better as Altenbach mentioned, error terminals so you can decide order through the error wire.
/Y
07-03-2017 08:24 AM
Sorry for the poor explanation. My issue is not that i can't control execution order. My problem is that there are only two array wires that i want connecting the two VI and when i create a sub VI of the second there are not terminals for me to connect it to. Both VIs need there own Front Panel.
I have attach a simple version of what i am trying to do. The tables and everything in the for-loop are the main VI. and everything else should be it's own sub-VI.
07-03-2017 08:33 AM
@RJMason wrote:
My problem is that there are only two array wires that i want connecting the two VI and when i create a sub VI of the second there are not terminals for me to connect it to.
So why can't you connect the arrays to the connector panes and pass the data around?
07-03-2017 09:15 AM - edited 07-03-2017 09:27 AM
I was not able to connect the data to the connector panes because the arrays do not live on the Front Panel and no array should be visible there. I was able to get it working by doing just that though. i just moved them to the back and hid them behind a graph. I was just hoping there was a proper way to make it happen without having to create those array controls on the Front Panel at all.
07-03-2017 09:21 AM - edited 07-03-2017 09:24 AM
Hi RJ,
two common options:
- move your controls/indicators out of the visible area of your front panel. Hide the scrollbars of the VI at run time!
- hide the controls/indicators after connecting them in the connector pane (it's a right-click option of each control/indicator!)
I was just hoping there was a proper way to make it happen without having to create those array controls on the Front Panel at all.
You NEED to have controls/indicators on the FP when you want to connect them in the connector pane!
i just moved them to the back and hid them behind a graph.
Stacking controls/indicators (aka "overlapping" them) can influence the FP update speed significantly and is not recommended!
07-03-2017 09:26 AM
You're making it harder than it has to be. 🙂 The normal solution is to add a front panel array connected to the terminals and either hide it (r-click, advanced, hide terminal) or simply place it outside of the visible frame (the better choice).
What you're asking for would in a text based language be to transfer data between functions and not use parameters (since that's what the terminals represent).
The answer is similar in both, global variables, events, notifier or queues.
Of those i'd recommend queues, so your options are Terminals or Queues. 🙂
/Y
07-03-2017 09:45 AM
Ahh, so the question i should have been asking was how to hide controls. Should have looked though the options more, but thank you for that information. I was missing that conceptual knowledge. Thank you again