Omron CPM2A issue

Thanks Bob, I'll try to send the programme, it is very small, as it is a simple machine, but we have NO info at all on it!
The end user was stitched up a treat by the machine builder, he paid for a Rolls Royce & got a Wartburg!
(Not sure if the car analogy translates, though sorry!)
He has had a few guys in since to do mods, but none have documented anything, nor have they actually modded the programme correctly, IMHO, there are a lot of "forces" in place by using P_on & P_Off

Some of which IMHO left the programme vulnerable to undefined states, where the original author has put interlocks in which have been disabled by the P_On & P_Off states!

Anyway, thanks for the offer, the programme I will send, if I can will be the "cleaned" up version of the original with my comments etc. as best I can, and my start at interlocking for the new feeder to be present, but not work, in parallel with the old one.
Please don't laugh! ;)
 
No laughing at all - been there before! Hopefully never again as I generally only do new work these days but have just quoted a possible horror! Schneider for this quote - not my favourite.
 
Hi Guys
FYI - the Cx-P simulator is only good for the newer PLCS (CJ, CS & CP1 series). The older "C Series" units such as the CPM1 & CPM2, CQM, C200H etc do not have a simulation option. You have to test he code on the real thing.

Rgds
 
OK, I've changed the CPU type & removed one line of code that had a command that would not run on a newer CPU type, this is from the original machine code so I know it runs!
Any suggestions on how to run a simulation please?
I've not really used the Omron software before!
I've tried a few things and can't get them to work...
 
If you change the CPU type to CP1L the simulation will run for you. You may have to change a few things though although CX-P does a pretty good job of changing the programme to a different PLC type.
 
Hi Sidewinder,
The simulator in Cx-Programmer is only for the newer CPU's. If you want to run a simulation you will need to change the CPU type to something like the CP1L. Be aware there are quite a few changes between the CP1L and the CPM2A which may mean some changes to you program to make it work. At least all the "flags" like the always ON bit and the compare flags (Less than, greater than etc). This is the only way you will be able to run the simulator. Option #2 is to get a spare CPU and run it online with that - could be a costly option.

Regards
 
Done bob thanks, I just deleted one line the one with the SPED(64) command which I knew ran and had no changes.
Thanks.
Trouble is I have run 3 options of my code now & none run as I want! ;(
Back to the drawing board I think.
Gutted is not the word, the command I wanted to use to simplify my code is not available in this CPU!
Gonna have to re-think the whole damn thing.
As far as I can see is that as the whole thing is open loop, all relies on timers, and the machine functions just working there is no feedback, bar one switch for a conveyor indent sensing.
So, it is down to a timing thing, and, "hoping" the timing stays consistent!
 
Just curious what "command" you are looking for.
There are over 400 instructions in the CP1 instruction set.
Can you provide a explanation of what you want to accomplish?
 
Thanks gtsupport,
I looked up an "=" command function and it is not in the CPU I have.
There are others, hence the re-think.
I've just never programmed a fully timed sequence before, and never Omron either!
I've always had some sort of feedback in everything I've ever done.
I expected the mechanics to have feedback in the way of position switches, until they were delivered, then I find there is none.
I am trying to programme a 2 cylinder & conveyor feed sequence.
I got it into my head to use a state machine, so I generated the states OK, got all the conditions I wanted OK.
Programmed the timers I need for each step, as they have different durations OK.
I have done the state dependent outputs OK.
I "think" I have done the conveyor control bit OK, this does have a switch, I have to start the conveyor, wait for the switch to transition low to high then stop the conveyor some time after, again no position switch for the exact index, but, this timer may go when I get to the machine, I hope!

I am struggling with getting the sequence control steps.
I have the logic "equations" for the states, I am struggling on getting the sequence to follow the way I need it to.
I did crib a sequence control example, but that used the "=" function.
I am currently struggling!
 
Sidewinder,
I am not sure I understand what you are looking for in an "=" instruction.

If you are working in the CPM2, equal is done with a CMP (Compare) instruction. The result of the compare will set one of three bits, 255.05 (Greater Than), 255.06 (Equal) and 255.07 (Less Than). See example attached.

The CP1 processors have inline compare instructions.
Equal is function number 300.

Hope this helps.

CPM_CMP.jpg
 
Thanks again gtsupport,
I had looked @ the function 300 which as you say was not there, so I looked at the CMP function & the EQ bit 25506.
I've just got myself totally confused about the sequence control.
I have stopped trying to code it & gone back to long hand descriptions to ensure that I have all the transitions right first, then I'll go back to looking at using the conditions to trigger a state move via a counter & a CMP function I think, as I say, I've just confused the heck out of myself, and I have no one to turn to to ask any questions, or discuss any queries with, except you peeps on here!
I feel I need to give it a good bash myself before I start asking for help with the code though.

Sorry yes it is a CPM2A cpu
 
Last edited:
OK,
Here we go, now the ribbing can start! ;)

First, a huge thanks to BobB for the help so far, it has been great, and I appreciate it, thanks also to those who have already helped on this thread, again the help is appreciated.

So here we go with the essay, sorry, but I’m addled.

Never programmed Omron before.
Done, “some” S5, “some” S7 & “some” AB, 99.9% mods of other peoples code, plus some on the CUPROC controls below.
Spent most of my life doing commissioning & field service, primarily on machine tools, for a machine builder, Landis Lund, small regional UK 3rd party repair company, a controls system manufacturer, Indramat, and the last few years on my own, doing anything that pays, and sometimes doesn’t, mechanical, electrical, software, & electronics, repairs & small mods!
So not much PLC writing from scratch, bar large mods on the old Landis CUPROC 16 & 3200 systems which were done in reverse Polish notation & written in text files, along with BASIC code for the main programme.
We never did PLC programs @ Indramat as they were done by the machine builder, we were just taught to programme so we could follow the existing code, it was not our code to mod as it were.

As I have said above, I have no one else to discuss this with.

I’ve got a method in my head & I am going round in circles, I can’t think of another way to do it anymore.

I have a “simple”, mod to do to a machine, it is a one off machine & the builder is no more.
No electrical drawings & no info on the PLC code.
I have done a download of the PLC, manually traced the I/O & commented up the original programme & studied until I understand it, I think!

We are disabling the existing feeder on the machine, but leaving it there to be switched back to if needed.
A new feeder is being fitted, again which can be disabled and the machine reverted back to the old unit as above.

I have sussed out the code for the disabling of the old, and the enabling of the new, OK I believe.

I have only one switch on the whole new feeder thing, it is 2 air cylinders with spring return valves, so when powered off the valves revert to a set position which reverts the cylinders to a pre-defined position, which is the start cycle state.
The switch is on the existing output conveyor and detects the indent for the part to be loaded into.
So I am using this to keep the feeder in sequence. I hope.
This switch will also stop the conveyor once started.
I have sussed out the code to swap the conveyor control from the “old feeder” to the “new feeder”.
The motions of the air cylinders and the triggering of the conveyor start all has to be done off timers, I am a little worried about timing drift, so I have used high speed timers (TIMHH) I hope this will keep the timing as tight as possible, we are looking for say 30 parts per minute from this, so a tac time for the feeder & conveyor of 2 seconds

I got a state machine into my head, now I can’t think down any other road.
Did my state diagrams, flow charts etc. got my state transition conditions, and the state outputs.

Have programmed the outputs OK.
Have got the conditions for the transitions OK.
Have programmed the timers to create dwells for the air cylinders to move OK.
As I have said above, I believe I have the conveyor control sussed.
Also the feeder selection sussed.

I just can’t get my “state machine” to go from state to state!!!
I’ve never done this before either!

I have had two goes at logic, for you to laugh at. ;)
They are pdf’d and I hope attached to this post as V1 & V2, neither work when simulated.
I know the CPM2A does not have a simulation option, but, I have changed the processor type for one that uses a very similar memory map so I can simulate it, or at least that is what it seems to have done anyway!

My code is unstable, and doesn’t change states correctly, doesn’t start the timers when needed, just loads of errors, I just can’t think any more, my brain is addled.

I have also attached pdf of my state transition requirements, I know that this will not run as logic, well it would not & I would not have expected it to, I have done this so I could get my head around what was needed, & included it so that my thought process can be seen & what I see as the requirements of the transitions between states.


Sorry for the essay, & thanks for reading if you have got this far.

Next thing, HELP, PLEASE!!!

Thanks,
 
I think V1 should be close.

I think the issue is that the counter will not count.
201.00 will be on, which resets the counter.

To test, add a CF114 (always off) in series with 201.00 in the counter reset input and see if it will simulate.

Not enough time right now to look through V2.

Hope this will help.
 

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