Wall Clock

You might also like

Download as doc, pdf, or txt
Download as doc, pdf, or txt
You are on page 1of 6

Objective: Using the Wall Clock

Hardware: 1769-L36ERM V20 and RSLogix 5000 V20

Create a default project with no I/O for the 1769-L36ERM. Download and go online. As you can see from
the screen shot the project has just an END statement. The controller is in program mode.
If you want to quickly set the date and time from the computer, select Controller Properties and select
the Date/Time tab. Select Set Date, Time and Zone from Workstation. The date and time shows up
here and matches with your computer’s date and time.
If you wish to read this wall clock programmatically we do it this way, then enter this rung:

Right-click on mylocaldatetime[0] and select New. We need to make this tag an array of DINT. Click on
the … button to the right of Data Type.
Change Dim 0 to 7 because we need a DINT array of elements 0-6 to store the date and time of the
controller. Then click on the Create button.

I’m doing an online edit so now my rung looks like this:


After I finalize my edits and go to run mode to execute the instruction, if I open up my controller tags
you will see the date and time as follows:

My logic looks like this:

My tags look like this:

Which matches the online help of where the first element of the array is year, followed by month, day,
hour, minute, second, microseconds.
Which also corresponds to the time of my computer:

Note there was a few minutes difference from the time I took the screen capture of my computer’s clock
and when I took a screen capture of the data out of the controller. But you get the idea that it matches.

To programmatically write the time, you change the SSV to a GSV. You would use MOV instructions to
load the date and time into the mylocaldatetime array.

You might also like