LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Subpanel Data Read by Main VI?

In the attached VI, I need a certain sub-VI to fire when the main VI closes. For the sub-VI to work, it needs to know the location of a physical device, and that location can be changed by an interface in one of the main VI's sub-VI's. Only one such sub-VI requires a termination condition like this right now, but there might be more later.

The inc_dec sub-VI does not seem to be receiving the data from the HV sub-VI (I set it to play a sound if a specific non-default value appeared on the brown cluster wire, and the sound isn't playing).

So, how am I supposed to do this to make it work?

(I can post the sub-VI's if needed.)
0 Kudos
Message 1 of 15
(3,725 Views)
Ugh, it's worse than I thought. The "Panel Close" event case for the HV sub VI--which does not fire when CRATE FACE closes, I tested by running it alone--works fine. However, in the CRATE FACE version attached to this post, inc_dec does not fire at all. This is especially frustrating because it did fire before the brown wire existed. Argh!

Ideas?

(Edit for missing words.)

Message Edited by DJDDA on 11-26-2007 03:13 PM
Download All
0 Kudos
Message 2 of 15
(3,713 Views)
(It would appear that I cannot edit my previous post. Perhaps there is a timed edit window?)

Going over the help files again, I ran into something: Am I correct that the Close Reference sub VI's are completely unnecessary here?
0 Kudos
Message 3 of 15
(3,677 Views)
...Okay. Easier question, then: Which is the most likely cause for lack of response here?

a) Question too hard, nobody knows the answer [this is unlikely...]
b) Question offensively easy, I should work it out alone
c) People are tired of answering my questions
d) Forum moves fast, nobody got to this thread while it was visible
e) triple-posting is too offensive here for people to read it


(I'm not being sarcastic, I just want to be more careful in the future.)
0 Kudos
Message 4 of 15
(3,649 Views)

Speaking only for myself...

i only volunteer on this forum so I can't spend a lot of time looking into a problem. If the question is clear and i think i have an idea, i'll reply.

In the case of this question, I am OK with your title but you lost me after that.

Sure I could look at your code if I had the right version on this machine but I suspect I do not. That means I would have to go to another machine, down load....

Sorry but I don't have time for that.

So...

please imbed images of your code so we can reply by looking and save us having to poke.

Now I'm guessing;

Are you try to do inter-thread communications? If so look at my Action Engine Nugget.

The next guess is that you are having trouble harnessing the data flow pardigm.

And as to your mini-follow Q I would guess "a" complicated by "d".

Trying to help,

Ben

PS: Watch how long it will take for Jim Kring to get an answer to this Q !



Message Edited by Ben on 11-27-2007 01:39 PM
Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
Message 5 of 15
(3,645 Views)
Okay, here are images. Thanks for the reply. (Edit to display images in post, and again to space them better.)

Crate Face:


3002D:


inc_dec:


Message Edited by DJDDA on 11-27-2007 02:34 PM
Download All
0 Kudos
Message 6 of 15
(3,636 Views)
Okay, I modified it with a global variable. It's one global variable with two unrelated indicators on its front panel. This seems to work, but since there isn't a help file for global variables, I have no idea whether this is going to be a problem when I insert more sub VI's that need termination conditions (or, indeed, whether this will even work properly now). I'd have rather used wires. Suggestions?

I also got rid of the Close Reference nodes, because I think I don't need them. I'd like verification if possible.

Sorry for the double post, the edit window seems to be pretty short. (Edit for visible image.)

Crate Face:


Message Edited by DJDDA on 11-27-2007 03:46 PM
0 Kudos
Message 7 of 15
(3,616 Views)
 

Hi DJ...

I think I can be of most use by pointing you at a KB on LabVIEW's Data Flow Pardigm here.

It would also be good for you to read the "Help for Insert VI" node then look at the examples. Same for the panel Close Event. The code you posted was a tangled little knot where you could not fire the event until you fired the event ...

You should close all references that you open, after you are done with them.

Ben

Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
Message 8 of 15
(3,605 Views)
Okay, here's an update that's a little less "" (I hope).

The original was rather screwy even judged by my limited knowledge, I suppose, but there are still a couple things I really don't get:

1) Is my use of a global variable here functional? Will it create problems in the future? I tried to design this with the data flow paradigm in mind, but I need the sub VI icon outside of the event structure and I need the data to originate inside of it, I think, and I'm not clear on whether using a second sub VI icon for the event structure would be functional.

2) I understand that I need to close all open references when I'm done with them, but unless I can close the reference while still running the sub VI (which I suppose might be possible), I won't be done with the reference until the panel closes. I think this closes the reference anyway, but I'm not sure. So, do I still need to manually close a reference to a sub VI that doesn't close until the main VI does?

Edit: Here's the new picture.


Message Edited by DJDDA on 11-28-2007 02:43 PM
0 Kudos
Message 9 of 15
(3,587 Views)

Hi DJ,

I recomended reading the help for the Insert VI and look at its examples. The examples will show you how to run your VI's in the sub-panel and show where and how to close the references.

RE: Globals I rarely if ever use globals (Globals are evil!). I generally use Action Engines to fill that need. I posted a link earlier to a Nugget I wrote on Action Engines.

The help and the Nugget say much more than I could with a quick reply. Please review those help files and links and post follow-up Q's if they don't answer your Q's.

Quick guess at why your event approach is not working.

The panel close event only files when the FP is closed. Since you have open refs to the VI's and the are running in the sub-panels, their FP are not closing so their Panel Close events never fire. But this is just a guess about what I thought you were TRYING to do. So either read the help on the Insert VI and the panel close event or stick with the method you reported that works.

Still trying to help!

Ben

PS The Examples for the "Insert VI" show you exactly what you need to do. Take a look, please.

Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
Message 10 of 15
(3,584 Views)