pedroborges

CX Programmer (CJ1M CPU12-ETN)

5 posts in this topic

Good, how in the cx programmer I create a code in which the user can deactivate the output by means of a time of hours and minutes that it defines.

for example, the user defines from 8:00 am to 6:00 pm output disabled or from 7:30 am to 5:00 pm output disabled.

who sets the hours and minutes for the output to be disabled is the user

 

 

Share this post


Link to post
Share on other sites

What PLC in particular?

Share this post


Link to post
Share on other sites

 PLC:  omron sysmac  CJ1M CPU12-ETN 

Share this post


Link to post
Share on other sites

pedroborges, did you get the solution for this???

 

Share this post


Link to post
Share on other sites

The date and time values are kept in the following registers:

62e2aa34a261a_CJ1Clockaddresses.jpg.f9f7

Unfortunately, Hours and minutes are not stored in a way that are easy to use, so you need to manipulate the information into a more useful arrangement.  I use the MOVD instruction to do this in the code below.  If I put hours in the upper two bytes of a word (bits 8-15) and minutes in the lower two bytes (bits 0-7), I can use two comparison instructions.  In my example below, I turn on the output between 7:30 am and 5:15 pm.  The time on my system was 11:51 am when I captured the image below.

62e2aa341d902_timesamplecode.jpg.7b353b3

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