Academic Hardware Products (myDAQ, myRIO)

cancel
Showing results for 
Search instead for 
Did you mean: 

How to change time on myRIO ?

Hi,

Is it possible to change the time on myRIO using LabVIEW?

Indeed, I need to update the time on myRIO via a webservice.

Best regards

Enzo L.

0 Kudos
Message 1 of 9
(15,645 Views)

Hey enzol,

 

You have a couple options for doing this.  You could use a time server and SNTP to have your real-time target (myRIO in this case) connect to a time server at boot and update its clock. 

 

More along the lines of what you're asking (I think) you can use the NI System Configuration API to update the time from LabVIEW.   I created an example that demonstrates how to use a battery powered  RTC (real time clock) to update the myRIO system time.  You can find the code attached.  Just ignore the RTC bit if you want to manually enter the current time.

 

 

myRIO update system time RTC.PNG

 

 

 

Let us know if that helps or if you have more questions about this.

 

Thanks!

 

-Sam K

LabVIEW Hacker

Join / Follow the LabVIEW Hacker Group on google+

 

Message 2 of 9
(15,640 Views)

Thank you a lot ! It's exactly what I need.

0 Kudos
Message 3 of 9
(15,627 Views)

Hi Sam

 

I am trying to implement your solution, but it does not yield the expected results.

 

The wire with SECONDS, for example,  has values that rather than range from 0-59 goes up to 255, clearly indicating that there are problems with the conversion of the extracted from the chip. So does the other wires, with totally nonsense values.

 

 

thanks

 

Helcio

 

0 Kudos
Message 4 of 9
(15,125 Views)

Hi Sam,

 

I tried again, and now everything works. I was using the I2C READ MODE, but I have to use READ and WRITE MODE (as your example did) and this way works but I do not know why using I2C READ MODE does not work. Do you know why?

 

thanks

 

Helcio

0 Kudos
Message 5 of 9
(15,122 Views)

Hey,

 

If you just use the read mode then no data is written to the RTC.  Before you can read you need to send the correct command to tell the RTC that you are about to read.  Without it you won't get the right data back.

 

-Sam K

LabVIEW Hacker

www.labviewhacker.com

0 Kudos
Message 6 of 9
(15,120 Views)

If I use the Set Time.vi, I get the deployement error:

 

Deploying nisyscfg.lvlib:Set Time.vinisyscfg.lvlib:Set Time.vi loaded with errors on the target and was closed.
LabVIEW:  Failed to load shared library nisyscfg.*:nisyscfg_lv_sysapiPropertySetTimestamp:C    . Ensure that the library is present on the RT target. Use either MAX to install NI software or FTP to transfer custom libraries to the RT target.
LabVIEW:  Failed to load shared library nisyscfg.*:nisyscfg_lv_sysapiPropertySetString:C    . Ensure that the library is present on the RT target. Use either MAX to install NI software or FTP to transfer custom libraries to the RT target.
LabVIEW:  Failed to load shared library nisyscfg.*:nisyscfg_lv_rmcfgPropertyGetItem:C    . Ensure that the library is present on the RT target. Use either MAX to install NI software or FTP to transfer custom libraries to the RT target.
Deployment completed with errors

 

 

How could I fix this?

 

Thanks

0 Kudos
Message 7 of 9
(15,119 Views)

Hi all,

 

I use the same chip and i can update the date and time.The problem is that myrio enable the "Automatically adjuct clock for daylight saving time" after the update.

 

How can i fix it?

 

Thanks

Andy

0 Kudos
Message 8 of 9
(13,729 Views)

Hi, i am having the same problem: Deploying nisyscfg.lvlib:Set Time.vinisyscfg.lvlib:Set Time.vi loaded with errors on the target and was closed.

Did you resolve your problem? Can help me to solve this? 

 

Many thanks in advance!

Tung.

0 Kudos
Message 9 of 9
(4,854 Views)