You are not registered yet. Please click here to register!


 
 
plc storereviewsdownloads
This board is for PLC Related Q&A ONLY. Please DON'T use it for advertising, etc.
 
Try our online PLC Simulator- FREE.  Click here now to try it.

---------->>>>>Get FREE PLC Programming Tips

New Here? Please read this important info!!!


Go Back   PLCS.net - Interactive Q & A > PLCS.net - Interactive Q & A > LIVE PLC Questions And Answers

PLC training tools sale

Reply
 
Thread Tools Display Modes
Old December 8th, 2011, 07:25 AM   #1
stu
Member
England

stu is offline
 
stu's Avatar
 
Join Date: Aug 2005
Location: England
Posts: 385
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
  Reply With Quote
Old December 8th, 2011, 08:45 AM   #2
BillRobinson
Member
Canada

BillRobinson is offline
 
BillRobinson's Avatar
 
Join Date: Oct 2006
Location: Sydney, Nova Scotia
Posts: 185
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
  Reply With Quote
Old December 8th, 2011, 08:56 AM   #3
bernie_carlton
Lifetime Supporting Member + Moderator
United States

bernie_carlton is offline
 
bernie_carlton's Avatar
 
Join Date: Apr 2002
Location: Yakima, Washington
Posts: 5,308
Check this post from a recent thread
__________________
Controlling outputs is the PLC's way of getting its inputs to change.

www.thePLCguy.com
  Reply With Quote
Old December 8th, 2011, 09:41 AM   #4
dmargineau
Member
United States

dmargineau is offline
 
dmargineau's Avatar
 
Join Date: Dec 2011
Location: Midwest
Posts: 1,393
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.
  Reply With Quote
Old December 8th, 2011, 10:27 AM   #5
rdrast
Lifetime Supporting Member
United States

rdrast is offline
 
rdrast's Avatar
 
Join Date: Apr 2003
Location: South Carolina Lowcountry
Posts: 3,842
Quote:
Originally Posted by dmargineau View Post
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.

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!

  Reply With Quote
Old December 8th, 2011, 10:50 AM   #6
daba
Lifetime Supporting Member + Moderator
United Kingdom

daba is offline
 
daba's Avatar
 
Join Date: Jul 2004
Location: uk
Posts: 2,822
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 Training
a-b train ltd.
abtrain@tiscali.co.uk
www.abtrain.co.uk
tel: 07506 73 9999
nil illegitimi carborundem


  Reply With Quote
Old December 8th, 2011, 12:32 PM   #7
dmargineau
Member
United States

dmargineau is offline
 
dmargineau's Avatar
 
Join Date: Dec 2011
Location: Midwest
Posts: 1,393
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?
  Reply With Quote
Old December 9th, 2011, 04:13 AM   #8
daba
Lifetime Supporting Member + Moderator
United Kingdom

daba is offline
 
daba's Avatar
 
Join Date: Jul 2004
Location: uk
Posts: 2,822
Quote:
Originally Posted by dmargineau View Post
Yes you could GSV the WallClockTime and then implement the "Day_of_the_Week" Logix5000 AOI sample programming in order to reset a counter.

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.
Quote:
Originally Posted by dmargineau View Post
It doesn't look bullet proof to me either!)
I tested the AOI for all dates 2000 to 2116 and can confirm it lives up to expectations.
Quote:
Originally Posted by dmargineau View Post
How many times you have to download to an operational modern processor anyway?
Once would be enough to shift the time away from 6:00 pm. Downloads may occur frequently during commissioning stages, and I would not want to have to keep calculating what to set the accumulator to achieve the next time-out at 6:00 pm on the next Sunday.
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 Training
a-b train ltd.
abtrain@tiscali.co.uk
www.abtrain.co.uk
tel: 07506 73 9999
nil illegitimi carborundem


  Reply With Quote
Old December 9th, 2011, 08:35 AM   #9
dmargineau
Member
United States

dmargineau is offline
 
dmargineau's Avatar
 
Join Date: Dec 2011
Location: Midwest
Posts: 1,393
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.
  Reply With Quote
Old December 9th, 2011, 08:49 AM   #10
daba
Lifetime Supporting Member + Moderator
United Kingdom

daba is offline
 
daba's Avatar
 
Join Date: Jul 2004
Location: uk
Posts: 2,822
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 Training
a-b train ltd.
abtrain@tiscali.co.uk
www.abtrain.co.uk
tel: 07506 73 9999
nil illegitimi carborundem


  Reply With Quote
Old December 9th, 2011, 09:31 AM   #11
rdrast
Lifetime Supporting Member
United States

rdrast is offline
 
rdrast's Avatar
 
Join Date: Apr 2003
Location: South Carolina Lowcountry
Posts: 3,842
Quote:
Originally Posted by dmargineau View Post
Quote:

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...
You are right. I'm rude. I'm that way for a reason. You choose to use an inaccurate and inappropriate means of solving a problem. Just because it is 'simple' does not mean it is reliable or correct.

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!

  Reply With Quote
Old December 9th, 2011, 09:46 AM   #12
MarkNightingale
Lifetime Supporting Member + Moderator
United Kingdom

MarkNightingale is offline
 
Join Date: Sep 2010
Location: In The VAT Shed
Posts: 479
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
  Reply With Quote
Old December 9th, 2011, 09:49 AM   #13
daba
Lifetime Supporting Member + Moderator
United Kingdom

daba is offline
 
daba's Avatar
 
Join Date: Jul 2004
Location: uk
Posts: 2,822
Which AOI code did you use, Mark ?
__________________
___________________________
ControlLogix & SLC Training
a-b train ltd.
abtrain@tiscali.co.uk
www.abtrain.co.uk
tel: 07506 73 9999
nil illegitimi carborundem


  Reply With Quote
Old December 9th, 2011, 09:51 AM   #14
MarkNightingale
Lifetime Supporting Member + Moderator
United Kingdom

MarkNightingale is offline
 
Join Date: Sep 2010
Location: In The VAT Shed
Posts: 479
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
  Reply With Quote
Old December 9th, 2011, 09:57 AM   #15
daba
Lifetime Supporting Member + Moderator
United Kingdom

daba is offline
 
daba's Avatar
 
Join Date: Jul 2004
Location: uk
Posts: 2,822
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 Training
a-b train ltd.
abtrain@tiscali.co.uk
www.abtrain.co.uk
tel: 07506 73 9999
nil illegitimi carborundem


  Reply With Quote
Reply
Jump to Live PLC Question and Answer Forum

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

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


All times are GMT -5. The time now is 11:50 PM.


.