Sonic_Soul Posted November 13, 2008 Report Share Posted November 13, 2008 Hi, I've got quite a few working VI's now... and I'd like to add them as a Sub VI's to a larger VI which is basically a user interface. I know how to access the icon pane and connect my inputs and outputs to the terminals but whenever I insert any of these VI's into the user interface VI they never work! They all work stand-alone, but not when incorporated into the interface VI. Why would this be? Thanks. Quote Link to comment
Wire Warrior Posted November 13, 2008 Report Share Posted November 13, 2008 QUOTE (Sonic_Soul @ Nov 12 2008, 04:35 AM) They all work stand-alone, but not when incorporated into the interface VI. Why would this be? It's hard to tell without seeing the code or having more information about how the don't work. Can you post a copy of your code with the sub VI's inserted or atleast a screenshot of the block diagram? That would assist in answering your question. Thanks Jason Quote Link to comment
gleichman Posted November 13, 2008 Report Share Posted November 13, 2008 Are your SubVI's part of your GUI? Do you want them to show on your front panel or open when called? Or, are they simply not returning the expected results when placed in your main VI. QUOTE (Sonic_Soul @ Nov 12 2008, 05:35 AM) Hi,I've got quite a few working VI's now... and I'd like to add them as a Sub VI's to a larger VI which is basically a user interface. I know how to access the icon pane and connect my inputs and outputs to the terminals but whenever I insert any of these VI's into the user interface VI they never work! They all work stand-alone, but not when incorporated into the interface VI. Why would this be? Thanks. Quote Link to comment
Sonic_Soul Posted November 14, 2008 Author Report Share Posted November 14, 2008 gleichman, jasonw, thanks for replying. I want the objects from the sub vi to show on the front panel and they do - but they don't react when pressed. I've uploaded screenshots of a very simplified GUI I'm using. It's basically a tab control, and on each tab I intend to have objects from different sub-vi's. main gui.jpg - the GUI. img capture sub vi.jpg - the sub VI. The sub VI captures an image from a USB camera and saves it as a BMP file when a button is pushed. It also displays the captured BMP file. I want two things to display on the main GUI; the button to activate the capture, and a display of the captured image. Therefore I've wired these up as an input and output on the connector pane. As I say, the VI (and the other's ive made) will work stand alone. But when I try to incorporate it into a tabbed GUI it doesn't. Any ideas? Thanks for your time peeps. Quote Link to comment
tnt Posted November 14, 2008 Report Share Posted November 14, 2008 QUOTE (Sonic_Soul @ Nov 13 2008, 01:06 PM) As I say, the VI (and the other's ive made) will work stand alone. But when I try to incorporate it into a tabbed GUI it doesn't. Any ideas? Thanks for your time peeps. Hi, I think it fails because you already destroy your image inside the subvi, it is better to create the image outside (before) the while-loop, and destroy it after stopping the while-loop. Happy wiring... EDIT: also make sure the Stop-button in your subvi is default set to TRUE, otherwise your "inner"-while-loop (inside the subvi) will NEVER exit !!! TIP: create an indicator on your index to see your while-loop running... Quote Link to comment
Francois Normandin Posted November 14, 2008 Report Share Posted November 14, 2008 QUOTE (tnt @ Nov 13 2008, 07:03 AM) I think it fails because you already destroy your image inside the subvi,it is better to create the image outside (before) the while-loop, and destroy it after stopping the while-loop. You're right about that. While the indicator is still there, it refers to a pointer in memory. Destroying the image in the subvi effectively destroys it everywhere as well, except if you've made a copy of it. That goes against dataflow thinking... I prefer to think of IMAQ images more as a reference to a memory space than a linear process. Quote Link to comment
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.