robbd86

waste project

9 posts in this topic

Hi all,

I am looking for some help. I am in the process of creating a waste program on a CP2E PLC. I have an ns hmi screen to go with it. could anyone recommend a way to add two values together and retain it. For example:

First cart of waste of the day is measured and a move instruction is set up to move the measured value from D1 to D15. Then the second cart is measured and i want to add the two together. D1+D15.

This is probably simple and i am missing something obvious but i cannot seem to find a way. 

I also want to record the values for a month so basically just add it up then reset. Is there a way to export this to excel or something similar?

All help and ideas greatly appreciated.

Edited by robbd86

Share this post


Link to post
Share on other sites

I'm going to assume the measured value in D1 is a single 16 bit integer. When performing totals or accumulations, I generally use doubles (32 bit). Just in case we break the bank of the 65, 535 limit on 16 bit integers. 

In Omron PLCs, D and E memory are automatically retentive. They will retain their values after a power cycle. 

In my example I will use D20 instead of D15. You can use whatever memory you wish but I just wanted some separation because it works better in my brain. Also, I want to use an even memory location number. This is due to using Doubles. Again this is just my preference. If we only use even numbers when dealing with Doubles, then we know not to mess with any odd number locations and we don't mess anything up.

Also note the use of the "@" on the instructions. Preceding the instructions with "@" will execute the instruction for one PLC scan on the rising edge of the input condition (Measurement Complete).

MrPLC_Accumulator.thumb.png.ce134043c2b9

Edited by IO_Rack

Share this post


Link to post
Share on other sites

As far as the data export... Do you have some sort of SCADA at the plant?

You would be much better off using some HMI software capable of FINS communication for pulling that data. You could write the data to a CF in the NS but that is a very old method that may be more trouble than it's worth. It's been many years since I've done that.

Share this post


Link to post
Share on other sites
20 minutes ago, IO_Rack said:

I'm going to assume the measured value in D1 is a single 16 bit integer. When performing totals or accumulations, I generally use doubles (32 bit). Just in case we break the bank of the 65, 535 limit on 16 bit integers. 

In Omron PLCs, D and E memory are automatically retentive. They will retain their values after a power cycle. 

In my example I will use D20 instead of D15. You can use whatever memory you wish but I just wanted some separation because it works better in my brain. Also, I want to use an even memory location number. This is due to using Doubles. Again this is just my preference. If we only use even numbers when dealing with Doubles, then we know not to mess with any odd number locations and we don't mess anything up.

Also note the use of the "@" on the instructions. Preceding the instructions with "@" will execute the instruction for one PLC scan on the rising edge of the input condition (Measurement Complete).

MrPLC_Accumulator.thumb.png.ce134043c2b9

Thank you so much for this. Makes perfect sense. I will put this into action and let you know how i get on. Appreciate the help

Share this post


Link to post
Share on other sites
12 minutes ago, IO_Rack said:

As far as the data export... Do you have some sort of SCADA at the plant?

You would be much better off using some HMI software capable of FINS communication for pulling that data. You could write the data to a CF in the NS but that is a very old method that may be more trouble than it's worth. It's been many years since I've done that.

We do but they like to lock everything down to their own equipment and don't allow us to play with it. I wanted to be in control of this and have made a nice little program that changes shift and separates the machines etc so i would be pained to use them at this point. Any recommendations for a (cheapish) scada software?

Share this post


Link to post
Share on other sites
19 minutes ago, robbd86 said:

Any recommendations for a (cheapish) scada software?

Best bang for the buck is Inductive Automation's Ignition platform.  Server licensed instead of seat or page count or tag count licensed.

Full disclosure:  I'm an Ignition integrator, and 3rd party module developer, and very much a partisan for their product.

Share this post


Link to post
Share on other sites
1 minute ago, pturmel said:

Best bang for the buck is Inductive Automation's Ignition platform.  Server licensed instead of seat or page count or tag count licensed.

Full disclosure:  I'm an Ignition integrator, and 3rd party module developer, and very much a partisan for their product.

Thank you for the tip. I will have a look into this.

Share this post


Link to post
Share on other sites
On 20/12/2023 at 1:58 PM, IO_Rack said:

I'm going to assume the measured value in D1 is a single 16 bit integer. When performing totals or accumulations, I generally use doubles (32 bit). Just in case we break the bank of the 65, 535 limit on 16 bit integers. 

In Omron PLCs, D and E memory are automatically retentive. They will retain their values after a power cycle. 

In my example I will use D20 instead of D15. You can use whatever memory you wish but I just wanted some separation because it works better in my brain. Also, I want to use an even memory location number. This is due to using Doubles. Again this is just my preference. If we only use even numbers when dealing with Doubles, then we know not to mess with any odd number locations and we don't mess anything up.

Also note the use of the "@" on the instructions. Preceding the instructions with "@" will execute the instruction for one PLC scan on the rising edge of the input condition (Measurement Complete).

MrPLC_Accumulator.thumb.png.ce134043c2b9

Thank you for this it worked perfect.

Share this post


Link to post
Share on other sites

You are very welcome! Glad we could help and good luck with the remainder of your project!

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