Jump to content

NTP amd DST


hotwires

Recommended Posts

Any chance of Network Time Protocol with selectable sync intervals? What about a simple setting for auto Daylight Savings Time correction? It's concievable that DST correction could be constructed with ladder logic. However a menu section would be easier.  thanks. 

Link to comment
Share on other sites

Hi hotwires,

There are 2 examples of time synchronization, for V570 and V700.

Both are located in Examples directory":

C:\Program Files (x86)\Unitronics\Unitronics VisiLogic_C\Examples\Version 900\Project examples\Communications\Ethernet

Daylight Savings Time cannot be automatic updated, as it changed from time to time.

You have to take care to decide, when to change DST. Rest is done by RFC-305  FB and some logic.

The same is for sync intervals. You have to select applicable for your project sync intervals.

If you have a specific requirements for your project, please send us project potential evaluation with detailed requirements description, and we will pass your requirements for evaluation.

 

B.R.

 

Link to comment
Share on other sites

  • MVP 2023

The rules for Daylight Savings Time vary around the world, so there is no universal function that can be implemented in a standard PLC command set.

I had to write one for the US.  I've attached the Visilogic export of it, which you can re-create in UniLogic.

It's not perfect and the PLC must be powered on when DST occurs.  If someone wants to improve it and post what they've done it would be most welcome.

Joe T.

 

Daylight Savings Time.vlx

Edited by Joe Tauser
Updated Daylight Savings Time export
  • Upvote 1
Link to comment
Share on other sites

  • MVP 2023

Joe, I can't import that vlx, it pops up an error.  What Visi version was it under?

In Aus there are different rules between our states, and my state changed things around a bit in past years, all or which creates constant headaches.

Daylight saving is one of those things that is simple for a human brain, but is actually fairly involved to explain to a dumbo plc!

cheers,

Aus

Link to comment
Share on other sites

  • MVP 2023

 

2 hours ago, Joe Tauser said:

I've attached the Visilogic export of it, which you can re-create in UniLogic.

It's not perfect and the PLC must be powered on when DST occurs.  If someone wants to improve it and post what they've done it would be most welcome.

I get an error also. I'd love to play with it a bit if I could get it to load.

Link to comment
Share on other sites

  • MVP 2023

It choked when I tried to import it, too.  Probably has something to do with the file date being 2009.  

I opened a program that had it in 9.8.31 and re-exported it.   I was successful in importing the new one into a blank project.

I have uploaded it again.  Give it a try.

Joe T.

Link to comment
Share on other sites

  • MVP 2023

Works now.  I see that it only works if it is running on the day.  I'll dig up my methods as that is why mine was involved, as I don't do sets, it works on compares and works regardless of whether things are on or not.  But give it a few days...busy.

Also, in looking at this initially, I remembered I had seen someone's post with their example of how they had gone about it.  But searching doesn't bring anything up.  Might I have seen it on the old forum?  Ringing any bells with anyone else?  I think it was from one of our European colleagues.  Thought it had the ladder as images.

cheers, Aus

Link to comment
Share on other sites

It's not a big deal, i can TCP/IP connect and correct the MTU RTC offsite. More a matter of me remembering to do it.  Unistream generates and emails daily reports (7am to 7am next day). Report was an hour late the day after dst change. No one lost their head of over it. Now the RTU's at meter vaults.... serial modbus only (over RF), no IP,  correction would require a physical visit. i suppose i could construct a one time modbus write register that could change system clock. Thanks for all the feedback. 

Edited by hotwires
Link to comment
Share on other sites

  • MVP 2023
3 hours ago, hotwires said:

i suppose i could construct a one time modbus write register that could change system clock. 

Yes, do it!  Anything that saves lots of driving around is worth it!  Isn't that what our great new world of technology is for?  Hmmmm?  Apart from sending us crazy now and then!

cheers,

Aus

  • Upvote 1
Link to comment
Share on other sites

  • MVP 2023

 

 


Hi again all,

Re me posting my solutions, it is getting into "my secrets" areas as the code is embedded into other things I prefer not to share with the world, and I can't be bothered separating it out.

However, I don't think that the ideas would be too hard to put into a function block for Visi etc.  It is all based around compares that look at dates, days of the week, and months and consequently works whenever the plc is running...it doesn't have to be on during the transition days.  Surely it wouldn't be too hard to develop a function block that has inherent calculations that do the same things and ends up with a MB on or off, based on answers to questions that ask when DST starts and ends for the desired location.  If a dumbo like me can do it, then the whizkids at head office who work with this stuff all the time should do a much neater version in a flash!

It would be a very useful addition.

cheers,

Aus

Link to comment
Share on other sites

  • MVP 2023
13 hours ago, Cara Bereck Levy said:

Help me out here.

Yes....sorry Cara, it sort of evolved into a discussion about the need for such a thing across all Unitronics types.  But in my case I am particularly talking about Visilogic.  Given that DST is a common thing worldwide, yet Unitronics has no innate means of implementing it without user coding, is a bit of an oversight in my opinion. I have worked with simple RTC timers that allow me to set it up with a few button pushes, so a far more complex PLC should also have the means to make it easy.

cheers,

Aus

Link to comment
Share on other sites

Cara,

Ultimately both. I'll take whatever I can get, whenever I can get it.  Most all the the Linux embedded security camera DVR's have auto DST offset, user specifies the day, week, month of beginning and end, the offset in hours, and time to execute (in 24 hour). One day of collected data will be an hour lean or an hour heavy, but at least it's just twice a year. I was two days late manually intervening this time around. If a person was managing 100 OPLC's without remote access it would take all day to do DST corrections. 

Link to comment
Share on other sites

  • 4 years later...

So I was about to ask if anyone has gotten NTP to work with UniStreams. I've tried a few times in the past with no luck.

Decided to give the example project another try (..\UniLogic_Example_Projects\UniLogic Examples_V1.30 Rev 52\Time based applications\UniStream_070_RFC_1305_UDFB v2.ulpr).

Changing the port for 'UDP Socket1' from 555 to 123 got it working!

Link to comment
Share on other sites

Hah, jeez I think I must have edited that port number, saved the project and totally forgotten about it when I tried again.

I vaguely remember trying to get a computer with Ubuntu to act as the NTP server when I wasn't having luck with internet NTP servers.

Not sure what I messed up not getting the program to work originally.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

This site uses cookies. By clicking I accept, you agree to their use.