Sign in to follow this  
Followers 0
AC DC

Summer & winter time

20 posts in this topic

How do I know when I have to change the clock in a CJ1(M) or a NS terminal. To add or substr. 1 hour from the current time due to summer or winter time ??

Share this post


Link to post
Share on other sites
Check out this thread at PLCs.net: Daylight Savings Time @ PLCs.net

Share this post


Link to post
Share on other sites
In Holland and other European countries they put the clock back or forth 1 hour each year, in spring and authem, each year (energy saving). Windows gives notice to adjust the clock. I want to do that in the PLC and NS also so the customer has to do nothing. I understand they don't do that in the states.

Share this post


Link to post
Share on other sites
Unfortunately, we do have to do that in the states. If the formula is the last weekend in April, then you must compare the month for 4; then compare the day for 1; and then remember the day of the week;take the number 28 (4*7) and subtract the day of the week; on that day change the clock. Then write a FINS command to send it to the clock in the NS. This is off the top of my head; somebody else give it a go.

Share this post


Link to post
Share on other sites
I can tackle the CJ1M PLC, however i do not have detailed enough experience with the NS screen or the hardware to try this out.... For the CJ1 PLC Lets keep this simple..... We know that the PLC clock data is stored in A351, A352, A353... A351 = mmss (min secs) (00-59,00-59) A352 = ddhh (day hr ie day = 01-31, hr = 00-23 A353 = yymm (year month eg yr = 00-99 mm = 00-12) A354 = 00DD (Day of Week ie Sun = 00 thru Sat = 06) Dedicate Data Memorys to hold your working time, that is base all calcs and scheduling or display based on this time... for example D1 = mmss D2 = ddhh D3 = yymm D4 = 00DD Use CX-Programmer to set this clock to NON DAYLIGHT SAVING TIME (ie GMT + xx hr) When it is daylight savings time you need to subtract 1 hour from what the time would be normally correct.... Now also dedicate an internal bit to be your daylight savings enable bit. Eg W510.15 If Not Daylight saving then simply copy 4 words starting at source word A351 and copying to destination words starting at D1   W510.15   DSTime ---[/]------[XFER &4 A351 D1] If Daylight savings then use CSUB and subtract 1 hr.   W510.15   DSTime ---[ ]-----[CSUB A351 #00010000 D1] Try this code...it is quite simple and will work.... The hardest will be knowing how to turn on the W510.15 What i would do is use a compare on the clock data A351 etc to work out when to say hey, its day light savings or not, you will need to use the day of week function also Do you know when day light savings starts ?? and ends in europe...? As Jay eluded to

Share this post


Link to post
Share on other sites
If he can get the PLC code to work properly, I will give him the FINS command to send it to the NS. I just gotta look for it.

Share this post


Link to post
Share on other sites
We call it summertime and in the US they call it daylightsaving, so we where talking about the same thing. So Jay's calculation will be working. In Europe it is the last sunday in march & oktober. In the US it is the last sunday in april & oktober, it is changed in 2007 A site where there is an explanation and calculator: http://webexhibits.org/daylightsaving/ on page 2 there is a calculator. Edited by AC DC

Share this post


Link to post
Share on other sites
Is it possible to change A352 directly to add or sub 1 hour, I tried several instructions, but it had no result.

Share this post


Link to post
Share on other sites
I have uploaded a number of Function Blocks in the Omron Download Section. FB Calculate Day Of Week FB Extract Date Time FB Daylight Savings Detection Secondly, ACDC i bet you haven't tried the DATE function and why don't u use the simple code i suggested.....much simpler...

Share this post


Link to post
Share on other sites
I am using your solution, but I had a problem with substracting 1 from 00.00 hour (the machine is probebly switched off then). So I tried to change the PLC clock with ADD SUB etc. did not use DATE (forgotten). An other problem is that machine is probebly switched off on a Sunday. So I check if the 25 - 31 March & day/week Sunday is passed and change the clock once (-1 hour). Then at 25 - 31 Oktober day/week Sunday is passed and change the clock once (+1 hour). Then I have to change the clock only twice a year. I will try to do it with DATE. Thank you for waking up my mind after 2 weeks of holiday. Edited by AC DC

Share this post


Link to post
Share on other sites
If you use the function blocks i up loaded, assuming that you have a ver 3 CPU and doing the code such as CSUB with DST is active then the job is done....It will never matter if the machine is turned off, even for over a month...it doesn't matter. As long as the system is in the DST then the clock value will be changed....You won't ever have to worry about an accidental douplbe ADD or subtract.

Share this post


Link to post
Share on other sites
Thanks again, your not so sleepy as your name.

Share this post


Link to post
Share on other sites
i've tried a sample program on w340 e1 08 sec 3-28-2 calendar substract (CSUB) using CS1G-H CPU44& CS1H-H CPU64 but CSUB can't be executed, no result on result word R,R1 and R2 what's the promblem? thq alot b4 regard

Share this post


Link to post
Share on other sites
Difficult to say if you don't post how you have used the instruction. What operands do you use ? Are the result channels overwritten somewhere else in the ladder ? Post a screencopy of the ladder ? Attach your program ? Is the program section running ? Is the instruction condition executed ? Is the Instruction Execution Error Flag CF003 active ? is the program downloaded ? is the CPU in run mode ?

Share this post


Link to post
Share on other sites
:D Ur listed requirement, have been completed by my app & my CSUB was working properly i note Ur list & place it in front of my glass :D thq 4 PdL :) regard

Share this post


Link to post
Share on other sites
I'm glad I could be of help

Share this post


Link to post
Share on other sites
Hi; how to adjust the time/date of the CPU from HMI ? AR35x aera is read only ?

Share this post


Link to post
Share on other sites
Sorry my crystal ball is out for repairs... which CPU ? I guess CS/CJ series looking at AR adress number. See attached from CX-Programmer instruction help... DATE_735____Clock_Adjustment.pdf

Share this post


Link to post
Share on other sites
sorry CJ1 CPU42H Thanks a lot for that !! It is exactly what i am looking for

Share this post


Link to post
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
Sign in to follow this  
Followers 0