12-12-2019 05:01 PM
For my application, I need to programatically set the date/time of my cRIO with minimal delay. The attached VI (LV 2019 SP1) was developed based on the feedback here. It has been tested and works on an older cRIO 9065.
I have been migrating code to a new cRIO 9055. This VI fails on it, the Call Library Function Node returns a -1 and the system time isn't updated.
Any suggestions on what might be going wrong?
Solved! Go to Solution.
12-13-2019 07:35 AM
The post you are linking is rather old. Did you verify whether you run into the same trouble on your cRIO?
I recently used Set Time from RT-Utilities with a 9056. It worked well for me.
12-13-2019 08:17 AM
Set-Time from RT Utilities does work but it takes between 1 and 3 seconds to execute. This is too long for my application. When settimeofday is used through a call library function the delay is on a ms scale.
I have successfully run the originally attached vi on a cRIO 9065 but it fails on a cRIO 9055.
12-13-2019 06:15 PM
I still don't know what is going wrong. I have validated that the lvuser process has cap_sys_time+ep and should be allowed to execute code that updates system time. Whenever I try I receive the error "Operation not Permitted".
I have found a workaround. The idea is ssh in as root and build a binary whose only job is to update the system time. Using suid we can flag the binary to be executed with root permissions even if it's invoked by a different process.
These are the steps followed:
01-09-2020 09:21 AM
After working through the issue with NI support I have the following extra information on the identified solution:
1) The supported way to update the time on a cRIO is through the System Configuration API. This method is slow and I've measured it at 1-3 seconds to execute
2) While better timing can be achieved through calls to libc.6.so, NI doesn't control this library and can't guarantee operation