LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Limiting string size

Howdy Y'all,

 

I am puzzled and hope someone can help. 

 

I take a 1D array of dbl, length 8. use the array to spreadsheet string to change to a string using a comma as a delimiter and %.3f for formatting. Size of this string is 8. I bundle this with similar length 8 strings. Unbundle this to concatenate a few labels into the string. And then use the "write to text file". When i open this text file and look at these "length 8 strings" they are thousands of strings long. Example

 

1.1,2.2,3.3,4.4,5.5,6.6,7.7,8.8,0,0,0,0,0,0,0,0,0,0,0,0,0...

 

These zeros really mess up what i am trying to do when i put this text file into an excel spread sheet.

 

Anyone have an idea why these zeros are being added to the end of the strings?

 

Brandon

0 Kudos
Message 1 of 7
(2,698 Views)

No idea at all.

 

But if you attached a VI that showed us what you are actually doing, rather than a verbal description of what you think you are trying to do, it may be a lot easier to have an idea.

0 Kudos
Message 2 of 7
(2,686 Views)

see attached. it is a subset of the entire vi and shows all the information that i think is needed. I cannot provide the entire VI

0 Kudos
Message 3 of 7
(2,658 Views)

Your use of local variables point to possible race conditions (ie your data is not there yet and therefore show up as zeros).  And your array manipulation is horrendous.  Prime candidate for the Rube Goldberg thread.  It can be simplified to this:


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 4 of 7
(2,641 Views)

I knew there had to be a better way. That's what i get for being completely taught by google. 

 

As far as the local variables go, is there another way to pass data from one location to another without using wires or local variables (i'm sure there is, if you could point me in the correct direction.)?

0 Kudos
Message 5 of 7
(2,638 Views)

brandon.laumer wrote:

As far as the local variables go, is there another way to pass data from one location to another without using wires or local variables (i'm sure there is, if you could point me in the correct direction.)?


Depends on your requirements.  Use wires whenever possible.  If going to another loop, I use Queued and User Events for most things.


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 6 of 7
(2,627 Views)

So I took the unbundled string of the spec 1 values and sent one of them to a text file. When i did this, the extra zeros were not there. 

 

And now i replaced it to its original version and the zeros are also not there....... ugh

0 Kudos
Message 7 of 7
(2,624 Views)