|
Re: File IO without overwriting file
I don't want to get off topic but,
Quote:
Originally Posted by Jon Stratis
I'm not sure how the clock works on the cRIO or what level of access we have towards getting a standardized timestamp, but... .
|
Unfortunately, the clock gets reset to Jan,1 1970 everytime the cRIO is started.
In the past I have played with reading system time from the Driverstation system clock and sending that over to the cRIO through the dashboard.
In Java there is no way to overwrite the system clock on the cRIO because the JRE doesn't allow access to the clock, you could do it with a JNI system call but I never went that far.
If you don't care about updating the system time on the crio, you could simply get a timestamp from the driverstation on robot startup and keep it in a variable and use that for time stamps, and use System time as a couter to count time since your "time sync".
Hope this helps,
Kevin
__________________
Controls Engineer, Team 2168 - The Aluminum Falcons
[2016 Season] - World Championship Controls Award, District Controls Award, 3rd BlueBanner
-World Championship- #45 seed in Quals, World Championship Innovation in Controls Award - Curie
-NE Championship- #26 seed in Quals, winner(195,125,2168)
[2015 Season] - NE Championship Controls Award, 2nd Blue Banner
-NE Championship- #26 seed in Quals, NE Championship Innovation in Controls Award
-MA District Event- #17 seed in Quals, Winner(2168,3718,3146)
[2014 Season] - NE Championship Controls Award & Semi-finalists, District Controls Award, Creativity Award, & Finalists
-NE Championship- #36 seed in Quals, SemiFinalist(228,2168,3525), NE Championship Innovation in Controls Award
-RI District Event- #7 seed in Quals, Finalist(1519,2168,5163), Innovation in Controls Award
-Groton District Event- #9 seed in Quals, QuarterFinalist(2168, 125, 5112), Creativity Award
[2013 Season] - WPI Regional Winner - 1st Blue Banner
|