RTC function in Codesys vs TwinCAT

AlfredoQuintero

Lifetime Supporting Member
Join Date
Feb 2015
Location
Yokohama
Posts
1,552
To Codesys and TwinCAT experts, if you could spare some time to help this newbie, I will be so very grateful, just please promise not to laugh too raucously at my ignorance.


Months ago I managed to write a simple Codesys program that measures the time the PLC program has been up and running using the RTC (Real Time Clock) function, but what a head scratch I have hit when trying to do the same with TwinCAT. I use a first scan bit to get an initial time in the TwinCAT, but even though the EN bit is FALSE, this RTC is executed every scan, thus I have no initial time to subtract. After much head banging I have swallowed my pride and herewith cry for help.

20200126_RTC_Codesys&TwinCAT.jpg
 
Just remove that RTC_0 and get time with MOVE from RTC-2 that same first scan bit. In TC3 rtc block works different compared to codesys. It will run every scan if it is initialised once. EN input is only re-initialisation.
 
Jkoso. Thanks very much. I feel embarrassed I did not figure this one out, but you have helped me a lot. If you were in Yokohama I would want to invite you a pint or two.

20200127_RTC_Codesys&TwinCAT.png
 

Similar Topics

Hi ... I am very new to plc and hmi use I have a old sysytem of footwear machine in which hutachi cpu02h22hb cpu is installed with diaplay of...
Replies
1
Views
2,299
I have some logic that I have written within a 5380 series controller that tracks the time an event is started, while the event is running an RTO...
Replies
2
Views
94
Had an interesting experience this morning. An old Panelview 600, 2711-K6C5X series B to be precise, comes up as error 32. Unfortunately it...
Replies
0
Views
209
Hello, I have been getting more and more requests for Real Time Clock (RTC) sensitive automation from my clients. I know that there is a Modbus...
Replies
13
Views
2,759
Back
Top Bottom