From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to record values after auto indexing and truth case

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 

0 Kudos
Message 1 of 9
(1,665 Views)

engineergal211_0-1595716319881.png

I want to record the pressure once the voltage is is less than 5 V. I want to do that for 4 channels 

0 Kudos
Message 2 of 9
(1,660 Views)

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.

0 Kudos
Message 3 of 9
(1,640 Views)

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. 

0 Kudos
Message 4 of 9
(1,627 Views)

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.

0 Kudos
Message 5 of 9
(1,599 Views)

Here it is. 

 

Thank you 

0 Kudos
Message 6 of 9
(1,535 Views)
@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?):

Pressure_snippet_JoB.png

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:

Pressure_snippet_w_array_in_SR_JoB.png

 

Do these help?

-joeorbob

Message 7 of 9
(1,503 Views)

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

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
Message 8 of 9
(1,481 Views)

@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:

Pressure_snippet_JoB_ThankGerdW.png

 

0 Kudos
Message 9 of 9
(1,461 Views)