LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Send list data to a spreadsheet

data writing.JPG

I am sending 3 columns of data to a write to measurement file as shown.  The first column is data from a menu ring (though it could also work as a text ring)  and it is meant to be a label for the other 2 pieces of data.  I would like you to be able to select an item from the ring, and have it send the text, not the item value, to the write to measurement file (i.e. I want it to send the blk-wht, blk-red, red-brn, etc) but the way it is set up it only sends the item value (i.e. 0, 1, 2, etc).  I tried unchecking the sequential values box and changing all the values to text (blk-whit, blk-red, etc)  but when I hit "OK" it just automatically resets it to sequential numeric values.

Maybe there is a setting under preferences that I don't see, or maybe I should be using something other than a menu ring.

 

0 Kudos
Message 1 of 11
(3,589 Views)

Heres an example shoing how to get the strings from a Combo Box, a Text (or menu) ring and an enum. 

 

untitled.PNG

Note the Text.Text property is available for any of these objects


"Should be" isn't "Is" -Jay
Message 2 of 11
(3,583 Views)

Thanks for all the help.

My issue now is a data-type / formatting issue.

The combo box is great and allows me to make the values match my items (which is exactly what I want),

However, I have to convert the string to another format in order to send it to the "Build Array."

The only one I've found so far is the "string to byte array" (as shown in my block diagram below).

The data as it is written is displayed in the excel chart (on the left)

The first 3 lines were when I used the .vi in the first post

After that you see the next 9 lines, which are printed from 1 run with the combo-box / string to byte array set up shown below.

The second 2 columns of data are still there but are now treated as elements of the same column, and each letter of text is changed to a number and placed as seperate elements in the 1 column as well.

The data should look just like the first 3 lines except the text (blk-wht, blk-red, etc) in the left column where you see "0, 1, 1"

 

data writing.JPG

0 Kudos
Message 3 of 11
(3,572 Views)

Also, I'm not familiar enough with labview to recognize the functions you use in your 3rd and 4th example by their images, can you give me the names of them so I can try them out too?

0 Kudos
Message 4 of 11
(3,570 Views)

The first is Index Array found in the arrays functions pallette.  The second is Format into String found in the strings pallette.

-----------------------------------------------------------------------------------------
Reese, (former CLAD, future CLD)

Some people call me the Space Cowboy!
Some call me the gangster of love.
Some people call me MoReese!
...I'm right here baby, right here, right here, right here at home
Message 5 of 11
(3,559 Views)

@LarsUlrich wrote:

Also, I'm not familiar enough with labview to recognize the functions you use in your 3rd and 4th example by their images, can you give me the names of them so I can try them out too?


Also, the "format into file function" on the File palatte would be well worth checking outSmiley Wink  The help on this function should point you to a better solution that "write to measurements file" since that Express vi actually offers less flexability

 

write to measurements file won't accept stringsSmiley Sad- Hmmmmm... Not that I care since I so rarely use Express vi'sSmiley Very Happy but still..... Perhaps the express vi needs a tweak to allow formatting of inputsSmiley Surprised


"Should be" isn't "Is" -Jay
0 Kudos
Message 6 of 11
(3,552 Views)

Thanks for the the tip about the format into file function.

What I don't see however is something like the "append to file" setting that is in the write to measurement file.  The way my program works is that I press a button, it takes a measurement, and then writes that measurement to a file.  Then I have to change some real world stuff around (stuff not in labview?  I didn't know what else to call it).  Then I hit the button again, it takes a measurement, and then adds the new measurement to the file, and this I repeat about 20 times for 20 data points.

It looks like with the format into file function that I will have to build the whole 3 column spreadsheet in labview and then export the whole thing once?

If so, this is something I don't know how to do yet and will take some fooling around on my part.

0 Kudos
Message 7 of 11
(3,543 Views)

By the way, is STRING the only data type that can carry text?  It looks like it is but I was wondering if maybe I missed something...

0 Kudos
Message 8 of 11
(3,536 Views)

Try something like this.

 

Did you READ the help for format into file?  Did you look at the Detailed help?  Did you open the example?  Ctrl+H is your best friend

1.png


"Should be" isn't "Is" -Jay
Message 9 of 11
(3,531 Views)

Yes, yes, and no, I just opened it now.  Thanks for the help 😄

Message 10 of 11
(3,529 Views)