LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Setting the PC clock

Is there a way to programmatically set the overall PC clock from LabView? Would be most helpful if I were able to do this within my application, but I can't see any way of making it happen.

Thanks in advance
0 Kudos
Message 1 of 11
(4,833 Views)
You can use the system exec.vi on the communications menu to use a command line function to do this like you would in a DOS batch file.


It might not be the nicest way but I found this to be very flexible.

Kind regards,

Mark
---

25+ years long fan of LabVIEW. Be aware that NI changed their business model with great impact .
0 Kudos
Message 2 of 11
(4,823 Views)
I'm not sure if the System Exec method will work.
See this link for details.
Maybe this is dependent on the version of LabView ?
0 Kudos
Message 3 of 11
(4,812 Views)
Hello
You can try, also, to use the windows dll TO CHANGE pc CLOCK.
See this link: http://forums.ni.com/ni/board/message?board.id=170&message.id=108618&query.id=759#M108618
cheers
Alipio
---------------------------------------------------------
"Qod natura non dat, Salmantica non praestat"
---------------------------------------------------------
0 Kudos
Message 4 of 11
(4,807 Views)
Try this VI and see if this may be what you want. have not tested it.



Joe.
"NOTHING IS EVER EASY"
Message 5 of 11
(4,783 Views)
Outstanding - that's just what I'm looking for. Many thanks
0 Kudos
Message 6 of 11
(4,756 Views)

Okay, now for the next variant.  I want to synchronize 2 PC's that are networked and running LabVIEW programs.  setting the clock on the PC that is running the program is easy, but how do I get the time from another PC?

 

I tried looking into the windows time service, but that is way more complicated than I need.  I have them networked through a switch with no DNS (Domain name server) running.  Therfore they are simply networked.

Mike
0 Kudos
Message 7 of 11
(4,218 Views)
You can still use the Windows time service. The master PC (the one running your LabVIEW stuff) would be the time server. The other PC would be set to use Windows Time Services and simply configure it to use the IP address of the other PC. You don't need DNS running for this.


Mark Yedinak
Certified LabVIEW Architect
LabVIEW Champion

"Does anyone know where the love of God goes when the waves turn the minutes to hours?"
Wreck of the Edmund Fitzgerald - Gordon Lightfoot
0 Kudos
Message 8 of 11
(4,211 Views)
Of course you could sync both pc directly to a day-time server usuing the public domain utility found here.  There are command line swithces so that you can call NISTime.23 with System Exec.vi

"Should be" isn't "Is" -Jay
0 Kudos
Message 9 of 11
(4,195 Views)

Jeff Bohrer wrote:
Of course you could sync both pc directly to a day-time server usuing the public domain utility found here.  There are command line swithces so that you can call NISTime.23 with System Exec.vi

I could be wrong but based on the way the OP described the enviroment I don't think these computers have any access to the internet. The only devices they see are all connected to a single switch. Therefore while your solution would work in most cases it would not work for this particular situation.



Mark Yedinak
Certified LabVIEW Architect
LabVIEW Champion

"Does anyone know where the love of God goes when the waves turn the minutes to hours?"
Wreck of the Edmund Fitzgerald - Gordon Lightfoot
0 Kudos
Message 10 of 11
(4,188 Views)