LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

how to print an array out a while loop?

Hi all,

I'm very new with Labview (6h of Practice) and I meet a problem.

I create a while loop in which a read the first characters of each line of three files and put it in an 2D array (3 rows and 50 lines).
My goal is to print this array on the VI's panel in a Table or in a Multicolon Listbox. How to do this? In the While loop or out?
I use Labview 6i.

Thanks for your help
0 Kudos
Message 1 of 6
(3,267 Views)
Hi,
I don't see any problems. I suppose that you can get a 2D array of strings from files.
Now there are three solutions.
1. Use of Arrays.
Right-click on the wire with your 2D array and select "Create->Indicator" from pop-up menu. Now you have a 2D array on the front panel which will show you your data.
2. Use of Tables.
Select table control from "Controls->List&Tables". Paste it on the front panel of your vi. Right-click on it and select "Change to indicator" from pop-up menu. Then wire this indicato to your 2D array in the block diagram.
3. Use of Multicolumn listboxes.
Paste the multicolumn listbox to the front panel. On the block diagram right-click on it and select "Create->Property node" from pop-up menu. The property node of your control will appea
r in the diagram. Right-click on it and change property to "Item Names" By selectring "Properties->Item Names" from pop-up menu. Now Right-click on the property node once again and select "Change to write" or "Change all to write" to toggle your property into write mode. Then wire your 2D array to this property node.

The example is attached.

Good luck.

Oleg Chutko.
0 Kudos
Message 2 of 6
(3,267 Views)
Thanks you but I try it, and it doesn't work. I think it's a problem of good data format...

My VI is in attachment, if you can look at this. I would like to print on the panel the arrays called "Time IN" and "Time OUT" on the diagram.

Thanks
0 Kudos
Message 3 of 6
(3,267 Views)
Hi,
you have to create table INDICATOR on the front panel. Then place it out of the while loop and connect with, for example, TIME IN. The wire will be broken because of the disabled indexing. To repair it you have to right-click on the output node from the loop (the black square) and select "Enable indexing".

Good luck.

Oleg Chutko.
0 Kudos
Message 4 of 6
(3,267 Views)
OK. Thank you very much. It's help me!

PF
0 Kudos
Message 5 of 6
(3,267 Views)
Sorry to ask you something again...
So, I have data IN and OUT and I compute the difference.
How can I print this three "arrays" (IN, OUT, Difference)in one Table with 3 raws?

Thanks in advance,

PF
0 Kudos
Message 6 of 6
(3,267 Views)