07-22-2011 08:27 AM
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.
07-22-2011 09:22 AM
Heres an example shoing how to get the strings from a Combo Box, a Text (or menu) ring and an enum.
Note the Text.Text property is available for any of these objects
07-22-2011 10:11 AM
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"
07-22-2011 10:13 AM
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?
07-22-2011 11:00 AM
The first is Index Array found in the arrays functions pallette. The second is Format into String found in the strings pallette.
07-22-2011 12:05 PM
@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 out 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 strings- Hmmmmm... Not that I care since I so rarely use Express vi's
but still..... Perhaps the express vi needs a tweak to allow formatting of inputs
07-22-2011 01:02 PM
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.
07-22-2011 01:13 PM
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...
07-22-2011 01:18 PM
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
07-22-2011 01:20 PM
Yes, yes, and no, I just opened it now. Thanks for the help 😄