Sign in to follow this  
Followers 0
ebanks

Omron counting limitation bypass

15 posts in this topic

I am using a Omron CPM1A PLC and need to increment a counter on a vision machine to 500,000. I have seen the limitations on the counters are 9999. Can someone post an example of how to work around this problem? The trigger is a fiber optic sensor mounted on the vision machine and the machine inspects a very large quantity of parts.

Share this post


Link to post
Share on other sites
ebanks, Welcome to the forum! Do you want to count up or down? What needs to happen when you reach the count value? Depending on above, you could cascade counter instructions, or use the @ADDL instruction and a CMPL. Hope this will help.

Share this post


Link to post
Share on other sites
I am counting up.There is no limit that I will reach. It resets everyday at 7:00 in the morning. This info is being posted on our network via dde.

Share this post


Link to post
Share on other sites
If you want to count up, use the @ADDL. 8 digit bcd add. No need for the CMPL if you are only counting. And by the way the "@" is very important! This should solve your issue. Edited by gtsuport

Share this post


Link to post
Share on other sites
One word of caution, with this command, if you are putting the data into say D1500, the first 4 digits will be in 1501. So if you are outputting them somewhere you will want to send 1501 then 1500 to have the number in the correct order.

Share this post


Link to post
Share on other sites
Not to be rude, but have you tried looking in the manual? CPM1 Programming Manual @ MrPLC.com Take a look at the examples in the manual, and if you have questions, we will be happy to help.

Share this post


Link to post
Share on other sites
I don't believe this is correct Chris. If the result of the calculation was 12345678 then DM1500=5678 and DM1501=1234.

Share this post


Link to post
Share on other sites
You said exactly the same thing as me. The first 4 digits of your 8 digit number are in DM1501....

Share this post


Link to post
Share on other sites
OK.. I thought you were implying that a word swap had to be done...sorry. You can actually set the DDE link point as a double word and read the 8 digit value at once.

Share this post


Link to post
Share on other sites
How do I do this in DDE App. Below is my current setting in excel. =Interact|VALUE!'riker\omrn\1:dmb905'

Share this post


Link to post
Share on other sites
Omron tells me that double words are not possible on the CPM1A. What is the next suggestion?

Share this post


Link to post
Share on other sites
I am currently incrementing a dm901 until it reaches 9999. I am doing a cmp tool to compare dm901 to #9999. When dm901 equals #9999 I increment dm900 and reset dm901 to 0. This seems to work some of the time. It is almost like the reresh rate is not keeping up with the incrementing rate. The parts are going through the machine at a max rate of 5 per second. Is refresh rate an issue? What can I do?

Share this post


Link to post
Share on other sites
I just programmed a CPM1A with the ADDL(054) (instruction # 54), and it works correctly. This instruction will add two 8 digit BCD numbers together. Example: @ADDL(054) DM200 DM202 DM200. Load a value of 1 into DM202. This will create a "counter" that will "count" up to 99,999,999. Your count value will be in DM201, DM200. To "reset" or "zero" the counter MOV #0 DM200, MOV #0 DM201. Hope this will help. Edited by gtsuport

Share this post


Link to post
Share on other sites
If I am reading this correctly... you have your words reversed. DM900 will be your Least Significant Word and DM901 will be your Most Significant Word. For Excel to read it correctly... make sure your point (Internal Data Type) is set to Double Word Unsigned BCD and the (Data Location) is set to DM900. gtsupport's method will work as well.

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
Sign in to follow this  
Followers 0