SIGBUS error.

I have add better success with the attribute modifier.

Why don’t you make the log file data immune to this, by serialising it, using ascii, or xml etc.

Thanks, mario. But will the speed become slower compared with the binary approach? The file write operation consumes quite a lot of cpu time.

Regards,
Eric

In general yes it will create bigger files. If you have double value which uses up 8 bytes, and many but if you are carefull about it ( avoiding printf like fct ) you can minimise the impact. If you use Photon you could use PxConfig*.

Depending on the size of the writes, it may be better to use open() then fopen(). Or use fopen() and increase buffer size with setvbuf. Overhead can be reduce drastically. What kind of hardware is this, writing to disk is typicaly done via DMA and doesn’t use much CPU.

What is nice about using some soft of ascii based file is that if the creator adds/remove a field, the code that decodes it will not be affected.

Where I work everything is XML based. Our real-time code runs on QNX and all the GUI is on Windows(Java) and all the data exchange is done through XML. It does add overhead CPU wise but it MUCH more easier to deal with.

Same here with our differences being that the GUI is in C# and we exchange live data via sockets. But all our configuration files and permanent data storage is done via XML.

Tim

We use the Poco C++ library for that, lovely stuff.

thanks, we have managed to create the log file with ascii method and the timing is just as good as before.

btw, my target is the OMAP3530 based Gumstix board, the log data is directly written to the sd card instead of onboard NAND, which i believe should be faster than writing to the sd card.

Regards,
Eric