Using a "SSV" on compact logix to set PLC time

snakes79

Member
Join Date
Nov 2015
Location
Illinois
Posts
17
Hello friends. I am working on a project that needs the time to be somewhat accurate for their process. I have taken time for granted and really never realized how complex it actually is. The PLC is a stand alone (no computer to sync its time) and I want the simplest solution to be able to modify the wall clock time on the PLC. I am using the "GSV" to get the wall clock time into an array, but have a hard time using the "SSV" to modify the hours on the wall clock time (Basically day light saving time). It seems you cannot specify an element of an array on the "SSV". So do I need to copy the date time and then use the copied information starting at array element [0] and just modify the hour array element?

Thanks in advance
JF
 
When you use GSV i assume you read to an array like below:
DINT[0]. Year
DINT[1]. Month (1...12)
DINT[2]. Day (1...31)
DINT[3]. Hour (0...23)
DINT[4]. Minute (0...59)
DINT[5]. Seconds (0...59)
DINT[6]. Microseconds (0...999,999)

When you want to update just the hours get the time via GSV update the hour and write back the whole array using SSV.
 
Chopin: What about in NOvember when the time "falls" back? Doesn't the clock need to be decremented. This system has no PC to update the time.
 
From Rockwell knowledge base:

The valid range for Date and Time is from 1/1/1970 12:00:00 A.M. UTC to 12/31/3000 11:59:59 P.M. UTC, coordinated universal time. That means the range for Date and Time parameter varies depending on the time zone and the Adjust for Daylight Saving option.

In this dialog, the Adjust for Daylight Saving option indicates if the Date and Time parameter is adjusted for Daylight Saving or not adjusted.

Clicking on the check box will add 1 hour to the current time in the controller if the time is within the daylight saving time period.
Removing the check will not adjust the controller time for 1 hour no matter what date it is.
Example
If the current controller Date and Time is 07/23/2005 11:23:56 A.M., which is in daylight saving time, the Time Zone is (GMT-05:00), and Adjust for Daylight Saving (+01:00) is on. When the controller Date and Time runs to 11/1/2005 12:00:00 A.M., which is out of daylight saving time, the Adjust for Daylight Saving (+01:00) in the controller is still on.
 
I will add two points:

1. Consider whether to use the LocalDateTime or DateTime Attribute in the GSV/SSV instructions. The former will interpret WALLCLOCK data with Time Zone and DST applied; the latter as strictly UTC (for newer L5K). In your case, though, the time zone is UTC+0 and DST Adjustment is zero; so it happens to not matter.

2. The "Adjust for Daylight Savings" check box, when checked, does not mean "automatically adjust for DST according to the date and local DST rules"; rather, it means "Adjust for DST right now, with the amount of time shown until it is unchecked."

From the Date/Time dialog help:

The Adjust for Daylight Saving parameter indicates whether or not the Date and Time parameter is adjusted for Daylight Saving. You must intentionally alter this option; it is not automatically adjusted by the controller. In other words, if the current controller Date and Time is 07/23/2005 11:23:56 A.M., which is in daylight saving time, the Time Zone is (UTC-05:00), and Adjust for Daylight Saving (+01:00) is on. When the controller Date and Time runs to 11/1/2005 12:00:00 A.M., which is out of daylight saving time, the Adjust for Daylight Saving (+01:00) in the controller is still on.

It is your responsibility to turn the Daylight Saving Time option off. You can turn off the Adjust for Daylight Saving on the Controller Properties Date/Time tab or by adding application code that uses a GSV instruction to automate daylight savings time. When the Adjust for Daylight saving box is clear, the Daylight Saving Time option is off.

There is an add on instruction at the Rockwell web site that can be configured to check the DST box according to your local rules.
 
In the PlantPax library there is a T_DST AOI. It is fully configurable and can be used to adjust for DST automatically, you have to set what dates to adjust the time, so it works for every possibility.
 

Similar Topics

I have problem to set wallclock for controllogix by using SSV.
Replies
4
Views
2,795
Hi, I'm trying to use the IO Device Library (Product Versions) which is configured to work with the 1756-EN4TR & 1756-EN2TR but my system uses...
Replies
0
Views
19
Hello, As part of our project, we are using an M241 controller. This controller interfaces with an industrial computer and a router via a switch...
Replies
1
Views
36
I'm trying to write a data in Arduino using MODWR function block .I used the code I got from online for both PLC and Arduino. I made the wiring...
Replies
4
Views
69
Hey all, i have a panelview screen (image attached), with 4 items on it. Program 1, Program 2, ...3, ...4. The PLC i am using is a compactlogix...
Replies
5
Views
148
Back
Top Bottom