LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

two strings and a numeric value to write to a measurement file

Hi all, I need to write two string values and a number value to file. I made a basic VI showing what is needed. I figured to cheat a little by sending my time stamp to the comment node. I then converted the id string to a decimal number and merged it to my numeric value. All is great with the output in Excel, accept my ID string dropped the last two digits and replaced them with a zero. Even if I used a numeric constant with this same value, it replaces the last to with zero's. The problem seems to reside with the write to measurement file VI. If I open it directly with wordpad it saves it as 2.602189E+8. Any ideas to save these three values?   Thanks
 
Gerald
0 Kudos
Message 1 of 6
(3,597 Views)
Opps, forgot my example. 
0 Kudos
Message 2 of 6
(3,588 Views)
When you use one of the Express VIs, you are limited to what you can do. The Write to Measurement File expects to writing measurements (numerics) and not string constants so eveything gets converted to floating point. You could probably modify it but using the lower level file I/O functions is just as simple. Here's a modification. I put the file write inside the loop because I would assume you want every value written. With your example, you would only save the very last iteration. If you do only want to save the last result, then it can be suitably modified.
0 Kudos
Message 3 of 6
(3,579 Views)
Thanks Dennis for your help. I got something put together last night on the train going home. I do want only the last iteration and it has the same concept as yours. I converted all into strings. I acutally saved myself a step because it rounds off floating points, which I was going to have to doing later anyways. I always seem to be more productive on the train these days rather than at the office. Thanks again


Gerald
0 Kudos
Message 4 of 6
(3,568 Views)
Instead of doing the string conversion and building the array with every iteration, why don't you move those operations outside the loop as well?
0 Kudos
Message 5 of 6
(3,564 Views)
Yup already thought of that. This is my whole project, you'll see that part at the end. Thanks Dennis

Gerald
0 Kudos
Message 6 of 6
(3,560 Views)