![]() |
||
|
This board is for PLC Related Q&A ONLY. Please DON'T use it for advertising, etc. |
||
| ||
New Here? Please read this important info!!!
|
|
#1 |
|
Member
|
Help with rslogix 5000
Hi guys
I have a machine that we what to reset a counter to zero on Sunday at 6pm I have seen the ssv, gsv and the wallclocktime but have never used them Could someone show me how I could do this please, also is it possible to record the number before it resets, I am using a compactlogix and a pop 700 . Thanks stu |
|
|
|
#2 |
|
Member
|
1) Create two DINT[7] arrays, one to SET the time, one to GET the time. The format for the arrays are:
[0] - Year [1] - Month [2] - Day [3] - Hour [4] - Minute [5] - Second [6] - Millisecond 2) To set the time call a SSV instrusion in ladder with the "Class Name"=WallClockTime, and "Attribute"=LocalDateTime and "Source"= the first element of your set array (e.g. SET_TIME[0]); "Instance Name" can be left blank. I'd put a set bit and a ONS in front of this instruction so you don't constantly try to set the time 3) To retrieve the time call the GSV instruction with the same parameters as the SSV instruction but this time the "DEST" should be your the first element of your get array( e.g. GET_TIME[0]). I wouldn't put anything infront of this instruction and place the program in a periodic task. 4) You have the year, month, and date but you do not know what day of the week it is (Sunday - Saturday). To get this you should look at algorithm called the "Zeller's Congruence". When you look it up in Wikipedia, please note that the straight brackets with the edge on the bottom are actually symbols for round down to the nearest number; this can be done in the PLC with the TRN instruction. 5) From there trigger your RESET on Day of the week, hour, and minute, but be sure to use a ONS when resetting so that you don't hold the RESET for a entire minute. Hope that helps |
|
|
|
#3 |
|
Lifetime Supporting Member + Moderator
|
Check this post from a recent thread
__________________
Controlling outputs is the PLC's way of getting its inputs to change. www.thePLCguy.com |
|
|
|
#4 |
|
Member
|
Or...You could setup a "One Week Free Running Clock" Timer (Preset=604800000ms) which should be initially reset on any Sunday at 6pm.
From this point on the timer will time out every 7 days. When the timer's .dn bit is true capture the .acc value of the counter (and eventually load it into an array) and then (RES) both the timer and counter's .acc values. Last edited by dmargineau; December 8th, 2011 at 09:44 AM. |
|
|
|
#5 | |
|
Lifetime Supporting Member
|
Quote:
No No No No No No No No NO NO NO NONONONONONONONO! If you have a Real Time Clock available, USE IT. Timers are NOT guaranteed accurate. They are good, but not exact. The same for periodic tasks and interrupts. If you are driving a screw, you use a screwdriver. Yes, a hammer MIGHT do the job, but not properly.
__________________
------------------------------------ How to ask questions the SMART Way! Look First, Ask Second! |
|
|
|
|
#6 |
|
Lifetime Supporting Member + Moderator
|
NO NO NO NO .... again !!
You are assuming that you will never do a download to the controller - if you do this method will fail. Use the AOI (or the code from it) pointed to by Bernie's post. Actually you should read the whole post.... http://www.plctalk.net/qanda/showthr...900#post458900
__________________
___________________________ ControlLogix & SLC Trainingabtrain@tiscali.co.uk www.abtrain.co.uk tel: 07506 73 9999 self-help and help-yourself often get confused - ancient daba proverb |
|
|
|
#7 |
|
Member
|
I agree you cannot use a free running RTO within an extended (>seconds 10^6) time dependent high accuracy (seconds^-3) application.
Yes you could GSV the WallClockTime and then implement the "Day_of_the_Week" Logix5000 AOI sample programming in order to reset a counter. (It doesn't look bullet proof to me either!) However, we are talking about "ONCE A WEEK" decision making programming that has to be implemented by someone who has never used the advanced features of the Logix systems. If the user is aware that the Upload/Save/Download consequential actions will introduce a +/- RTO .acc error this could be easily compensated for. How many times you have to download to an operational modern processor anyway? |
|
|
|
#8 | ||
|
Lifetime Supporting Member + Moderator
|
Quote:
The Day_Of_Week AOI does not reset a "day counter" - it returns the actual day of the week calculated from the date, so will always be correct if the date is set correctly. I tested the AOI for all dates 2000 to 2116 and can confirm it lives up to expectations. Quote:
The specification calls for something to happen at a specific time, not after a specific 7-day delay, and to me, that calls for a real-time clock, not a timer.
__________________
___________________________ ControlLogix & SLC Trainingabtrain@tiscali.co.uk www.abtrain.co.uk tel: 07506 73 9999 self-help and help-yourself often get confused - ancient daba proverb |
||
|
|
|
#9 |
|
Member
|
Quote:
"The specification calls for something to happen at a specific time, not after a specific 7-day delay, and to me, that calls for a real-time clock, not a timer." The specification calls for something to happen at a specific time ONLY AFTER a specific 7-day interval has elapsed. (See Post #1) IMO this primarily is THE REQUIREMENT INTENDED TO BE SATISFIED WHEN ONE FIRST DESIGNED A TIMER. Quote: "The Day_Of_Week AOI does not reset a "day counter" - it returns the actual day of the week calculated from the date, so will always be correct if the date is set correctly." Again, if we are researching the "scope" of this thread, we arrive at the conclusion that it is nothing more than : A WAY TO RESET A COUNTER AT 18:00 HOURS EVERY GIVEN SUNDAY. The WallClockTime AND the DayOfTheWeek AOI implemented logic NEEDS TO RESET A COUNTER which's .acc value has to be recorded priorly to "zero-ing". It is the most elegant way to do it for most of the " helpers" within any automation forum. However, when the request for help comes from someone not too familiar with the full capabilities of a system, I have always thought that a more basic alternative COULD BE considered and not completely (and rudely) dismissed. Maybe the Midwest KISS engineering attitude is the culprit! Yep, the one that created Logix... Last edited by dmargineau; December 9th, 2011 at 08:41 AM. |
|
|
|
#10 |
|
Lifetime Supporting Member + Moderator
|
I have to disagree with you dmargineau, stu's post specifically says...
"I have a machine that we what to reset a counter to zero on Sunday at 6pm" Nothing more, nothing less. There is no mention of an ONLY AFTER... The DayOfTheWeek AOI tells you the day number from the WallClock date, and the WallClock Time will tell you when it is 6:00 pm. These facts can be used to Reset the Counter after recording it's value. Your suggested method will also NOT compensate for DST.
__________________
___________________________ ControlLogix & SLC Trainingabtrain@tiscali.co.uk www.abtrain.co.uk tel: 07506 73 9999 self-help and help-yourself often get confused - ancient daba proverb |
|
|
|
#11 | |
|
Lifetime Supporting Member
|
Quote:
One which will accumulate errors over time, thereby requiring frequent intervention to fix. And as far as your "KISS" approach, the best approach to that is to put an alarm clock by the operator desk, and provide a button for him to press when it goes off. Even that would be more accurate and less error prone then a free-running timer.
__________________
------------------------------------ How to ask questions the SMART Way! Look First, Ask Second! |
|
|
|
|
#12 |
|
Lifetime Supporting Member + Moderator
![]() Join Date: Sep 2010
Location: In The VAT Shed
Posts: 420
|
Just to put my 2p worth in.
I have just added all the code for Day Of Week, and then placed this data on my HMI and all in all it took me less than 5 minutes. I don't think that for even the most basic PLC programmer, that any of this should cause any problems. Mark |
|
|
|
#13 |
|
Lifetime Supporting Member + Moderator
|
Which AOI code did you use, Mark ?
__________________
___________________________ ControlLogix & SLC Trainingabtrain@tiscali.co.uk www.abtrain.co.uk tel: 07506 73 9999 self-help and help-yourself often get confused - ancient daba proverb |
|
|
|
#14 |
|
Lifetime Supporting Member + Moderator
![]() Join Date: Sep 2010
Location: In The VAT Shed
Posts: 420
|
Daba,
I used the AOI from the post Bernie pointed to. I am testing it now and so far from present day up till 2065 I haven't seen it miss any days. Mark |
|
|
|
#15 |
|
Lifetime Supporting Member + Moderator
|
I'm way ahead of you - I restarted my tests, and it's up to March 2140 st the moment.
I'm waiting to see if it does 2400 OK, which will obviously outlive you, stu, and Barney McGrew...
__________________
___________________________ ControlLogix & SLC Trainingabtrain@tiscali.co.uk www.abtrain.co.uk tel: 07506 73 9999 self-help and help-yourself often get confused - ancient daba proverb |
|
![]() |
| Bookmarks |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
|
|
Similar Topics
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| How To Enter Rslogix 5000???? | sundar_scada | LIVE PLC Questions And Answers | 9 | October 8th, 2009 11:29 AM |
| Rockwell Allen Bradley Programming Software, RSLogix 5, RSLogix 500, RS Linx, RSLogix | vvcd | LIVE PLC Questions And Answers | 21 | September 24th, 2009 10:04 PM |
| RSLOGIX 5000 Error Message | introl | LIVE PLC Questions And Answers | 4 | May 8th, 2008 03:40 PM |
| Gray Code and RSLogix 5000 | IAA | LIVE PLC Questions And Answers | 5 | September 28th, 2007 09:27 AM |
| RSLogix 5000 V15 Features | Samneggs | LIVE PLC Questions And Answers | 18 | April 20th, 2006 05:45 PM |