|
|
|
![]() |
|
|||||||
|
||||||||
![]() |
|
|
Thread Tools | Rate Thread | Display Modes |
|
|
|
#1
|
||||
|
||||
|
Setting the real time clock and date on cRio
Last year we used a data logger based on the 3096 labview data logger posted here on CD.
It worked well but if the log file already existed, it would append the data to the existing data, and then it would become a data exposition to find the data you were looking for. We also had times when the we were running the bot for log periods of time, (parades and such) that the file grew very large and we think the crio was having issues writing to the file. This year we working on writing a new file each time we powered on, and attempted to use date and time as the filename for the log file. This code works well, but we can't seem to get the cRio date and time to stick or make sense. Most files, (going from memory, so might be wrong) end up with a Jan 01, 1970 data and 00 00 time. We have used the Max software to connect to the cRio and set the real time date and time on the cRio, but it seems to not match, anything we set. Saturday we set in the Max software, and we had year dates, (again from memory) like 2106? I assume I doing something wrong, and I would guess it's a training issue, let me know if anyone has this working? |
|
#2
|
||||
|
||||
|
Re: Setting the real time clock and date on cRio
Messing with the clock on there can be tricky, as I understand the clock resets every time the cRio is powered off (I'd love to be correct, if my understanding is based on wrong information!).
It might be better to number your files instead - log1.txt, log2.txt, etc. You could keep the current number for the log file in a config file and just read it in, use it, then increment and overwrite the value in the config file for next time. Then the most recent log file would have the largest number on it. For easy searching/organization, I would recommend using 3 or 4 digit numbers at all times (001 instead of 1, for example) - otherwise you'd end up with something like log1.txt log10.txt log2.txt log3.txt etc |
|
#3
|
|||||
|
|||||
|
Re: Setting the real time clock and date on cRio
I don't believe that the 4-slot cRIO has an internal battery to maintain the clock when it's powered off. So it would have to be set each time.
The 8-slot does have an internal battery to preserve the clock. Another alternative is to maintain logs on the DS instead. The clock there is good and the logs are easier to access. Data can be temporarily cached in a cRIO log file when there is no communication with the DS, then forwarded when contact is established. |
|
#4
|
||||
|
||||
|
Re: Setting the real time clock and date on cRio
Thanks Gents,
We haven't played much getting the data to the DS, so I will work on sequentially numbering them, and log to a file. Edit: and it is 4 slot Mark. |
|
#5
|
||||
|
||||
|
Re: Setting the real time clock and date on cRio
An easy alternative would be to log on the cRIO like you want to, but get your date and time from the dashboard. On the dashboard you could read the date and time on a regular basis, and then pass it to the robot using the smart dashboard VIs.
|
![]() |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|