plc clock

dwpang

Member
Join Date
Aug 2012
Location
singapore
Posts
68
hi i am using twidosuite for plc programming.

currently i want to establish a real time clock in the plc. so i use the %sw50-53 system bits connected to short. i also used some memory words, so for example:
%mw10 := %sw50
%mw11 := %sw51
so on....

however, when i run simulation, the %sw50-53 showed some weird numbers which do not reflect the date and time correctly. and the numbers do not change like what a real clock should do.

is it because i lack some rungs or simulation does not run the real time clock?
thanks
 
i thought that is a schedule block?

i am now trying to make a running real time clock, so what i am encountering now is that the numbers i managed to convert from BCD to decimals, which is good. but then the numbers are stationary! which means it is not running like what a clock should do... stressed

Picture.jpg
 
You have to read %SW words continuously when system bit %S50 is zero.

If you set %S50 bit, then you can adjust new time from program an clock is freezed/stopped. New time is setted to RTC and clock started, when you reset %s50 bit 1->0.

And if you want set time, then you have to use ITB conversion (integer -> BCD format)

Remember also, that when you use PLC simulator, you can't adjust time, because computer time is used for simulator. Real PLC is better for testing this
 
Last edited:
Do you have the time clock module in the PLC? It is an extra I believe.
 
Can you Zip a copy of your program please
should be in the form of a file with the directory of the same name
Posted just after you BoBB
You are 100% right
 
thanks dude. but how do i read the %SW words continuously?

so basically if i wan to see the time change every second, i have to make sure the bit is set to 0 right. but then how do i read the words at a continuous pace?

thanks.
 
thanks.

I tried doing a simple one, as shown in the picture attached. just the conversion of the system word %sw50 into memory words, which shows the seconds of the time when i run the simulator.

however, i am trying to achieve a RUNNING clock, so the circled part, should be changing every seconds! but it is not. this is why i am very troubled.

thanks.

Picture.jpg
 
Have you configured RTC cartbridge to PLC?

You need configure it first to PLC, because you need also order it separately. Twido PLC don't have RTC clock, if you don't install it first to PLC base.
 
Last edited:
thanks lare.

oh so what you mean is I require the RTC cartridge for the real time clock? cause I am currently only doing the twidosuite PLC programming, so I thought there is an internal clock within the PLC software itself or sth. so basically I cant do the running clock thing with just a computer and twidosuite software right?

anyway, if I have a HMI, would it be possible I use the HMI to link it to the software and then let the HMI update the PLC clock through synchronizing methods?
 
I mean that twido PLC don't have clock, if you don't use optional time of day module on twido. It is ordered with code TWD XCP RTC.

On hardware config you then have to select if PLC have this module or not. I think that PLC simulator uses computer time, if you have selected that twido PLC have this time of day module installed.

And of course twido's own clock can't work if you don't have this module

You can also use HMI/Computer time, but then you have to take account what happens if communication is lost. It is maybe easier to use twido's own clock, it don't cost much
 
Last edited:
Hello!

I need to update the RTC 0 from a twido PLC and i don't know how to do. For exemple I configure first manualy RTC 0 from "configure data" option then I want to update data information from other software. I write system word from %SW49 to %SW53 with correct data, i setup %S50 but after that i don;t know how to update this information in RTC 0.
Please help me!!
 

Similar Topics

At the moment on my application (S7-1212C), the PLC/HMI are showing the correct time, i.e. the displayed time matches the time of the clock on the...
Replies
10
Views
903
The PLC in question is a S7-1212C. The PLC will be transportable on a wheeled trolley and used wherever it's needed in the factory. I've been...
Replies
14
Views
1,320
Hi, I'm using CX Programmer and just seeing what the best way to trigger an output from the plc clock time would be. I need this to come on at 9am...
Replies
4
Views
1,729
Hello I have a AB Compact logic 1769-L32E controller. I'm wanting to reset a counter at the end of each month. Since the months have different...
Replies
34
Views
9,439
Hi all, I'm running into an issue with a Modicon M340 PLC Clock and daylight savings time. I found an old thread that wrote out specific code...
Replies
3
Views
1,862
Back
Top Bottom