To download NI software, including the products shown below, visit ni.com/downloads.
Overview
This example generates random numbers then compares them to a limit and writes the numbers in a tab delimited file
Description
This VI uses the random number generator to get a number every second between 0 and 100. It then compares that number to a user defined "limit." When the value is greater than the limit, a boolean on the front panel lights up. Every time the loop iterates, it writes the values to a spreadsheet selected by the user. It will give the iteration, date, time, value, and whether it is under or over the threshold.
The VI writes header information to a specified file, separates each column by a tab character, and finishes the string with an end of line character to signal the end of the row. Inside the while loop it acquires a random number, compares the number to a user-defined limit, displays the number on a chart, and formats and writes the data to a file. The VI will then close the file and check for errors outside of the loop. The information is stored in a file using a tab-delimited format, not .xls or .xlsx, and can be used to create human-readable text files. The file that is saved can be opened in Microsoft Excel with the proper column separation.
Requirements: LabVIEW Full Development System 2012 or compatible
Steps to Implement or Execute Code
Additional Information or References
VI Code Screenshot
**The code for this example has been edited to meet the new Community Example Style Guidelines.**
Example code from the Example Code Exchange in the NI Community is licensed with the MIT license.
Nice document
i wante it
thanks
When using mac amd MS office for OS, the spreadsheet file extension should be xls. If using .xlsx, there will be error.
A new thought for creating customized file.thanks