LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Program not writing to file

Hello all : )

I have made a program and am trying to use the write to file function. I am opening it with microsoft word and notepad, and the values for each are just 0.000 for however many values I have collected. Any suggestions?

0 Kudos
Message 1 of 7
(2,549 Views)

How small are the numbers you are trying to write?  Are they less than 0.0005?  Do you have any values in your array called "Charge"?

 

By the way, why in a few places do you split wires, but not use the split.  In the For loop near the stop termianl of the while loop, you split the wire and send it to two auto indexing tunnels, one you use, the other you don't.  In the For loop containing the formula node, you have an autoindexing input which you send to the formula node, but before that you send a branch to the for loop and it is an auto indexing output tunnel.  But you don't use it.  Even if you did, it would be the same array as the array going into the For loop.  I don't know how many elements you have in your arrays, but it makes unnecessary data copies.

Message Edited by Ravens Fan on 06-12-2009 04:54 PM
0 Kudos
Message 2 of 7
(2,542 Views)

oops..I had some cleaning up to do. sorry about the confusion, I think that I removed all of the excess wires.

And yes, my values are smaller than that. They are around the 10 e-12 range. Is there something special I have to do for small values?

Thanks again for your help!

0 Kudos
Message 3 of 7
(2,509 Views)

sbev001 wrote:

And yes, my values are smaller than that. They are around the 10 e-12 range. Is there something special I have to do for small values?


Your format string is %.3f. This means 3 decimal places. For a number in the 10E-12 range this is simply 0.000, so the number you get in the file is absolutely correct, based on what you told it to write out. Change your format string to %f or %g. Look at the LabVIEW Help for that function - it contains a link to the format string specifier syntax.

Message Edited by smercurio_fc on 06-15-2009 09:00 AM
0 Kudos
Message 4 of 7
(2,501 Views)
Yes.  Try changing your format code to %g so that it saves the value in scientific notation.
0 Kudos
Message 5 of 7
(2,498 Views)

Thanks, that worked! I was just going through and testing and realized that I wasn't getting the results that I wanted. I want for each charge to add on to the previous value in the array, so that the end result is a the total integrated charge. How would I set this up?

Thanks again for your help : )

0 Kudos
Message 6 of 7
(2,490 Views)

Store your total charge in a shift register.  Each loop iteration, add the new value to the value in the shift register and put it back in the shift register.  Remember to initialize the shift register with zero.

Message Edited by Ravens Fan on 06-15-2009 11:51 AM
0 Kudos
Message 7 of 7
(2,486 Views)