04-07-2010 12:36 PM
Although a database would be ideal, the simplest way to save and send data is to use the Write To Spreadsheet File function. Use a comma as the delimiter and name your file with a csv extension (filename.csv). You can then open this file with Excel for viewing. If you name the file with a txt extension, you could open the file with Notepad, but it isn't as good as Excel because the columns won't line up. You can also just email the file to yourself as suggested.
04-07-2010 01:13 PM
04-07-2010 02:57 PM
I have a string that indicates a test has failed, and I can access it from the state machine. I have encorporated tab control so the user can tab to the test history, which will show the number of test sequences that have passed, the number that have failed, and the actual tests that have failed. All this information I plan to get from the state machine string.
I will have strings like "Power On", "HV ON", "TP2 Vct", etc. I can then seperate the strings and count them in case structures. Then use a local variable to pass them to the while loop that runs the front panel and Write to Spreadsheet File.VI for e-mailing. Is this the easiest way?
Do you have any snippets or examples that may help me?
04-07-2010 03:28 PM
04-07-2010 05:16 PM
Okay, here is my vi. Be nice, like i said, I have limited time to do this, and I'm sure it is not the best, I know there are a lot of things I could do different.
I have placed the write to spreadsheet inside a diagram disable because I cannot figure out how to make the string compatible with the write to spreadsheet. I have written to Excel templates in the past, and may just want to do that.
From the front panel, you can see that I have incoporated the tab function and am using the error output from the state machine (and the current state variable) to increment the failed test number. This works good, and will not reset when the vi is re-started. So that is good.
By the way, is there any advantage of using a property node to read a value, instead of a local variable?
I do have the internet toolkit, so I will take the advice and just e-mail myself the data at the end of the week.
04-07-2010 06:02 PM
Your VI is way too large. You should use subvi's to cut down the size of the block diagram so that it will fit on one screen without having to scroll up and down and left and right. As for the Write to Spreadsheet File, you should wire in a file path so that you don't get a dialog box when this function tries to execute. If you want to be able to open the file in Excel, wire in a comma to the delimiter input. Your input to "append to file" is a True constant. This is OK if your file already exists, but if it doesn't, you should create a new file by wiring in a False constant. You can change this by testing your iteration terminal (i) being not equal to 0. Wire the output of not equal to 0 to the "append to file" input. First loop iteration will create a false and a new file is created. All other iterations will create a True and an append will take place.
Here is a small example: