06-27-2011 04:36 PM
Hello,
I do it in the timed loop. Here is my post with my problem. There are files with my project. I changed a little bit since then but an idea is the same.
Kamil
06-28-2011 01:12 PM
Hi Nemesis,
Since you are performing the File I/O in a timed loop, what is most likely happening is that the disk operation is taking too long and your thread is becoming starved. When this happens, the cRIO no longer has time to communicate to your host and you lose connection.
I would recommend either:
1) Increasing the period of your timed loop
2) Not writing to file as often (batch)
3) Configuring your program into a Producer/Consumer architecture where your consumer does the file I/O
It makes sense that writing to the USB drive takes less time as it will be flash memory, having much lower overhead for file I/O.
Have a great day,
Chris V
06-28-2011 02:38 PM
Hi Chris V,
Thank you for your tips.
Some explanations, I want to find a transfer function of my system and I did project that allow me to record data for different frequencies. (Link above)
Regarding the tips:
1) If I increase the period of the timed loop I will not be able to save sufficient number of samples, especially for higher frequencies. Or another way, is it possible to save a packets of samples. I mean read for example 10 samples from faster loop and then save these 10 samples in other loop once?
2) I would like to have separately file for each frequency. If I save it in one file for example, afterward I have to do post-process of data.
3)I though that I am doing a producer/consumer loop but maybe I do not understand principle. I have to read again. (any links will be appreciate)
Your explanation regarding USB has a sense and good to know.
Kamil
06-29-2011
04:16 AM
- last edited on
05-21-2025
03:45 PM
by
Content Cleaner
I found this links:
It makes me clear with memory and writing. I will try to follow tips that are inside.
Kamil
06-29-2011
10:13 AM
- last edited on
05-21-2025
03:46 PM
by
Content Cleaner
Hi Nemesis,
That second link is definitely a good one.
Check out this one too for a good explanation of the Producer/Consumer Architecture: https://www.ni.com/en/support/documentation/supplemental/21/producer-consumer-architecture-in-labvie...
Have a great day,
Chris V
06-29-2011 02:14 PM - edited 06-29-2011 02:20 PM
Just I want to add that in the first one is explained about the time of saving on the disc. It is not recommended to do it faster than one minute. I think there is problem why my project is crashing.
Anyway thank you for help and time.
Kamil