08-13-2007 07:08 AM
08-13-2007 09:10 AM - edited 08-13-2007 09:10 AM
You've posted this question to the Dynamic Signal Acquisition board instead of the LabVIEW board.
Your main problem is that you have the file write outside the loop where you are generating the data. This cannot work. The file write loop will not receive any data from the other loop until the other loop finishes. The ay you have it wired, the file write loop would also only get the result of the very last iteration of the other loop. These are basic dataflow principles in LabVIEW.
You can place an elaspsed time function in the main loop set to 600 msec and put the file write inside a case statement. Wire the Time has Elapsed output to the case statement. You could also use the Quotient and Remainder function in a manner as shown below to write every third iteration.
Message Edited by Dennis Knutson on 08-13-2007 08:10 AM
08-13-2007 09:37 AM
08-13-2007 10:09 AM
It is writing every third iteration but every time the file write is called, you are writing the entire table. You would want to get the last three rows and just write those. And please, don't use a local variable. Just wire the data into the case structure.
The Quotient and Remainder works the same was as the modulo function in other languages. The output counts 0,1,2 and repeats. 0 divided by 3 equals 0 with no remainder. 1 divided by 3 is zero with a remainder of 1. 2 divided by 3 is zero with a remainder of 2. 3 divdided by 3 equals 1 with 0 remainder. 4 divided by 3 equals 1 with a reaminder of 1, etc.
08-14-2007 01:14 AM
That makes sense, thanks!
But how can I only write the actual row of the table with every third iteration? Maybe with the bundle by name function? I don't know how to use it exactly (which cluster should I wire there?)? Could you help me one more time?
THANK YOU!
08-14-2007 03:40 AM
Hi Dennis,
now I have a VI which writes every third iteration the actual row to the file, but I think it overwrites every time as I only have one value at the end: (
Can you have a look at my posted VI?
Thanks
08-14-2007 09:41 AM
08-14-2007 11:40 AM
Hi Dennis,
almost!: ) Thank you very much for your help.
Now I want to delete the contents of the file when I start the program, so that I only have the values from one run in the file. Do you know what I mean?
Right now it alway starts writing at the end of the old run, so it will become a very big list (file).... I want to start at the beginning of an empty file every time I run the program.
08-14-2007 12:37 PM
08-15-2007 05:06 AM
Thank you very much, Dennis.
Now I got what I want: )
THANK YOU