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
(2,972 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,954 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,936 Views)
Solution
Accepted by topic author 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,930 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,923 Views)

Here is an even simpler versions:

 

 

Message 6 of 6
(2,884 Views)