12-19-2006 11:39 AM
I have an inner acquistion loop running at a rate of 32Hz for 1 second and an outer loop which has the write to file vi. The file write operates on the TimeBetweenPulses array. The main vi Javed concept - processing.vi and its sub vis are attached. I have also attahed a screenshot of the vi running.
From TimeBetweenPulses array you can see that the numbers 7.59, 2.56, 4.18, 3.59, and 7.15 but when I open the file write-read example.txt the entry 7.15 is missing. The vi seems to miss the firat reading immediately after the inner loop has restarted its 0 to 31 count. I have tried using differing write file vis and placing it inside the for loop with a case select loop but with no success.
Running on Labview 8.2
Any ideas as what is causing this?
Javed
12-20-2006 05:53 AM
Hi Javed,
If I rewire your VI to just a write of the data if works OK. Can you simplify your Vi to just a write data and see what happens ?
12-20-2006 11:28 AM
You mean remove the front panel display for the array and just leave it writing to file?
I will give this a try.
Best regards
Javed
12-21-2006 03:51 AM
Hello Javed,
I've had a look at your code and from what I can see the data points are all being written correctly. Ive slightly altered what is written to the text file to illustrate that no data points are being dropped. It could be the way your other subVIs and main VI is manipulating the arrays of data. To test this VI I used a counter input and everything returned as expected. It may be beneficial to trace exaclty what your arrays are doing exactly before they are manipulated and written to the text file.
Look at the attached code and see that the data is actually writing correctly.
Good Luck!
Tom.
NIUK
12-21-2006 08:03 AM
Hi Tom,
I had a look at your vi and the list of numbers that appear on the front panel array is still not identical to the output going to the write file.
It may be better if I rewrote the vi so that it outputs a simple double vi to file as it is writing to screen.
Regards
Javed
01-10-2007 06:26 AM
Finally back onto this vi since I last looked at it in December.
Managed to write an output element by element rather than array by array and this proves that the array output is consistantly missing the first element in subsequent For loop arrays. The only problem I see in my element y element output is that in my vi I compare the previous element 0 with the current element 0 and output only if a difference is found, this is to stop duplicates from appearing on the output file.
BUT
This will now cause me a problem when I actually do receive 2 time differences that ARE exactly the same, as they will not be output by the ElementByElement.
Possible Solutions?
Try and incorporate both element write and array write methods to output all data.
If anybody has any other ideas let me know.
Kind regards
Javed
Attachments
NewArrayFromArrayAltered_ElementOutput.vi (and subvis)
ArrayByArray.txt Outputs array at a time
ElementByElement.txt Outputs element by element
01-12-2007 05:53 AM - edited 01-12-2007 05:53 AM
Message Edited by K C on 01-12-2007 12:55 PM