LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

question about VI structure with loop...

I have a rather simple program going here, and I have included a diagram to aid in my description...

basically I am taking pictures of an image, processing the image, and saving the results, several times...

right now I have a setup where my main VI consists of only calling the subVI and then a delay I programmed in (see picture)...

the issue I have here is that my subVI contains most of the "work" and inside it initializes, snaps image, closes link, and then processes image. for efficiency purposes I only want to initialize and close the link 1 time (in the very beginning and in the very end). also, the stuff I want to see while I am running the experiment is on the front panel of my subVI...

how should I go about achieving this? what I have been trying to do is just make what is currently my subVI into the main VI, but I cant figure out how to cut the loop in so that it will just cover the image snap and process...

thanks for any help and please let me know if I should be uploading my VI for more clarity...
0 Kudos
Message 1 of 8
(2,727 Views)
Kirkland4,
 
It sounds to me like you should do the initialization before you enter the main loop, call the subVI (which now only captures and processes the picture, then returns to the main
 
loop). The main loop waits then calls the subVI again or, exits if the exit criteria (you didn't specify what it is) occurs. When the main loop finishes, close the link and exit.
 
To keep it modular, you should write an init subVI, a capture subVI and a shutdow subVI.
 
Does that help at all?
0 Kudos
Message 2 of 8
(2,713 Views)
In addition to terminalman's comments, in order to have your subvi indicators change front panel indicators, see this thread
0 Kudos
Message 3 of 8
(2,702 Views)

terminalman that is precisely what I want to do! Except I can't figure out how to connect the subVIs together...

 

that was helpful, thank you both.

0 Kudos
Message 4 of 8
(2,683 Views)
Except I can't figure out how to connect the subVIs together...

What do you mean by this exactly?  Problems with creating the connector pane, problems with terminalman's directions, problems with references...?

If you provide some code or an image or something, someone will help solve your problem!
0 Kudos
Message 5 of 8
(2,672 Views)
I apologize for my lack of good description...

Here is the VI. the problem is that I get errors with regard to the connection to the close VI.
0 Kudos
Message 6 of 8
(2,656 Views)
What errors are you getting? Could you post the error code? Also, were the errors in this version of the application, or had you added the while loop and then received errors?
Jarrod S.
National Instruments
0 Kudos
Message 7 of 8
(2,629 Views)

Are you sure you posted the right code, this VI doesn't have any loops in it at all.

Mike...


Certified Professional Instructor
Certified LabVIEW Architect
LabVIEW Champion

"... after all, He's not a tame lion..."

For help with grief and grieving.
0 Kudos
Message 8 of 8
(2,623 Views)