LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

how to convert table to control

In my attached VIS, I am giving user input values to controls,the user input control values i am passing to a table and writing text file.how can i do exactly opposite of that what i am doing now.that means reading same text file(that i already written), pass these values to a table and from table pass these values onward to controls.Moreover in time control, when i give time in HH:MM:SS.it does not appear in the same format in the table or it also does not appear in the same format in text file.why?
0 Kudos
Message 1 of 4
(2,853 Views)
You're not using a time control. Your're using a string control and Fract/Exp String to Number doesn't know how to convert HH:MM:SS to a number. It will only convert the HH before it encounters a separator it can't handle. Use a real time stamp control (on the numeric palette) and convert to a DBL (Numeric>Conversion palette), use a numeric control set for time (Format & Precision), or parse out the string and convert to a numeric by multiplying hours by 3600, minutes by 60, and then adding them both to number of seconds.
Message 2 of 4
(2,853 Views)
yes this is time HH:MM:SSworking fine,thanks for that but my second question was in my VI, how can i go in opposite direction.i mean read text file in the same table and pass these values to controls.now i am already giving some values in the user input and passing them to table and writing the file, but i also want to do the opposite as well.
Thanks
0 Kudos
Message 3 of 4
(2,853 Views)
You just have to do the opposite of writing. Do a read characters or read from spreadsheet file modified to return strings. Directions for the modification is explained on the diagram. This should give you a 2D string array that you use to write to a local variable of the table. Then index the array in the reverse order that you created them. Where you used Number to Fractional String, use Fract/Exp String to Number and then write the results to local variables of your numeric controls.
0 Kudos
Message 4 of 4
(2,853 Views)