LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Entering info

This is an extension to a question that I posted a while ago.  I have a table with a 'n' number of rows and a 'm' number of columns.  I want to enter my first set of data in row 1, then my next set into row 2, and so on.  But in each row, I have 5 columns and I want specific information to be placed in each column.  When ever I run my vi, it places all the information into the first row.  I am entering my info into a table using shift registers and I tried using the carriage return and line feed, but none of it places it like I want it.  Below I have attached my vi. 
 
I want to info to appear like:
 
   Run     Applied Voltage       Current       Resistance     Temperature
    5               10                          6                    4                     35
    4                11                         6                    4                     34
    3                10                         6                    4                     34
  and so on....
 
But instead it appears like
 
    Run      Applied Voltage           Current           Resistance         Temperature
     5                10                              6                      4                             35                       4                 11                 6               4              34         and so on....
 
How can I get the data to appear like wanted?
Any help will be greatly appreciated.
 
0 Kudos
Message 1 of 5
(2,883 Views)

The easy solution is try to view or wrote the file using Courier New or Courier font.  This font will display all characters the same width so things align.  If it is a text file, use select all, font = Courier New.

Matt

Matthew Fitzsimons

Certified LabVIEW Architect
LabVIEW 6.1 ... 2013, LVOOP, GOOP, TestStand, DAQ, and Vison
0 Kudos
Message 2 of 5
(2,868 Views)

Your program has some serious flaws and this particular problem is due to the fact that you actually only write an 1D array of strings. (You convert it to a 2D array only after the loop, meaning the 2D array size is "N by 1".

  • You don't need to explicitely built the array, just use autoindexing on the output tunnel.
  • %t is NOT a valid format for strings here ( not even allowed for array to spreadsheet string). Use %s. Leave the separator input unwired.
  • I don't understand the need for the outer case structure. What is the point?
  • I don't understand the need for the inner case structure. Once the while loop produces an output on the tunnel, the wire will always be true. 100%!
  • I don't understand the "# of runs" handling. You cannot gurantee how often the FOR loop iterates, because you don't know if the FOR loop starts with the original value or with a decremented value from the local variable write in the while loop. Local variables are dangerous!

See image

Message Edited by altenbach on 06-28-2006 03:54 PM

0 Kudos
Message 3 of 5
(2,865 Views)
Thanks, I made the necessary changes.   I want the values to change as it increments.  When it goes through runs, I want to first row to have the data from the first run, the second row to have the data from the second row, and so on.  For example, the first time the program goes through, One run 1:  the applied voltage is 5 V, and the current is 2A.  Run 2:  the applied voltage is 6 V and the current is 1A.  So in the table I want it to display:
 
 
 
Run       Voltage       Current
1                 5                 2
2                 6                 1
 
How can I get it to do that. 
0 Kudos
Message 4 of 5
(2,816 Views)
This forum thread might help you with this question a bit. Take a look. I hope this helps!
Jarrod S.
National Instruments
0 Kudos
Message 5 of 5
(2,795 Views)