Go to Post "Why do it the easy way when you can do it the hard way?:rolleyes:" - EricH [more]
Home
Go Back   Chief Delphi > Technical > Technical Discussion
CD-Media   CD-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
Closed Thread
 
Thread Tools Rate Thread Display Modes
  #1   Spotlight this post!  
Unread 17-11-2013, 14:32
raflood raflood is offline
Registered User
FRC #0967
 
Join Date: Nov 2013
Location: CEDAR RAPIDS
Posts: 2
raflood is on a distinguished road
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   Spotlight this post!  
Unread 17-11-2013, 15:04
Aaron.Graeve Aaron.Graeve is offline
Registered User
FRC #1477 (Texas Torque)
Team Role: Alumni
 
Join Date: Jan 2012
Rookie Year: 2012
Location: College Station, Texas
Posts: 103
Aaron.Graeve is a name known to allAaron.Graeve is a name known to allAaron.Graeve is a name known to allAaron.Graeve is a name known to allAaron.Graeve is a name known to allAaron.Graeve is a name known to all
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?
__________________

2016:
Alamo, Bayou, and Lone Star Regional FTAA
2015:
Dallas, Alamo, Bayou, and Lone Star Regional FTAA
2014:
Alamo, Dallas, and Lone Star Regional FTAA
Alamo Regional Robot Inspector
2013:
Einstein Champion and 2013 World Champion (Thanks 1241 & 610), Galileo Division Champion, Razorback Regional Winner, Alamo Regional Semifinalist, Bayou Regional Semifinalist, Lone Star Regional Quarterfinialist
2012:
Curie Division Semifinalist, Lone Star Regional Finalist, Bayou Regional Winner, Alamo Regional Winner
  #3   Spotlight this post!  
Unread 17-11-2013, 15:48
connor.worley's Avatar
connor.worley connor.worley is offline
Registered User
FRC #0973 (Greybots)
Team Role: Mentor
 
Join Date: Mar 2011
Rookie Year: 2010
Location: Berkeley/San Diego
Posts: 601
connor.worley has a reputation beyond reputeconnor.worley has a reputation beyond reputeconnor.worley has a reputation beyond reputeconnor.worley has a reputation beyond reputeconnor.worley has a reputation beyond reputeconnor.worley has a reputation beyond reputeconnor.worley has a reputation beyond reputeconnor.worley has a reputation beyond reputeconnor.worley has a reputation beyond reputeconnor.worley has a reputation beyond reputeconnor.worley has a reputation beyond repute
Re: Data Logging to cRIO using c++

Have you tried using the C standard library instead of ioLib?
__________________
Team 973 (2016-???)
Team 5499 (2015-2016)
Team 254 (2014-2015)

Team 1538 (2011-2014)
2014 Driver (25W 17L 1T)
日本語でOK
  #4   Spotlight this post!  
Unread 17-11-2013, 20:30
Greg McKaskle Greg McKaskle is offline
Registered User
FRC #2468 (Team NI & Appreciate)
 
Join Date: Apr 2008
Rookie Year: 2008
Location: Austin, TX
Posts: 4,752
Greg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond repute
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   Spotlight this post!  
Unread 21-11-2013, 22:40
raflood raflood is offline
Registered User
FRC #0967
 
Join Date: Nov 2013
Location: CEDAR RAPIDS
Posts: 2
raflood is on a distinguished road
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.
Closed Thread


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT -5. The time now is 23:31.

The Chief Delphi Forums are sponsored by Innovation First International, Inc.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi