LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Select array elements dynamically

Solved!
Go to solution

Hello ... 

 

I am trying to write a program where one can select the array elements dynamically from the front panel when the VI is in run mode.

 

So far, IC_OpenDevice.vi gives me the various Video formats [It is a 1D array], right now I assume the last but one among this array as an example. But, I would like to design the program in such a way that the user can select any Video Format from the front panel. How do I achieve that ??

 

 

Block Diagram :

Front Panel:

 

 

 

Abhilash S Nair

Research Assistant @ Photonic Devices and Systems lab

[ LabView professional Development System - Version 11.0 - 32-bit ]

LabView Gear:
1. NI PXI-7951R & NI 5761
2. The Imaging Source USB 3.0 monochrome camera with trigger : DMK 23UM021

OPERATING SYSTEM - [ MS windows 7 Home Premium 64-bit SP-1 ]
CPU - [Intel Core i7-2600 CPU @ 3.40Ghz ]
MEMORY - [ 16.0 GB RAM ]
GPU - [ NVIDIA GeForce GT 530 ]
0 Kudos
Message 1 of 7
(3,801 Views)

Use a numeric control to pick the index you want.  I'm not sure what else you are looking for.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
0 Kudos
Message 2 of 7
(3,784 Views)

Place the array into the "strings []" properties of e.g. a ring, then use the ring output to index into the array of video formats.  Or you could use a listbox.

 

(Also note that if your stop and grab buttons are latch action, their terminal should be placed into their respective event cases so they reset properly.)

0 Kudos
Message 3 of 7
(3,781 Views)

I tried following the same method on my program. 

 

However, I get the Error -2147352567 ... Below is the changes I made to my program ... 

 


 


Abhilash S Nair

Research Assistant @ Photonic Devices and Systems lab

[ LabView professional Development System - Version 11.0 - 32-bit ]

LabView Gear:
1. NI PXI-7951R & NI 5761
2. The Imaging Source USB 3.0 monochrome camera with trigger : DMK 23UM021

OPERATING SYSTEM - [ MS windows 7 Home Premium 64-bit SP-1 ]
CPU - [Intel Core i7-2600 CPU @ 3.40Ghz ]
MEMORY - [ 16.0 GB RAM ]
GPU - [ NVIDIA GeForce GT 530 ]
0 Kudos
Message 4 of 7
(3,742 Views)
Solution
Accepted by abikutn

Why didn't you put the update to the video format in the event structure?  You could use the "Video Format 2":Value Change event.  Then it is all in one easy loop.

 

And you don't need that wait in your top loop since teh event structure will take care of your timing.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
0 Kudos
Message 5 of 7
(3,738 Views)

Thanks for the idea. I tried putting the event change in the while loop and let the even handler control the video format input. But, when I run the VI , why do I get this error ?

 

Abhilash S Nair

Research Assistant @ Photonic Devices and Systems lab

[ LabView professional Development System - Version 11.0 - 32-bit ]

LabView Gear:
1. NI PXI-7951R & NI 5761
2. The Imaging Source USB 3.0 monochrome camera with trigger : DMK 23UM021

OPERATING SYSTEM - [ MS windows 7 Home Premium 64-bit SP-1 ]
CPU - [Intel Core i7-2600 CPU @ 3.40Ghz ]
MEMORY - [ 16.0 GB RAM ]
GPU - [ NVIDIA GeForce GT 530 ]
0 Kudos
Message 6 of 7
(3,722 Views)

Thanks ! 

 

Figured out ... This event strucrue is really helpful stuff ... Smiley Happy

Abhilash S Nair

Research Assistant @ Photonic Devices and Systems lab

[ LabView professional Development System - Version 11.0 - 32-bit ]

LabView Gear:
1. NI PXI-7951R & NI 5761
2. The Imaging Source USB 3.0 monochrome camera with trigger : DMK 23UM021

OPERATING SYSTEM - [ MS windows 7 Home Premium 64-bit SP-1 ]
CPU - [Intel Core i7-2600 CPU @ 3.40Ghz ]
MEMORY - [ 16.0 GB RAM ]
GPU - [ NVIDIA GeForce GT 530 ]
0 Kudos
Message 7 of 7
(3,720 Views)