Time-Of-Day in TI

Hilgard

Member
Join Date
Jan 2008
Location
Rustenburg
Posts
16
Hi Guys

Long time since my last visit.
Can any one maybe tell me how to read the day of month in a TI PLC? I want to excecute an opeartion on a certain day of the month.

Thanks
Hilgard
 
Program: 4PLCD Date: Tue Jan 20, 2009 Time: 07:16:15 PM Page 1

³SFP22
³Program Title: DAT+TYD
³Continue On Error: Yes
³Error Status Address: None
³Program Type: Normal
³Cycle Time (secs): 0
³Enable Program: Yes
³Compiled: No
³
³00001 IMATH T1 := STW142 & 0HFF
³00002 BCDBIN BCD INPUT: T1 BINARY RESULT: T2
³00003 IMATH T3 := STW143 >> 8 & 0HFF
³00004 BCDBIN BCD INPUT: T3 BINARY RESULT: T4
³00005 MATH V2309 := T2 * 60 + T4
³00006 MATH V2308 := STW225 + 1462
³00007 MATH V31899 := V2309
³00008 MATH V32649 := V2309
³00009 MATH V30499 := V2309
³00010 MATH T1 := ( STW141 & 0HFF00 ) >> 8
³00011 BCDBIN BCD INPUT: T1 BINARY RESULT: T2
³00012 MATH V6125 := T2 + 2000
³00013 MATH T1 := STW141 & 0HFF
³00014 BCDBIN BCD INPUT: T1 BINARY RESULTV6126
³00015 MATH T1 := ( STW142 & 0HFF00 ) >> 8
³00016 BCDBIN BCD INPUT: T1 BINARY RESULTV6127
³
Hello
STW225 is the value of the days past since 1-1-1984(hexadecimal)
V2308 is the integer value of the days past since 1-1-1980
V2309 is the integer value of the minutes past since midnight.
V6125 is the integer value of the current year(value is now 2009)
V6126 is the integer value of the current month (value between 1 and 12)
V6127 is the integer value of the current day of the month (value between 1 and 31)

This special function works with 555 and 2500 plc,s, I don’t know if there is a huge difference with the older 565 plc.

Of course this is only possible if your cpu can handle special functions and I remember that the old 560 cpu could only run ladder.
The 565 was about the same cpu as the 560 but it had an extra special function cpu board installed in the base besides the normal cpu.

Hope this will help you?

Regards

Henny
 
A little clarification:

For the TI545–1102, TI555, and TI575 controllers starting with
release 3.0, the time of day is initialized to 1-Jan-1984 at 12:00 AM. Prior
releases of these controllers and the TI560/TI565 (all releases) initiate the
time of day to 1-Jan-1900 at 12:00 AM.
 
Thanks guys

I got it working!!!
It is a TI 545-1102 PLC. I wrote the special function and it is working beautiful, I added the hour and minutes as well.

We will talk again.
 
Back
Top Bottom