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: 

for loop with stdout of all iterations

Solved!
Go to solution

Hi

 

I have a for loop which calls an external script. The external script writes something to stdout. I'd like to see the stdout. I tried connecting a string to the stdout, using a concatenating tunnel. But it always only shows one line of stdout, not all of the output from the iterations. How can I achieve that?

0 Kudos
Message 1 of 6
(3,007 Views)

If it is sufficient to see all stdout after the loop has finished, simply wire to the right loop edge to create an array of outputs, one element/iteration and connect a string array indicator ob the outside.

 

If you want to see the array as it builds, you need to use a shift register and built he array there.

 

Alternatively, you could use a single string in a shift register and append one line per iteration.

0 Kudos
Message 2 of 6
(2,989 Views)

Thanks for your help.

 

I want to see stdout as it runs. So I use a shift register for now. But I still don't understand how I get all the output into one string indicator. I tried to use build array, but it doesn't seem to work?

0 Kudos
Message 3 of 6
(2,971 Views)
Solution
Accepted by iviewlab

@iviewlab wrote:

Thanks for your help.

 

I want to see stdout as it runs. So I use a shift register for now. But I still don't understand how I get all the output into one string indicator. I tried to use build array, but it doesn't seem to work?


How about using Concatenate String?

 

StringGrow.png

========================
=== Engineer Ambiguously ===
========================
Message 4 of 6
(2,965 Views)

Perfect, thank you! That is much easier and more straight forward than what I had in mind.

0 Kudos
Message 5 of 6
(2,958 Views)

Here is an even simpler versions:

 

 

Message 6 of 6
(2,919 Views)