Realtime Clock

A

Thread Starter

Anonymous

I want to read realtime clock of Modicon TSX Micro and compare with a string, for example: 01:00 ?
I did something but when i execute it appears a message error: Incorect realtime clock.

Do you know something in this sense?
 
Hi,

first You must set the clock in online mode.
In program use the "RRTC" function in operate block.

Best regards!

Zsolt
 
J

Johans garcia

It should utilize the instruccion RRTC to read the hour and date of the system and then disguising it :ej
RRTC(%MW520:4)
%MW524:=ROL(%MW520,8)
%MW525:=%MW521 AND 16#00FF
%MW526:=ROL(%MW521,8)
%MW527:=%MW526 AND 16#00FF
%MW528:=%MW522 AND 16#00FF
%MW529:=ROL(%MW522,8)
%MW530:=%MW529 AND 16#00FF

Good luck
 
F

Fernando Capelari

All the data regarding the real time clock in a TSX Micro PLC is stored on the system words %SW49, %SW50, %SW51, %SW52 and %SW53. You can easily see the contents of each word at the system words list inside the PL7 help. Take care that they are stored in BCD format.

Only one program instruction can copy all the data to a %MW words area: RRTC (%MW0:4).
RRTC = Read Real Time Clock.
Then, you can do whatever you want with it.
 
Top