Omron CPM2A issue

Sidewinder

Lifetime Supporting Member
Join Date
Apr 2013
Location
Swansea
Posts
83
Hi all,
Long time, no posts, sorry, I did not thank anyone for the help I had sorting out the Omron comms from my last thread, so I'll do it now.
Thanks! ;)

Sorry for the long post, but I hope to try & explain the situation & give you enough information to help me out & see why I’m asking.
Same client, same machine as the last thread.

Machine builder has gone through, got a backup for the client no problems.

Now the client wants to mod the machine, we are adding a second feed section onto it, which will co-exist with the existing feeder for now.

It is a special purpose machine, the only one in existence, though there may be others similar, and there are almost certainly other machines that do the same job by other vendors.

The client wants to be able to literally switch from one feeder to another, and manually re-thread the product as the feeder is his most unreliable & slow aspect of the machine.

We are trying out a new mechanical design, so he has his reservations on the new unit and wants to be able to revert back as he understands the existing unit.

Now there is a selector switch on the machine for an old redundant function which I can re-programme for the feeder selection switch.

However, first I have to reverse engineer the programme.
There are no comments, symbols or labels, in the existing backup, and the client has no drawings, nor any programme info.

The feeder is 1/3rd to ½ of the machine!

Now I started by physically tracing the I/O and noting what does what, where it goes etc.
Now I have an IO map.
Next I created symbols for the I/O thus making the ladder easier to read, to simplify the understanding and making it easier to reverse engineer.

Next I created symbols for all the working bits (latches) etc. nothing meaningful yet until I know what they do, just Latch_1 etc.

Next was the timers, this is where I became unstuck & I don't know why!

I created a Local symbol for the timer "Timer_001", as there is a timer in the programme TIM001, that is a 100ms timer with a base address of 000, yes?

So I create a symbol, call it "Timer_001", data type "TIMER", Address or value "TIM001", I put a verbose description in the comments box to make it easier to follow whilst I am working on the programme.
Now this then turns the ladder rung read.
The timer is already programmed with a #2 (for example for 200ms, that is two ticks of the timer, yes?)
The red colouring of the vertical bar at the LH edge of the ladder, is, as I understand it an error, which when I try to compile is confirmed, with an error such as this:
"ERROR: Operand 0 uses symbol 'Timer_001' whose data type is not NUMBER at rung 10 ( 6, 0 ).
Now this is where I REALLY come unstuck, as I can’t for the life of me see what I have done wrong!

I’ve tried them in Global & Local symbols & get errors with both, but different in Global, in Global I get an error like this:
“ERROR: Operand 1, Timer_001, out of range at rung 10 ( 2, 3 ).”

This rung is not my code, it is either the machine builders, or a previous freelancer.
In the pdf attached, both the timer contact in the rung, & the timer show red!
This rung was a working rung downloaded from the machine, then I added the symbols, eventually once I know what the timers do, & when I add my own, I want to give them more descriptive names than 001!


Any help gratefully accepted.
 
Just create a BOOL symbol - T1 - it will automatically allocate to the done bit and the timer. I expect you are using an up to date version of CX-Programmer?
there is no need to create a TIMER symbol.
 
Hi BobB,

I am using CX-Programmer V9.x, so pretty up to date I believe.

The timers already exist, so I am just adding symbols to them to make the programme easier to follow to reverse engineer.

I will try what you suggest & see what happens, though I went down this route as I expected the symbol data type should match the symbol function as it were.

I'll try it with one & report back.

Supposed to get the thing reverse engineered, reprogrammed & working in 18 hours from now!

Don't think so at this stage, nearly 21:30 BST at the moment! :(
 
Tried that & failed!!!

Well at least editing the existing timer symbol to a BOOL with the tag T1 failed.

Can't see what I am doing wrong!
 
I just set up a new PLC - CPM2* - then wrote some code with a timer in it - T0.
I then double clicked on the timer contact - alt e - I entered a symbol xyzt - then put xyz timer in the description and the symbol appeared in the symbol list as a BOOL.
I then deleted the symbol in the symbol list - added a new symbol xyzt - Bool - T0 - and entered xyzt in the description.
It worked both ways without error at all and labelled the time object as xyz timer.
 
Thank you Bob, as I suspected you are correct!

Having been back to site this morning & discussed with the machine owner the status of his stock & the machine programme etc. we decided to rebuild the machine with the new parts, but with the new unit out of position.
All proved out by forcing of bits, but, still needs the code sorting.

The pressure is now off.

I may have not explained myself correctly.

As you correctly state I can create a symbol related to the timer contact and it works.

I was trained to document everything in the programme project as much as possible, so I was trying to create a symbol for the timer "function block" so that it could be easily understood & read in the project to make it easy to follow.

This is where my programme goes into error.

I'll keep trying & researching, if there is anything that can be added I would really appreciate this, in the mean time I will label the timer contacts as you have described & find another way to add comments & descriptions to the timers via rung comments etc. rather than as symbols.

If I could use symbols to describe the actual timer "function blocks" then that would be REALLY good! ;)

Thanks again.
 
Right click on the element and select properties - now you can put comments on each element - inputs, outputs, timers - you name it. They are numbered with an index at the top of the rung. If you wish to start a new line in the comment box ctrl-enter will drop you to a new line.
Comments will only appear along side outputs thogh - all other comments appear at the start of the rung - the element is numbered and corresponds with the number at the top of the rung.
Hope this helps.
 
Just to pop back & say thanks very much to BobB for helping out, have managed to get my notes into the programme OK.

Just a little surprised that I could not create symbols for the timers "FB"'s in the same way you can for a BOOL contact, even when selecting what appears to be the correct info.
Not important now anyway, as using the properties boxes at least I can get some descriptions into the programme to follow.

Looking through the old ladder, there are two rungs with duplicated logic feeding two separate timer starts with different addresses.
So:
ip1&ip2&ip3-->tim1
ip1&ip2&ip3-->tim2

The outputs of these timers are then OR'd to set a latch.
so:
tim1 or tim2-->latch1
With some separate logic to reset the latch elsewhere.

I can't really fathom why this would be done, unless the first rung was being missed and the timer not started, so the next rung was added to act as a second chance?
Surely there are better ways?
I've never come across this before.
I don't know IF my guess is right as I am not at the machine, I'm programming in the office, my gut instinct is to take the duplicate rung out, & remove the timer contact and try it, then finding out, why, it fails, IF it fails & fix the problem not the symptom?
If it becomes too involved, then I can always stick it back in?

Thanks,
 
You used to have to create symbols for both the word and the bit with timers and counters. We all had a dummy spit and the resolution was create a symbol for the bit and it would automatically allocate to the word as well - pretty happy with that as it is quick and does the job. Speed in programming is my main issue with software - also using a keyboard instead of getting RSI using a mouse. Work for myself and I can make or lose a lot of $s writing software so quick is good.
The comments on the elements are really quite good. I hardly ever use them - do not get enough money out of most jobs to spend the time. You get what you pay for!
Do not know why you would want to create a different symbol for the done bit and the word - makes no sense to me. Just doing the done bit saves me time and money.
By the way, they are not FBs but functions - great things - FBs are a pain in the A to me as they cost me time and cause aggravation. Functions are really quick to use - FBs are not!
NOID re the timers - only the programmer could tell you why.
By the way - the CPM series are dead and buried and no longer supported. I would be looking for a newer PLC as a replacement if I were you.
 
Thanks Bob, I was not looking to create different symbols, but just to give the timer some sort of descriptive name, which I would then have used the same on the bool op.

I'm also basically working for myself, & I underestimated this one!
However, I'd rather get it right, and put it down to experience...

I appreciate that they are not true FB's, I'll not call them that any more, but I used the term originally in the thread to differentiate between the timer function & its bool output bit IYKWIM.

Thanks again for your help.

As far as the timers go, I have no idea either!
Just seemed odd to me, I'll take the "duplicate" code out and see what happens, but I'll save a version with it in, just in case, I can then quickly squirt it down if it seems to need it.
 
That surprises me - as far as I know they are discontinued and replaced with the CP1 series. Cannot buy them from Omron in Oz any more.
 
Another Q if you don't mind, same thing, I've just finished reverse engineering the existing programme & labelling it up so I can follow it.
Have taken a few lines of redundant code out that had been disabled by AN Other by putting P_Off into them!
Tried to run the programme through the simulator, it's greyed out.
Using Cx-Programmer V9.03 & have CX-Simulator 1.94 installed also, as I have the CX-One package.
Now I'm not sure if this won't work because I am running Win7Pro x64, or because the PLC is a CPM2A.
Could you be so kind as to shed any light you can please?

Thanks,

As you can tell, I'm no Omron expert! ;)
 
I am only a little squirt too! We all learn all the time and I have been working with them for years - still go looking for solutions and find functions that save me heaps of time. Bad news if you cannot learn something everyday.
It is fully compatible with Win 7 x 64 bit as long as you have the 64 bit USB drivers installed. Has been since about 6 weeks after Win 7 x 64 bit came out - was 32 bit compatible in about 3 weeks.
I use P_On in front of every rung - if you want to put in a contact before the existing logic it is easy to move it all right and insert - if you do not you have to delete and add lines to make the ladder right - saves lots of time. Also if I want to disable a rung during commission I just put / on the P-On - also saves heaps of time and is easy. With a lot of other PLCs I have to use a whole heap of M bits to do this - PITA.
I do not know why the simulator will not run - send me your program by PM and I will have a look for you and see if I can find out why.
No guarantees though as it will be on another computer of course.
If you are going to be working with Omron more often let me know and I will send you a really quick and easy way to do latching and non-latching alarms and alarm handling for indicating lights, sirens and the like.
 

Similar Topics

Hi all, My name is Firdaus. I am a teacher. And for the next semester I have to teach PLC to student. The problem is, I just move to this school...
Replies
6
Views
2,008
Hi Folks. I have a problem with an Omron CPM2A-60CDT1-D High Speed Counter. It had been working well, the problem arose when a very minor program...
Replies
3
Views
1,474
Hi Folks. I have a problem with an Omron CPM2A High Speed Counter. It had been working well, but the problem is that a program change was...
Replies
2
Views
1,385
Omron's CPM2A has a compact flash card slot. Can an Omron program simply be copied to a compact flash card using a Card Reader or must it be...
Replies
1
Views
1,525
Our company using OMRON sysmac CPM2A plc for small machine. presently we dont have the software to connect to PLC. Please anyone can send me the...
Replies
1
Views
1,557
Back
Top Bottom