LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Display test output using "string" indicator???

Solved!
Go to solution

 

 

 

 Hi, I am trying to output the test data to string indicator as you can see below,

but with "For" loop logic it is only displaying last number, so if you were to execute this, you will see

following output.

Test#6

 

If I move the concatenate string block outside of For loop, you will the output as below.

Test#0123456

 

However I want to achieve following output. Can someone suggest me a way to do this?

By the way I have use the For Loop.

The output I want to display with the For Loop

 

Test#0

1

2

3

4

5

6

 

Thank you  

 

 

 

 

 

 

ForLoopDisplayLogic.JPG

0 Kudos
Message 1 of 6
(3,897 Views)
Solution
Accepted by topic author horanyee

Close but no cigar.

You need to concatenate the string using a shift register.

 

 

test list.PNG

 

This will be the output:

output.PNG

Message Edited by Cory K on 08-12-2009 01:52 PM
Cory K
0 Kudos
Message 2 of 6
(3,880 Views)

To achieve the output you want, you can use two concatenate string functions, one inside the For loop and one outside.  On the inside one, you want to keep that End of Line character after the index number.  On the outside one, you can put the "Test#" in the first input and wire the array of strings from the For loop to the second.  See below.

 

Build String.PNG

0 Kudos
Message 3 of 6
(3,874 Views)

As you wrote the VI it only outputs the value from the final loop iteration (output indexing is disabled).

 

Moving concatenate strings outside concatenates "Test" with a 1-D array "0","1",..."6" and finally CR.  The 1-D array just concatenates all elements.

 

If you want the final string to be what you showed (after the for loop) then follow the path to "string" in the following VI.

 

If you want what I think the sensible thing is, follow the path to "string 2" with the shift register.

 

 

(...Ah, too slow)

 

 

0 Kudos
Message 4 of 6
(3,871 Views)

Photon Dan is correct. You can move the concatenation of Test # outside of the loop.

It won't hurt to keep it in the loop, since it is just overwritten each iteration.

But for the sake of efficient coding, you should move it outside of the loop.

Cory K
0 Kudos
Message 5 of 6
(3,870 Views)

Thank you all for your answers.

This will do it for me.  Smiley Very Happy

0 Kudos
Message 6 of 6
(3,858 Views)