LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

save data as a horizentall

Solved!
Go to solution

Hi

Could anyone offer some help as to how to save data  as a vertical.Following in my attachment all of my datas saved az a ahorizontal!

And also I will be happy if you told me can I add some text in front of my data as a explain outamaticlly?

Any suggestions would be greatly appreciated!! Thanks so much!

Sincerely,

0 Kudos
Message 1 of 15
(3,955 Views)

It would be nice if you could at least post your code.... Also your english and/or typing ability is a little unclear but I believe you just want to save each datapoint on a new line instead of being seperated by a tab:

 

For example:

 

17000000.000	1000.000	6.000	0.000	0.000	81.000	91.000	559.000	434.000

 

becomes:

 

17000000.000
1000.000
6.000
0.000
0.000
81.000
91.000
559.000
434.000

 

If this is true, try using:

 

Write Spreadsheet to File VI 

 

 

You are concerned with the bottom field "delimiter (\t)":

 

delimiter is the character or string of characters to use to separate fields in the spreadsheet file. For example, a value of , (comma) specifies a single comma as the delimiter. The default is \t, which specifies a single tab character as the delimiter.

 

Try wiring the End of Line String Constant to that input.

 

It would look like this:

 

Save Spreadsheet Per Line.png

 

*Note:  This is a Code Snippet and can be dragged into a LabVIEW window to make the code appear (if you save the file to your local machine first).

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
If someone helped you out, please select their post as the solution and/or give them Kudos!
Message 2 of 15
(3,943 Views)

Thanks for your reply.

yes you correct.

I want to save each data on a new line with some english name besides this data. But unfortunately I have not this icon because I work eith 7.1 version of LabVIEW!

0 Kudos
Message 3 of 15
(3,926 Views)

I add delimiter and I get the datapoint on a new line, thanks

but how can I add some text with my data?

for eample I like it shows me :

Exposure=1000

intensity=17000

and ....

0 Kudos
Message 4 of 15
(3,913 Views)
Solution
Accepted by topic author vsa

First convert your numbers to a String type using Number to Decimal String.  Once your numbers have the appearance of a string, you can put text with them.  So lastly you can use Concatenate Strings to concatenate (add strings together) your number in String format with other text:  

 

Decimal To String w Label.png

 

This code would create the following string:

 

label.png

 

Then you can save all your strings on a line using the same method as above. 

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
If someone helped you out, please select their post as the solution and/or give them Kudos!
Message 5 of 15
(3,900 Views)

I made this code exactly like you but I saw another problem that I attached it.

I use Fract/Exp String To Number for solving the problem but the datas are not appear in my file.

sorry about asking question alot!

0 Kudos
Message 6 of 15
(3,877 Views)

Ask as many questions as you need 🙂  Thats what the forums are for!

 

Your newest problem is that you are trying to build an array with different data types.  Arrays can only hold the SAME data type.  For example, an array of strings.  Or an array of doubles.  Etc.  You can read more about it here: http://www.ni.com/gettingstarted/labviewbasics/datastructures.htm#Arrays 

 

Your Builld Array function is causing the issue because you are trying to make an array with Strings and Ints and Doubles.  This is NOT allowed.

 

Try converting all your data into strings before trying to save them to file!  It should look something like this:

 

strings.png

 

Each of the Blue and Orange lines that represent Integer or Floating point numbers should also be converted into a string with the same VI (notice how I copied it for each line).  Then you can concatenate onto those like we did for "Exposure=" to get more text with your data.

 

Ultimately youll want something like this before you save to file:

 

p2.png

 

Note:  Your "parameters of trap" currently accepts a Double array.  If thats where you do your printing, make it accept a String array

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
If someone helped you out, please select their post as the solution and/or give them Kudos!
0 Kudos
Message 7 of 15
(3,859 Views)

I did all of your recommends but az you see in my new attachment the Concatenate Strings or Build Array can not transfer my datas correctly and I saw all of the datas equal zero!

 thanks

0 Kudos
Message 8 of 15
(3,839 Views)
Number to decimal string is just wrong and using concatenate string just complicates things. Just use the Format Into String and write the output to the Build Array.
Message 9 of 15
(3,832 Views)

no it is not wrong and complicates. maybe the Write To Spreadsheet File can not save correctly!

0 Kudos
Message 10 of 15
(3,820 Views)