C datalogging program freezes?

C, C++, and Visual C++
axle
Phidgetsian
Posts: 14
Joined: Thu Sep 29, 2011 2:26 am
Contact:

C datalogging program freezes?

Postby axle » Thu Apr 19, 2012 9:02 am

I have written a C program that polls data from sensors and writes it line by line to a csv file. This used to work fine but recently the program seems to 'freeze' in the middle of writing a new line.

An example of the code I use to write data is shown below.

if(IMU_1_Connected)
{
fprintf(file, " %.5f, %.5f, %.5f,", IMU_data[0].acceleration[0], IMU_data[0].acceleration[1], IMU_data[0].acceleration[2]);
}


This is just about all I know about the issue at this moment. Does this sound like a memory issue or something similar?

axle
Phidgetsian
Posts: 14
Joined: Thu Sep 29, 2011 2:26 am
Contact:

Re: C datalogging program freezes?

Postby axle » Fri Apr 27, 2012 6:50 am

ok so it turns out that it was a memory problem. The program was causing a sudden spike in memory usage which exhausted available memory and which would stop the execution of the program. I freed up some memory,disconnected a few sensors and voila it works.


Return to “C/C++”

Who is online

Users browsing this forum: No registered users and 9 guests