RsLogix 5000 Time/Date

Adam303

Lifetime Supporting Member
Join Date
Aug 2009
Location
Chicago
Posts
587
Hi Guys, I’m working with RsLogix 5000 Version 18 (1769-L35E) I’m having a hard time trying to get the time and date from the controller. Basically I need couple of things in the logic to turn on at a certain day and time of the week. I’ve searched around the site and read a few thing including the attached pdf but I’m still confused as to how this is supposed to be setup. In RsLogix500 the date time was under controller properties but this is a little different. Any help please
 
You need to do a GSV on the wallclock attribute. You will need to create an array 7 elements long (I think) for the PLC clock variables to be written to.

I think the help manual will also be of value
 
That Day of Week calculation looks fairly complete. Is it the one in the RSLogix 5000 Sample Projects folder, which is also in RA Answer ID # 54858 (and attributed to PLCTalk.net !).

What exact element of it doesn't make sense ?
 
Last edited:
The very first rung, and its comment, do not go together. That alone could be causing the confusion.

The rung comment says to make an Array of 7 DINTs to hold the WallClock values returned by the GSV.

That is perfectly OK, and the GSV Instruction Help also suggests that you need a 7 DINT array....

Array[0] = Year
Array[1] = Month
Array[2] = Day
Array[3] = Hours
Array[4] = Minutes
Array[5] = Seconds
Array[6] = uSeconds

However, the destination they show in the GSV instruction itself is Wall_Clock.Year. That is clearly NOT an array element.

What they have done is to use a common trick to help with the identification of the data fields that GSVs and SSVs use. In employing this "trick" they have forgotten to update the rung comment.

The trick is to create a UDT that has the same size/shape as the 7 DINT array. In this case they have made a UDT with 7 DINT members. This maintains the size/shape of the receiving "block", and the GSV happily writes the data into the User-Defined tag.

Their UDT will have the following members, all of DINT data-type, and order is important.....

.Year
.Month
.Day
.Hours
.Mins
.Secs
.MicroSecs
 
It is also very unfortunate for anyone who has used this code, that this algorithm DOES NOT WORK CORRECTLY in Logix5000 processors.

It has to do with the (to some) unusual Rounding Algorithm that Logix5000 uses.

The Code was written with the assumption that 0.5 and above rounds UP, but Logix5000 rounds numbers that end in exactly .5 to the nearest even number.

The net result is that 31/01/2011 is correctly shown as a Monday, but so is the next day, 01/02/2011 !!

The picture shows why....

If you use this Day-Of-Week code in a Logix5000 system - it will get lots of days WRONG !!

2011-12-03_231528.jpg
 
Actually just had a look in the RSLogix5000 Sample Projects folders (Day_Of_Week.ACD appears from V13 onwards), and it is coded completely differently to that posted here.

I suppose I could check out that this one works correctly, but that's a job for tomorrow.....
 
If you have a TechConnect contract then the PlantPAx library has a day of week AOI

The AOI does not have the bug that daba is talking about as only uses DINTs and modulo maths

http://rockwellautomation.custhelp.com/app/answers/detail/a_id/62682

I also saw PlantPAx in the Samples V19 you are looking for T_DoW - don't know how that got there if it was part of the original install or a later add on
 
Last edited:
What exact element of it doesn't make sense ?
Ken I'm totally lost here trying to achieve the day of the week, there is a lot of instructions and calculations that I completely don’t understand, in order to achieve the DOW. Is there really no easier way to get the day of the week. I’m going to go thru the code and will post specific questions. Thanks
 
I like that version Adam303 (post #10)....

Ran a test on it cycling through days at a fairly rapid rate, and there are no day errors from 01/01/2000 thru 07/09/2116, which is when I stopped the test to do something else.
 
Guys Thank you all for the help. I went with the logic for DOW in post #10 seems a lot easier to understand, at least for me. Daba did you have a chance to examine the logic example in the sample file of RsLogix 5000 V18 for the DOW? If so please let us know if you found any issues. The one I attached in my first post was downloaded from this site in PDF format so I'm not sure if it was modified by anyone, all though Ken states that the same file can be found in RA Answer ID # 54858.
 
Yes, I had a quick test of the ones installed with RSLogix5000.. And I wouldn't trust them either.

For instance, it doesn't know that 2000, 2400, 2800 will be leap-years, in fact it gets every day of 2000 wrong up to 29/2/2000 !!

Definitely go with the one in post #10, any rounding errors are neatly avoided.
 

Similar Topics

Hello Gentlemen, I am having this weird issue. I can see the controller on Rslinx via ethernet. when I open the RSlogx 5k, open RSWho, I still...
Replies
3
Views
1,928
I want to update the firmware 15 to 20 on a ControlLogix 5561 Processor, Cat series 1756 L61 B. Is this possible? There are other components...
Replies
22
Views
7,435
I appear to have an issue with RSLogix 5000 software. It appears that the publishers certificate is out of date. I am unable to open the...
Replies
1
Views
1,561
Hi guys, I want to update Rslogix 5000 v20 to v30.kindly support and guide me to update version 30. Kind regards. Ju
Replies
3
Views
3,016
Hi, I was monitoring a compactlogix online today and was watching a timer value and rslogix 5000 only appears to update the tag value displayed...
Replies
0
Views
2,309
Back
Top Bottom