07-25-2020 05:30 PM
Hi Labview community,
I was wondering what would be the best way to store values into an array indicator. I have a boolean array that goes through an auto-indexing and then into a truth case. I want the value to record and store when the boolean is true, I have four channels, so I have it running four times. If there is a more efficient way to do this please let me know.
Thank you
07-25-2020 05:32 PM
I want to record the pressure once the voltage is is less than 5 V. I want to do that for 4 channels
07-25-2020 06:18 PM
Right click on the autoindexing output tunnel and turn on the conditional mode. Wire the boolean into that. Now it will only autoindex the value if the boolean is true.
07-25-2020 07:25 PM
I did that but the values were not saving. I want the pressure to only record when the voltage is less than 5 and the Flag is true. I also want that value to store in the array.
07-25-2020 10:58 PM
You need to post your VI that shows your attempt to do that.
All you've shown is a partial screenshot that doesn't show that attempt.
07-27-2020 09:40 AM
Here it is.
Thank you
07-27-2020 06:20 PM
@RavensFan wrote:
Right click on the autoindexing output tunnel and turn on the conditional mode. Wire the boolean into that. Now it will only autoindex the value if the boolean is true.
Here's what I think RavensFan was saying (see the conditional tunnel on the right?):
Note, I'm *not* an expert, but hopefully this can help.
(Or maybe this'll make the Rube-Goldberg thread...)
Also, based on your block diagram and what @cbutcher commented on it (with this message), it looks like you're trying to compare your boolean array from one while-loop-execution to the next. As cbutcher mentions, you might try storing the whole array in a shift register instead of individual indices.
For example:
Do these help?
-joeorbob
07-28-2020 03:24 AM - edited 07-28-2020 03:27 AM
Hi Joeorbob,
no loops, but doing the same:
(I replicated the behaviour of the original VI regarding the resulting "Pressure TL" array…)
Btw. this has already been discussed several weeks ago…
07-28-2020 10:17 AM - edited 07-28-2020 10:29 AM
@GerdW wrote:
Hi Joeorbob,
...
Btw. this has already been discussed several weeks ago…
Hi, GerdW,
Thank you for following up! I saw your reply in the older thread. Unless I read your screenshot wrong (which is very possible - I'm inexperienced), you were setting the "values to discard" to zero.
This matches the behavior of the original VI (as you said), but does not match what was asked in this new thread. I think that's why @RavensFan recommended a conditional output tunnel.
I think it would be great to remove the loop entirely - I'm just not experienced enough to know how. Would you please show how to remove the unwanted values (instead of setting them to zero) without using a loop?
Thank you!
-joeorbob
EDIT:
Here's a version adding in what I know how to add from your screenshot: