|
|
|
![]() |
|
|||||||
|
||||||||
![]() |
|
|
Thread Tools | Rate Thread | Display Modes |
|
|
|
#1
|
|||
|
|||
|
Data Logging to cRIO using c++
We've been attempting to log binary data to the cRIO using C++. We are able to log to a file and upload it to the PC, but the file is getting corrupted. We are logging floating point numbers at a 200 Hz rate. Looking at the log file in a hex editor, we can see that several dozen floating point numbers will get logged just fine. Then we will see the first two bytes of a new float, and then the next float will appear in the file. We are logging doubles, so each float is 4 bytes long. In other words, two bytes of the four byte float is written, then the next full float is written. We are using ioLib to perform the data logging.
Has anyone had success logging data to directly to a cRIO file? |
|
#2
|
|||
|
|||
|
Re: Data Logging to cRIO using c++
We have had experience logging to a file on the cRIO and then pulling the file off via FTP in C++ and Java. Just wondering, why did you chose to log the data into a binary file over a more-readable text file form?
|
|
#3
|
|||||
|
|||||
|
Re: Data Logging to cRIO using c++
Have you tried using the C standard library instead of ioLib?
|
|
#4
|
|||
|
|||
|
Re: Data Logging to cRIO using c++
There is nothing wrong with your approach, so there must be something wrong with the implementation.
Review the code that writes the binary to ensure that it writes what you expect. Pay special attention to conditional code. ftp the file three ways, once using binary mode, once using text mode, and once with automatic. Use file size or contents or diff to determine if the auto matched binary or text. My suspicion is that the file was corrupted during the transfer using text mode. Review the code that parses the binary file, again paying close attention to any conditional code. Greg McKaskle |
|
#5
|
|||
|
|||
|
Re: Data Logging to cRIO using c++
We were unknowingly doing an ASCII FTP file transfer. Changing to a binary transfer fixed our problem. Thanks for all the suggestions.
|
![]() |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|