OMRON CPM1A - Comparing DATA

braga

Member
Join Date
Feb 2009
Location
braga
Posts
11
hi,

I want to compare some data in the DM memory area but CPM1A omron plc doesnt support the =300 instruction. I used to use this instruction as it makes comparision every cycle.

How can i compare data in the cpm1a? I cant believe there is no other instructions available...I don't want to use the CMP instructions because then i need to insert a contact before them.

Help me think in a solution.
Thanks in advance.

Best regards,
Paulo Martins
 
yes i didn't want to use CMP, because this is the scenario:

I' ll be writing the plc memory with data. this data depends from wich button is pressed in an application in v.basic.

So i would like to test/compare several memory adresses in real time and if the comparision result is equal, power on por off the respective outputs. i think i can't achieve thos with the cmp instruction because the flags will only keep the last comparision result.

Example:
------|P_0.02sI|----------|CMP DM0 #10|

----|P_flagEQUAL|-------------()10.0

------IP_0.02sI----------|CMP DM1 #10|

----|P_flagEQUAL|-------------()10.1


Althoug I dint test it think this wont work

because all the outputs will be affected by the comparision flag state

Thanks for your reply

Best regards,
Paulo Martins
 
Your code as outlined above will work fine. While the equals flag will be updated with each compare the output (result) if tested directly after the compare as you have it will remain ON of OFF for the entire scan of the PLC code. The newer function =(300) is basicaly exactly the same except easier to use because you do not need several lines to execute it and it can be used as an input.

Consider using the always on flag (253.13) instead of the 0.02sec pulse and the compare will be executed every scan which is as close to real time as it gets without using interupt routines.
 
Then, elaborating on Woody's reply - if you need your outputs to be on for more time, then SET those outputs, and RSET them with a timer or other event when you're finished with them.
 
hi woody,

Thanks a lot for the reply. I was so convinced it wouldn't work that i wasn't even thinking of testing it but now i will.
And thanks for the information about the 253.13.

Best Regards,
Paulo Martins
 
RotaTech,

I will need them to be on until someone presses a button in V.Basic appliction. So when this happen the data in that memory adress will change and the comparision rsult wont return Equal anymore.

so can i do this?:


-----|253.13|--------|cmp DM0 #50|

------|EQUAL_Flag|--------|SET 10.0|
------|NOT_WQUAL_Flag|-----|Rset 10.0|

CAn I?

Best Regards,
Paulo M.
 
Should work fine,

You could try it this way:

-----|253.13|--------------------------------|cmp DM0 #50|
................ |
................ ------|EQUAL_Flag|----------|SET 10.0|
................ |
................ ------|NOT_WQUAL_Flag|-----|Rset 10.0|


Basically its the same thing but now it is all on one rung. Also the SET / RSET functions could be replaced with a KEEP(11).
 
Last edited:
thanks again woody,

I've tested it and u r right it works just fine,
only now i understand the scan cycle concept...

Thanks for the one rung sugestion, i think it's better for understanding the code in the future, its cleaner.

Best regards,
Paulo martins
 

Similar Topics

I've got an upload from an Omron SYSMAC CPM1A PLC but I cannot figure out for the life of me how to document the inputs and outputs. It's version...
Replies
9
Views
3,258
Hi, I have recently purchased an old Omron Cpm1a plc to practice on. I have a version of syswin that does not require a licence to program these...
Replies
2
Views
1,661
I have a Omron PLC with CPM1A-MAD01 anaolog input output module its reading pt100 temperature probe. When the machine is running it starts to...
Replies
0
Views
1,089
Hi, I have recently being using a Omron CPM1A-40CDR-D-V1 and transferred an old program on it. I was testing the program and making some...
Replies
2
Views
4,232
I have two of the same units that are using a CPM1A and an NT20S-ST121B-EV3. I am not able to connect to the touch screen as far as i can tell via...
Replies
16
Views
3,995
Back
Top Bottom