07-19-2007 12:35 PM
EXAMPLE I found on NI site:
I'd like to create a text file or batch file programmatically as teststand runs, but I can't find any features to perform this action.
Teststand does not support building text files or batch files programmatically, but we can use the command line to accomplish this feature. Use the Call Executable step, and call the executable cmd.exe, usually found at C:\WINDOWS\System32\cmd.exe. From the command prompt, the arguments that you will pass in are either:
Text File:
"/c echo (your message) >> C:\\test.txt"
Batch File:
"/c echo (your code) >> C:\\test.bat"
If you would like to put in multiple lines, you can use the '&' sign to cascade the commands which will result in a new line in the text file. For example:
"/c echo First line > C:\\test.txt & echo Second line >> C:\\test.txt
Something to note is that the command > will erase all previous text in a file while >> will append to the end of the file, and that the character for '\' in Teststand is represented by \\.
07-19-2007 03:46 PM
07-19-2007 04:09 PM
07-19-2007 04:30 PM
The reportgen_txt also provides for great flexibility without needing to use local variables and modifying how the the default process model works.
I don't get any error but I can't get it to write correctly. I still think the simplest way is to juse your string to a code module and do the write with the built-in file functions.
07-20-2007 08:30 AM - edited 07-20-2007 08:30 AM
Message Edited by Patrick P. on 07-20-2007 08:30 AM