LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to initialize device inside repeated vi?

Hello,
  • I have some usb camera connected to usb, and i have some Camera VI that can handle this device.
  • Inside this Camera VI there is sequence Initialize Camera>Capture Image>Close Camera.
  • I have Main VI that this contain this Camera VI
  • I dont want the Initialization and Close steps to occure every time
  • I dont want that the Initialization and Close steps will be on Main VI (i want that every camera function will stay on Camera VI)
  • Whats the best way to do that with minimal wiring?

Tnx,

HaD

 
0 Kudos
Message 1 of 4
(2,888 Views)
How about adding a boolean control (label might be "Init & Close Camera?") and two Case Structures?
Make that control an optional terminal of this VI and place the code for Init Camera and Close Camera in the Case Structures.
This allows you to control init and close from the caller.
Does this match your idea?
Regards, Guenter
Message 2 of 4
(2,883 Views)
Hmm,
Yeap.Smiley Happy
 
Tnx.
0 Kudos
Message 3 of 4
(2,880 Views)
Rather than using a case structure to handle buttons it's typically better to use an event structure. This approach is more easily expandable and doesn't take up computer resources polling the front panel controls. If you haven't done this sort of thing in the past check the examples that ship with LV, you'll find some good stuff there.

Mike...

Certified Professional Instructor
Certified LabVIEW Architect
LabVIEW Champion

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

For help with grief and grieving.
Message 4 of 4
(2,870 Views)