LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Using a format into string to output multiple values in each column

Solved!
Go to solution

Hello everyone,

I have been messing around with getting this portion of a VI working. I've mocked it up to simulate what it going on. I want to take data values from within a for loop (the one outside the sequence structure) and take that data, turn it into a string, and output the data in different columns. I seem to have this working the way I want it; however, I cannot seem to ever receive more that the last line of data collected. I've attempted to add a index array between the two for loops to have all the tunnels indexing but that did not work either.

 

Cheers.

0 Kudos
Message 1 of 14
(3,907 Views)

You were not autoindexing on your first loop.  But it looks to me like you are making things way too difficult.  There is a simple function to handle all of your formatting of the arrays: Array To Spreadsheet String.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
0 Kudos
Message 2 of 14
(3,880 Views)

In addition to what Tim just said, you really should try to use less code for all that!

 

Here's an equivalent code fragment that does exactly the same thing (file name, header and all) with much less effort.

 

Filer.png

Message 3 of 14
(3,874 Views)

Interesting, I figured this should be an easy task. I actually have tried this before, and it doesn't give me all the same data in columns like it should. I can post the whole code (which I did not write), maybe you would be able to see what is causing this error? Because I have no idea what would be causing this. I'll attach an example of an output I received from this exact VI.

 

Note: The portion of code you will be looking for is in the top right of the block diagram

 

Thanks!

Download All
0 Kudos
Message 4 of 14
(3,838 Views)

Thanks for the advice! I do need to clean things up in the VI, but I have been trying to get some things added to the VI before perfecting it. In regards to the issue I am still having maybe you would be able to see the issue with the actual VI and output I posted above? 

0 Kudos
Message 5 of 14
(3,837 Views)
Solution
Accepted by topic author etvg

Your issue is that Marker value is forcing the Build Array to put everything into a single 1D array, therefore giving you a lot of columns in a single row instead of 7 columns over many rows.  You need to duplicate your marker value to make it match the length of your other arrays.  I would do it this way.

 

Alternatively, add the marker inside of the FOR loop and that will make things A LOT simpler.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
Message 6 of 14
(3,829 Views)

I completely overlooked that, thank you so much!

0 Kudos
Message 7 of 14
(3,820 Views)

Thanks for the tips, I went ahead and made it look a lot cleaner! simplified_save.PNG

0 Kudos
Message 8 of 14
(3,815 Views)

What's the point of the sequence structure? Doesn't really do anything useful.

0 Kudos
Message 9 of 14
(3,804 Views)

There isn't really a purpose, I believe whoever wrote the code originally just used the sequence structures as a method of segregating different portions of the code. I just left it in there for the purposes of keeping it consistent with the rest of the VI.

 

Cheers

0 Kudos
Message 10 of 14
(3,786 Views)