From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

writing string into spreadsheet


@Dennis_Knutson wrote:
User the build array function.

Ah.  Now it all makes sense to me.

 

You are trying to build an array by using a FOR loop.  You are making the loop iterate the number of times as the while loop iteration count.  Then the Write To Spreadsheet File is set to overwrite your file each time you write.  So, since you have looped 6 times, you are making an array of your last recieved data 5 times and then overwriting your file with that.


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 11 of 19
(662 Views)

my issues s in writing spreadsheet....i was unable to write the serial data properply in ms excel alne...i can write it properly in wordpad...from first my auto indexing is on ..even after that i cant able to write it.....i am expecting a solution zealot.......kudos...................

0 Kudos
Message 12 of 19
(654 Views)
Did you get rid of that silly for loop? You are writing to Excel with the function so I don't understand your comment.
0 Kudos
Message 13 of 19
(648 Views)

@nishar10 wrote:

my issues s in writing spreadsheet....i was unable to write the serial data properply in ms excel alne...i can write it properly in wordpad...from first my auto indexing is on ..even after that i cant able to write it.....i am expecting a solution zealot.......kudos...................


Did you try the build array as suggested? Please just mention the input and the output that you expect. That will clear a lot of things

0 Kudos
Message 14 of 19
(636 Views)

ya i used build array ...but the data`s are not updating  in spread sheet... my input is a string which is getting from a serial interface device... i have to write it in excel and wordpad... i am writing it properly in word pad...but in spread sheet i cant.i am getting the 1st data once,2nd data twice,3rd data thrice...(1,2,2,3,3,3).goes on.... i need it like this (1,2,3)

0 Kudos
Message 15 of 19
(630 Views)

Why dont you post your vi? First my suggestion is forget about writing the data. See if you are able to get the desired output in array format . Check that in your indicator. You can always write this with no issues.

0 Kudos
Message 16 of 19
(625 Views)
That does not make any sense. No where are you writing to excel. All that you need its a single file write. The Write to Spreadsheet creates a text file.
0 Kudos
Message 17 of 19
(622 Views)

Whatever data you are getting from serial port (string) you simply need to pass it to build array function(to convert it into array format) and then pass this 1 d array directly to write to spreadsheet function.

Make sure that you have griven "append to file" input as true to write to spreadsheet file function. otherwise data in the file will be overwritten and you will get only last iteration value.

 

0 Kudos
Message 18 of 19
(612 Views)

@nishar10 wrote:

ya i used build array ...but the data`s are not updating  in spread sheet... my input is a string which is getting from a serial interface device... i have to write it in excel and wordpad... i am writing it properly in word pad...but in spread sheet i cant.i am getting the 1st data once,2nd data twice,3rd data thrice...(1,2,2,3,3,3).goes on.... i need it like this (1,2,3)


Go back to my post 11 (http://forums.ni.com/t5/LabVIEW/writing-string-into-spreadsheet/m-p/2899578#M840986).  I described exactly what is happening.  Here are the things you need to do to fix it.

1.  Get rid of the FOR loop.  Use Build Array with just 1 input.  You will have a 1D Array with just your one string.

2.  Wire in a TRUE to the Append? input of the Write To Spreadsheet File.


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 19 of 19
(599 Views)