LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Array Size Question

hELLO labview experts,

 

Could anyone help explaining why the output array is 2D?

 

Picture attached below

 

0 Kudos
Message 1 of 8
(3,464 Views)

It is an auto-indexing tunnel. Auto-indexing tunnels turn scalar values into a 1D array of the values for each iteration of the loop. Auto-indexing tunnels to 1D arrays into 2D arrays with one row for each iteration of the loop. Etc...

 

Delete the build array, then you will be auto-indexing a scalar value and you will get a 1D array, instead of 2D array.

 

Or you could also right click on the tunnel and select "concatenating" instead of "indexing", this would also give you a 1D array as output.

0 Kudos
Message 2 of 8
(3,430 Views)

@wew044 wrote:

Could anyone help explaining why the output array is 2D?

 

Capture


(Note that you can insert pictures directly)

 

You already got a reply why the output is a 2D array, but looking at your image I strongly recommend to start with a few simple tutorials, because the code makes no sense at all:

  • Your boolean never changes during the FOR loop, so all that case structure does is take 4 seconds to silently create an array of 10 identical elements (all ones)*. What's the purpose? Where will the output get used?
  • What's in the FALSE case?
  • Even the diagram comment makes no sense in relation to the code shown.
  • What is this part of the code actually supposed to do? What is the entire program supposed to do?
  • Can you show us the rest of the program so we can give more specific advice? (attach the VI!).

 

*the following would be identical in functionality to your case structure :o:

simplerbutstillpointless.png

0 Kudos
Message 3 of 8
(3,401 Views)

Thank you both for the reply!

Attached is the VI.

 

What I am trying to do is just running a boolean counter in my while loop. My goal is to do the following:

 

During a while loop, the VI will execute certain number of "true" based on a comparison to a constant value. Then after a certain number of counter of "true", say 10 counter, then it will stop the VI.

 

It threw me off when the array size is 2D when I have a boolean going in my case structure, because I am extracting only "1"s (true boolean) out of it and storing them in the array. 

0 Kudos
Message 4 of 8
(3,357 Views)

Your description and your VI make absolutely no sense. I recommend starting with a few simple tutorial and looking at the examples that ship with LabVIEW.

0 Kudos
Message 5 of 8
(3,336 Views)

Could you elaborate on which part doesnt make sense?

 

My thought was this:

Say you have a gas analyzer in the fermentation process, and you want the gas flow rate setpoint to compare to the previous measured gas flow rate and then decide whether to increase or decrease the flow. Because of the minor fluctuation in the system, I want to make sure that the comparison is stable. Say my Setpoint = 5, flow rate = 5, then flow rate changes to 3. I want to make sure that this 3 isnt due to fluctuations in the system, so a counter is needed:

 

Counter 1: 5 > 3 -> true

Counter 2: 5 > 3 -> true

and so on. After 10 counters, then for sure that the flow rate is indeed at 3. So I can decide whther to decrease or stop the flow rate. 

 

 

 

0 Kudos
Message 6 of 8
(3,327 Views)

@wew044 wrote:

Say you have a gas analyzer in the fermentation process, and you want the gas flow rate setpoint to compare to the previous measured gas flow rate and then decide whether to increase or decrease the flow. Because of the minor fluctuation in the system, I want to make sure that the comparison is stable. 


In addition to learning the basics of LabVIEW (take advantage of the tutorial material mentioned on the first page of this Forum), you would definitely benefit from some acquaintance with statistics.

 

Bob Schor

0 Kudos
Message 7 of 8
(3,320 Views)

You seem to have a simple control application, so study about PID. Your current ideas are not reasonable.

 

  • How does the program measure the flow?
  • How does the program control the flow?
  • What is the response time of the system?

 

Now let's look at the program you have attached:

  • you compare two DBL constants with an equal comparison, which is very dangerous in general, but here the result is always true.
  • You take that comparison result and immediately and take four seconds to turn it into a numeric array with 10 identical elements. The FALSE cases never execute, but if they would, the output arrays remain untouched from whatever they are.
  • A nanosecond later you repeat the same in the next iteration. Code never does anything with the outputs.
  • repeat forever until stop is pressed, after which it might take up to 8 seconds to react.

 

0 Kudos
Message 8 of 8
(3,298 Views)