07-17-2019 07:21 PM
hELLO labview experts,
Could anyone help explaining why the output array is 2D?
Picture attached below
07-17-2019 08:35 PM
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.
07-18-2019 12:24 AM - edited 07-18-2019 03:12 AM
@wew044 wrote:
Could anyone help explaining why the output array is 2D?
(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:
*the following would be identical in functionality to your case structure :o:
07-18-2019 03:29 PM
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.
07-18-2019 05:06 PM
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.
07-18-2019 05:29 PM - edited 07-18-2019 05:30 PM
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.
07-18-2019 05:47 PM
@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
07-19-2019
01:47 AM
- last edited on
08-28-2025
03:52 PM
by
Content Cleaner
You seem to have a simple control application, so study about PID. Your current ideas are not reasonable.
Now let's look at the program you have attached: