LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Format Into File bug, repost#2

Dear All,
I have found a strange bug/feature in Format Into File.  A 3 digit integer number argument (eg. 123) together with the format string " %04d" should result in " 0123" being written to file but instead fails with error cluster;
 
STATUS=TRUE
CODE=4
SOURCE=Format Into String in format_into_file_bug.vi. 
 
I have appended a demo VI. Can anybody reproduce /explain this? My platform is WINXP Pro, LV6.1
 
Thanks
Tom Crane
 
Ps. *Please* can anyone tell me how to delete unwanted posts from this BBS?  I find hitting the TAB key in IE -- a pretty innocent activity, which I constantly do without thinking results in multiple aborted posts, which I cannot see how to remove.  My apologies for those posts.  
0 Kudos
Message 1 of 9
(3,259 Views)
What type of file are you trying to save? Error Code 4 is End of File Encountered. I am using LV7.1 WinXP and cannot duplicate your error. Post you code and maybe I can help.
Andrew Alford
Production Test Engineering Technologist
Sustainable Energy Technologies
www.sustainableenergy.com
0 Kudos
Message 2 of 9
(3,243 Views)
Thanks Andrew,
I swear I did attach the demo VI to the original post!  This BBS system is beginning to get to me ;-(
 
Tom.
0 Kudos
Message 3 of 9
(3,235 Views)

Ok, I am not getting an error, however, I am running LV7.1. Try deleting the "Open/Create/Replace File.vi". The Format to File vi will bring up the file dialog it self (in LV 7.1 anyway).

What file type are you trying to save?

Have you tried saving to an existing file and creating a new file?

If that doesn't help hopefully someone with LV6.1 can help you out

Andrew Alford
Production Test Engineering Technologist
Sustainable Energy Technologies
www.sustainableenergy.com
0 Kudos
Message 4 of 9
(3,228 Views)

Hi,

I have just tried saving to an new file and to an existing file.  I also removed the Open/Create/Replace File and repeated the tests.  All 4 tests fail with the same error.

Cheers

Tom.

0 Kudos
Message 5 of 9
(3,219 Views)
I have tried your demo using LabVIEW V7.11.  Worked out of the box, no errors.  I do not have LV V6.1 on any machines.  Have you tried using the format into string and then the write characters to file? Instead of the format to file function?

Paul
0 Kudos
Message 6 of 9
(3,212 Views)
Works over here, Tom.  Running LV 7.1.1  with XP.
- tbob

Inventor of the WORM Global
0 Kudos
Message 7 of 9
(3,211 Views)
I found a pc with 6.1 and confirmed the bug. The file will write with %d but not %4d or %04d. If I write to a file with %d and then change to %04d and write to the same file, the error code goes away. Like Paul mentioned, if you use Format to String and then Write Characters to File, everything seems to work okay.
0 Kudos
Message 8 of 9
(3,202 Views)
Dennis, thanks for confirming it on LV6.1.  I also found that "%04d" would work but not "\s%04d".  It seems to be the combination of the space and the field width specification that fails.

Cheers
Tom

Ps. Does anyone know if the Usenet newgroup comp.lang.labview which this BBS gateways into, also propagates the other way?  It irritates me that one unintended hit of the TAB key in a web browser on this BBS generates multiple unintended posts, which AFAICT there is no way of canceling.
0 Kudos
Message 9 of 9
(3,170 Views)