LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Data do not pass through case structure

Here's how your entire loop code (without the file and IMAQ functions) probably should look like:

 

altenbach_0-1604534885900.png

 

0 Kudos
Message 21 of 27
(655 Views)

 

1. For the parallel setting, I am still confused. For example, if I have a VI A, which contains a subVI B. Now I am running two VI As in parallel, I understand I need to set the execute property of VI A to parallel mode. How about subVI B? Do I need to change its execution setting as well?

 

2. Because I lack experience, I thought I need to repeatedly remove the first element or remove the last element of an array, so I put this function in a subVI. In this code, it actually does not require removing any element as long as I initialize empty an array (which I did not know I could before) for the shift register.

 

3. I really appreciated your demo code. But I do not completely understand it.

(1) It looks like you did not use any shift register. So your output array only stores a single data set for one file?

(2) What is the purpose to connect the loop index i into the bundle? Does that serve the same function as a shift register?

(3) How did you add the "conditional output" from the loop?

 

Your reply will be highly appreciated.

 

0 Kudos
Message 22 of 27
(636 Views)

@Jacobier wrote:

 

1. For the parallel setting, I am still confused. For example, if I have a VI A, which contains a subVI B. Now I am running two VI As in parallel, I understand I need to set the execute property of VI A to parallel mode. How about subVI B? Do I need to change its execution setting as well?


Only if subVI B requires significant time. If it completes in an instance, it can easily be shared between reentrant subVIs.

 


@Jacobier wrote:

 

(2) What is the purpose to connect the loop index i into the bundle? Does that serve the same function as a shift register?


There is no bundle, just a "built array". (Sorry, the snippet must have mutilated the free label arrow). In your case you would use the number derived from the file name, of course (Since I don't have your file numbers, I substituted [i] instead)

 


@Jacobier wrote:

(1) It looks like you did not use any shift register. So your output array only stores a single data set for one file?

(3) How did you add the "conditional output" from the loop?


The output array contains one row of data for each file. Read up on conditional indexing tunnels, It's like an indexing tunnel but it only adds a new row if the condition is true. Just do a regular indexing tunnels, the right-click the tunnel and select "conditional".

 

 

0 Kudos
Message 23 of 27
(624 Views)

What confused me is that, auto index and conditional index both just handle one element at a time. So every time the index plus one, the element is refreshed. How can you get an array out instead of just a single element. As I have learned  that is why I need the combo of shift register and build array. In your code, you never use shift register. So it should be one element in and one element out. Can you explain what does the long build array VI after the loop do? And how can I change to this format?

 

Beside, with your inspiration. I think I should reorganize the data structure of my whole program (Other VIs as well). I am thinking use cluster to assemble x and y positions. Then another layer of cluster to assemble the 3 points of each image. Then another layer of array of dataset for all the image. That means an array of N clusters (with 3 cluster elements) of clusters (with 2 double elements). Attached is my code. But I have an error that I can't resolve. I don't know why the "Array to Cluster" VI generate a cluster of 9 elements while my For Loop only loops 3 times. 

0 Kudos
Message 24 of 27
(619 Views)

Most of your input and output tunnels should be autoindexing. (index array wired to [i] is the same as autoindexing on an input tunnel).

 

Please do a few simple tutorials and learn about arrays and clusters (and what the output size configuration is for "array to cluster", which you probably don't need anyway.)

 

Why can't you stick to my code suggestions?

0 Kudos
Message 25 of 27
(610 Views)

Can you attach you dummy code please?

0 Kudos
Message 26 of 27
(589 Views)

@Jacobier wrote:

Can you attach you dummy code please?


Try this.

0 Kudos
Message 27 of 27
(576 Views)