09-29-2008 12:09 AM
hi,
i want to write a simple report in .txt format which contains details such as test name lower and upper limit, measured value and the test result. Do i have any predefined functions or vi's available or ill have to use file write and other file functions. Also i want to write only 90 characters per line. How do i set this and other formatting?
Thanks
Jay
09-29-2008 12:48 AM
Hi Jay,
To write a report in a .txt format, I suggest using the write to text file function found in the Functions Palette > Programming > File I/O folder.
Writing to the text file is similar to writing to a string indicator, as all data format are in ASCII.
To verify the text and format of the report is what you want, you can simply create a string indicator on the front panel to view the text to be written.
The programming design should be in the form of Open file > Write to file > Close file.
Hope this helps! Let me know if you need more detailed instructions.
Rgds,
YOUSI
Applications Engineer
NI ASEAN
09-29-2008 01:42 AM
hi Yousi,
09-29-2008 01:46 AM
hi Yousi,
Thanks for that info. But what i exactly need is tht ill be opening this .txt file in a text editor which may be a notepad or a textpad. Now can i configure the settings like number of characters in a line , spacing i need (tab) between every string and stuff lik that from labview? Also i have another querry. Can i use a rich text box instead of a string to display?
Thanks
Jay
09-29-2008 05:27 AM
Hi Jay,
You can format the report in the layout that you wish to have, unfortunately, there are no single-icon solution.
As I mentioned, in the txt format, all data are manipulated in the ASCII (string) format, you can use the functions available in the Functions Palette > Programming > String folder
to programmatically format your report. (for example, read the number of characters in a paragraph and limit them to 90 characters in a line, adding tabs and carriage returns at appropriate positions, etc)
I suggested to use the string indicator so as to minimize your debugging, once you are happy with the string indicator result, writing to the text file will be the same.
Of course, you can still use the rich text box to display the result, but that would be more tedious.
Hope this helps!
Rgds,
YOUSI
Applications Engineer
NI ASEAN