mr_electrician

There must be a more efficient way.....

4 posts in this topic

Hello forum.  I am creating some code for a machine that will have 12 bays doing the exact same thing.  For example each bay will have the following:

3 Modes (Empty, Charging, Charged)

Timer (SP set from touch screen)

I have started to write the code but before I get too far into it I was wondering how more experienced OMRON programmers would go about this.

I know there is a better way than duplicating the same code for each bay with the only difference being a register pointer.

I have attached my 2 routines for you to see how I have been approaching this.

KepServer_Data.cxr

Charge_Timers.cxr

Share this post


Link to post
Share on other sites

Does your processor support function blocks?

Share this post


Link to post
Share on other sites
11 hours ago, chelton said:

Does your processor support function blocks?

 I have a CP1H

It is funny you mention this as I was wondering last night while falling asleep if that would be the right approach and how to go about making one.

Share this post


Link to post
Share on other sites

After watching a couple YouTube videos I went ahead and created my first ever FB.  Thanks @chelton for the advise!!

There is more massaging to do with it but so far it works as I need it to!

FB.jpg

FB Logic Snippet.jpg

2 people like this

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