fredal

Program a bell with the clock on CJ1M-CPU11

19 posts in this topic

Hi, i'm new on programming Omron PLCs, I did Allen Bradley and Moeller before but never on a program like that, so I can't compare anyway. I try to make ring a bell with the hour. Example: at 7h59 a short ring, at 8h00 a long one, etc. Everything is working except the hour itself. The timers and even the days are working (the A354.01 for monday, etc.) I(i took the days because there is differents bells at different hours dependly of the day). I want to know how to write the hour, or maybe the special function to do that.I tried =DT and = & MOV... I know the time is in BCD, but i don't really know what it is exactly and how to convert it like in Hex or decimal to compare... maybe I don't need that neither... Thank you!

Share this post


Link to post
Share on other sites
Welcome to the forum. The hours and minutes are both in one channel (word) A352. The hour is in the 2 right digits, minutes in left 2 digits. Example: 7h59 A352=5907 8h00 A352=0008 You should not need to convert the numbers. If you are using Compare instructions, just understand that Hex (BCD) numbers need to be preceeded with a # sign. Hope will help.

Share this post


Link to post
Share on other sites
Note that the CPU clock data in A351-354 are READ ONLY. The previous post is incorrect:- Minutes are in the High Byte of A351 and Hours in the Low Byte of A352. There are two methods to change the CPU clock:- 1. Go On-Line with CX-Programmer. A "PLC Clock" Icon will be displayed in the PLC workspace "Alt +1" Select this and set the clock as required. 2.Use the "DATE" instruction to adjust the Clock in your PLC program. This requires you to specify 4 data words with the new data you want to change. First MOVE the new data to these four words and THEN activate the "DATE" command. Edited by BITS N BYTES

Share this post


Link to post
Share on other sites
Sorry for the incorrect information! I misread the manual. Thank you for the correction BITS N BYTES.

Share this post


Link to post
Share on other sites
Sorry, I didn't express myself correctly.. I know how to change the PLC hour. I need to know how to make the hour activate the bell, like when = function is on, the bell rings until the timer is done. I don't know if i should use =(300), or =DT(341), or something else, and also how to write or put the hour into these functions to make it works. Thank you!

Share this post


Link to post
Share on other sites
Hi, An example program to: Short chime at xx:59 - one minute to the hour Long chime on the hour Also has Gong which chimes the number of times for the hour. Nibroc Hour_Chimes.cxp Edited by Nibroc

Share this post


Link to post
Share on other sites
Rings bell [W0.00] for 5 seconds on the Hour. Another way to achieve the same. First program stores the last hour value and examine when it changes. An alternate [simpler method] in second program stores minutes. Whenever minutes = 0 the bell sounds. Hour_Timer.cxp Hour_Timer1.cxp Edited by BITS N BYTES

Share this post


Link to post
Share on other sites
thank you for your help, i will look the files as soon as I get time! I also found a way to make the bell ring when i want, by using MOVD (move digits). I isolated the digits in A351 of the minutes and the digits in A352 for the hours. It works but it is complicated! If I can simplified my program with your help that will be number one! Thank you!

Share this post


Link to post
Share on other sites
The Bells, the Bells. Enough already!! Hey Quasimodo, I think you have received sufficient ideas to fulfill your original thread request. Use them as you feel best and end this thread!!

Share this post


Link to post
Share on other sites
Samantha Fox could also let you ring her bell....

Share this post


Link to post
Share on other sites
This has been around in other posts. For minutes and hours use a mask ANDW #FF00 D2000 and ANDW #00FF D2001 then compare the registers with the times you want CMP D2000 #59 etc. Really easy that way.

Share this post


Link to post
Share on other sites

@

BITS N BYTES

Since I'm new to OMRON I wanted your help!!!

I'm trying to read and write time for CP1E PLC but only i could get to do is read the time.

Though I used DATE instruction but that too in vain!!! So if any one or u have any instruction or Sample that would be good.I read 1 manual and found to use r;CLOCK WRITE FINS (0702 HEX) but I could not get this instruction

Can U help me?

PS other member's are also kindly welcomed to give me advice!!!

 

Share this post


Link to post
Share on other sites

Not all CP1E have RTC (clock).

What is your PLC model?

Share this post


Link to post
Share on other sites
58 minutes ago, pfort said:

Not all CP1E have RTC (clock).

What is your PLC model?

 

CP1E Clock.pdf

Share this post


Link to post
Share on other sites

I'm using CP1E-N30DR-D and on going online i can see the PLC CLoCK and also in A351-354 i can read the time ....But..... i want to write the time as in my case the time should be sync with my NTP server.

For this i want to write the time in the PLC but via using DATE (735) instructions i cant make it work.As the time i write in the DATE instruction remains the same and the clock time doesn't increases with the change in TIME.

And as soon as I unforced the bit the Time of PLC again changes to the original and the clock also starts moving again.

So kindly help me ...or enlighten me with same.

Or provide me some sample code though i have gone through the sample code given in the help section for DATE Instruction but i cant make that work!!!!

 

Edited by varun_pandey

Share this post


Link to post
Share on other sites
On 10/12/2016 at 6:16 PM, BITS N BYTES said:

Post your code.

Problem Solved!!!!!

Share this post


Link to post
Share on other sites

The purpose of this forum is NOT a one way process. It is to share questions and resolutions with all members.

With that in mind, please tell us HOW your problem was solved?? :shrug:

Share this post


Link to post
Share on other sites
On 10/23/2016 at 3:40 AM, BITS N BYTES said:

The purpose of this forum is NOT a one way process. It is to share questions and resolutions with all members.

With that in mind, please tell us HOW your problem was solved?? :shrug:

See the Date Instruction Told By You was Perfectly Good.....I was trying to check the instruction via Simulation Mode as I didnt have the PLC and The PLC is on Site.

As we can check the code in Siemens therefore i thought that we could do the same there also.

On site I used the Date Instruction and the clock was synchronized perfectly!!!!

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now