Addition and subtraction in Omrom CX-programmer

skypeace

Member
Join Date
Nov 2012
Location
Malaysia
Posts
13
Hi all, Im an amateur of ladder diagram programming.
I have a case to program.. is something like this:

Input_A is ON&OFF for 20 times, at the same time ON&OFF Output_A for 20 times.

After Input_A is ON&OFF for 20 times, Output_A would not be ON even though Input_A is ON for the 21st and above times. Here, the max no. of ON&OFF for Input A is 20 to trigger the Output_A.

When Input_B is ON&OFF for 1 time, it reduces the no. of ON&OFF for Input_A for 1 time. So, Output_A could be ON&OFF for 1 time if Input_A is ON again.

When Input_B is ON&OFF for X time(s), it reduces the no. of ON&OFF for Input_A for X time(s), So, Output_A could be ON&OFF for X time(s) if Input_A is ON for X time(s).

As long as no. of ON&OFF for Input_A is less than 20, it could trigger ON&OFF for Output_A. Only Input_B ON&OFF is able to reduce the no. of ON&OFF for Input_A.

My concept is that Input_A counts and holds the no. of ON&OFF for Input_A until 20. It minus 1 when Input_B ON&OFF 1 time. And it plus 1 when Input_A ON&OFF for 1 time.

I appreciate someone could guide me to program this situation.
Thank you so much.
 
Last edited:
If you have read earlier homework questions, it is clear that not much help is rendered without any efforts from your side.

So post what you have done so far, or tell what is confusing you.
 
the best advice is to write the maths formulae.
a=a+1 = etc.
you are doing compare, count or add, and subtract commands.
these are basic comands - pay attention to the
Ampisand (&) and at(@) symbols these are important
 
sorry that I don't really know how to express it into a math formula.
So far I only learnt: timer, counter, DIFU, DIFD, and shift register.

My confuse:
I don't know which commands i can use to add and minus count held by a element. I could learn on those commands which are suitable to be used in my case if you can indicate what those commands are.

Or is it possible to reduce the count in a counter (CNT) by 1 in a time instead of only can reset it to be 0? If possible... what commands do involve in this situation?

thanks.
 
look at the reversable counter
this has up and down inputs
as far as the maths - I am refering to you writing
down what you want to happen
 
thanks iant.
Im looking on CNTR now.. Seems like it could be used in my program..
I would try on it..

thanks a lot. Might come back if I meet further problem...
 
Hi,
I have gone through the CNTR. I found out that it has a hysteresis of 1 counter as shown below(in red box):
CNTR_zpsc46c396b.jpg


is it possible to avoid this condition? means once CNTR reaches final count, it turns ON. And decrement of 1 count could turn OFF the CNTR back, instead of decrement of 2 counts.

thanks...
 
I'm not sure you can use "@" for CNTR instruction

Maybe using maths is easier to do this assignment
You may try this,

Incre.jpg
 
your right Chavak
but this is his school asignment I think - so trying to help with out telling him.
Skypiece - not the arrow inside the contacts
that is available to you in the details of the contacts and is the DIFFup or Diff Down
 
the reason I suggested Maths - I was thinking he may use the increment decrement also but when you attempt to write that a mathmatic formula is easier to keep in mind
- when A = 1 add 1 (if A=1 then A=A+1)
- When A = 20 then output A
and so on
it would clear up what he is trying to do.
and lead him to a truth map format
 
The diff up/down inputs are not available in all Omron PLCs. Which PLC are you using?
 
Thanks to all my guides here.
I worked out with CNTR, <, and DIFU at last.
Thank to all your suggestions.
 
Last edited:

Similar Topics

Our plant manger/my boss wants each line to display the takt time above the line. I am trying to research the cheapest way to do this. Our plant...
Replies
3
Views
194
Hey guys, I'm on site integrating for the first day on a project where I'm programming RX3i (CPU 305) controllers and have hit a snag. At the...
Replies
2
Views
2,417
Hello All, Please I am trying to add FT live data tags to the historian. I can add the live tags successfully, but the challenge i am facing is...
Replies
3
Views
4,568
I have a problem I can't figure out. I have an internal tag that is a displayed only numerical value. I am trying to add a push button so when the...
Replies
2
Views
2,077
Good evening everyone, My first GE Project. I am using a GE VersaMax Nano(IC200UDD040-AB) using PME 9.0. The PLC has the IC200UEM001 Ethernet...
Replies
3
Views
3,664
Back
Top Bottom