Jump to content



Photo
- - - - -

RSLogix 5000 Wall Clock

  • Please log in to reply
5 replies to this topic

#1 Jeremiah

Jeremiah

    Sparky

  • MrPLC Member
  • PipPipPip
  • 39 posts
  • Country:United States
    United States

Posted 15 July 2008 - 03:29 PM

I need to reset a group of RTO's at 6AM every morning. I have never used the free running clock in RSLogix 5000 and can't seem to find it anywhere. How would I go about doing so? Your help is appreciated. Thanks in advance.

JS

#2 Ron Beaufort

Ron Beaufort

    Guru

  • MrPLC Member
  • PipPipPipPipPip
  • 825 posts
  • Location:Charleston, SC
  • Country:United States
    United States

Posted 15 July 2008 - 03:42 PM

use a GSV (Get System Value) instruction to retrieve the wallclock time from the processor - and put the values for Year, Month, etc. into a DINT[7] array that you've created for the purpose ... once you've got the data stored in the array, then you can use EQU (Equal) and other comparison instructions to trigger different actions ...

Best regards,
Ron
PLC Training Boot Camp

I once was lost, but now am found, was blind, but now I see.

#3 TConnolly

TConnolly

    Guru

  • MrPLC Member
  • PipPipPipPipPip
  • 939 posts
  • Gender:Male
  • Location:Salt Lake City
  • Country:United States
    United States

Posted 16 July 2008 - 11:05 AM

Controller scoped tag: Date_Time DINT[7] *Dint array where date and time is to be stored

Date_Time[0] is the year
Date_Time[1] is the month
Date_Time[2] is the day
Date_Time[3] is the hour (24 hour format)
Date_Time[4] is the minute
Date_Time[5] is the second
Date_Time[6] is microseconds.



Controller scoped tag: One_Shots Bool[64] *array for one shot status bits

Controller scoped tag: Reset_All Bool *boolean used elsewhere to reset timers

In Logix5K V16 or later use:
GSV WALLCLOCKTIME ? LocalDateTime Date_Time[0]

In Logix5K version 15.x or earlier, use
GSV WALLCLOCKTIME ? DateTime Date_Time[0]

EQU Date_Time[3] 6 EQU Date_Time[4] 0 ONS OneShots[63] OTE Reset_All.

I recommend using a periodic task since its not necessary to execute this code continuously.


#4 BobLfoot

BobLfoot

    The Wizard

  • MrPLC Admin
  • 3159 posts
  • Gender:Male
  • Location:Southern Indiana
  • Country:United States
    United States

Posted 17 July 2008 - 10:10 AM

I recommend using a periodic task since its not necessary to execute this code continuously.


Excellent Suggestion Alaric!!!

Not everyone has looked this up but GSV and SSV instructions are real scan time hogs compared to XIC, OTE and even COP, CPS instructions.

I never thought of using a periodic task for WallClock maintenance before and I think it makes great sense.
BobLfoot

"Poor Planning on your part does not a crisis on my part make"

#5 TConnolly

TConnolly

    Guru

  • MrPLC Member
  • PipPipPipPipPip
  • 939 posts
  • Gender:Male
  • Location:Salt Lake City
  • Country:United States
    United States

Posted 17 July 2008 - 10:36 PM

[quote name='BobLfoot' post='71630' date='Jul 17 2008, 09:10 AM'] [quote name='Alaric' post='71601' date='Jul
I never thought of using a periodic task for WallClock maintenance before and I think it makes great sense. [/quote]

Bob, you may be interested in something I saw two weeks ago about the continuous task at one of Rockwell's Automation On the Move events (mini Automation Fair).

The class instructor opened the continuous task and monitored the program scan time which was running between 3 and 4 milliseconds for the demonstration program. In this PLC the only task was the continuous task. The continuous task time slices with all of the PLC housekeeping, communication servicing, etc. He put the PLC in program mode, switched the task to periodic at 10 msec and put it back into run mode. Now the program completed a scan in about 0.7 milliseconds. Then he changed the task period to 2 msec. So now the program was being executed nearly twice in the same time that it ran just once before.

So today I had some time while waiting for Bubba and Cletus to complete some mechanical work on a startup and I did the same thing. This PLC has 8 tasks including the continuous task and all 7 periodic tasks have a higher priority than the continuous task, but I still dropped the max scan time from 3.2 mSec to 1.2 mSec. I actually changed the task back to continuous because there are a couple dozen similar machines, but it was an interesting exercise.


#6 protiusmime

protiusmime

    Newbie

  • MrPLC Member
  • PipPip
  • 6 posts
  • Country:United States
    United States

Posted 19 July 2008 - 03:30 AM

I need to reset a group of RTO's at 6AM every morning. I have never used the free running clock in RSLogix 5000 and can't seem to find it anywhere. How would I go about doing so? Your help is appreciated. Thanks in advance.

JS


Excellent approach by Ron, et. al. One additional use that we are doing is to update all PLCs on the highway, comms by the following:

at say 23:50hrs (military standard), MOV the dint array to a tag base range, then MSG date/time tag base to each PLC upon change.. first to an integer array in each, then to the S files. MSG.DN triggers the next MSG send, etc. etc. We also use a day increment counter that is reset >7, so you could use that rollover to update the PLC system clocks. We are using a CTX for the master in this fashion to keep all others in "sync" for production tallies and a bunch of other calc timings.




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users