Basic Help needed

Pipeline

Member
Join Date
Oct 2007
Location
Crosshills
Posts
3
Please help, I am trying to learn how to make an incremental counter on a plc.....
This is just a simulation, but I am trying to do the following:-
I have an Omron CPM2a with a 7 segment LED display attatched to 7 outputs. What I would like to happen is when the PLC is turned on, the display shows '1'
if inputs a and b are pressed, then the display to increment to 2
if inputs a and b are pressed again, the display increments to '3'
etc to 9.
if input a anc c are pressed, the display decrements by one....

sorry for asking a simple question, but anyone able to help?
 
First, Welcome to the forum.

The CPM2 has high speed count inputs.
Input 000.00 is phase A, 000.01 is phase B and 000.02 is Z (reset).
Channel 248 will contain the least significant portion of the present value and Channel 249 will contain the most significant.

You will need to enable the high speed counter in the PLC setup area.

Also understand that increment and decrement are controlled by the sequence of phase A and phase B.
A then B will increment your value.
B then A will decrement value.
That is how an incremental encoder will work.

Are you using CX-Programmer software?

You may want to check the manuals also.
CPM2A Operation manual (hardware) #W352
CPM Programming manual #W353
You can get the manuals for the Omron website.
http://www.europe.omron.com/en/cor/iab/home/

Hope this will help.
 
Last edited:
Hi there,

Thanks for your reply, but it is not as complex as you may think.. it is not a phase input, but two push three push buttons. When the PLC is first turned on, 2 outputs will be on, to create a number '1'
when buttons a and b are pressed, then the display will show number '2'
if the buttons are pressed again, the the display will show '3'
if a and c are pressed, then it would decrement to display to number 2 again......
can you help me?
 
Sorry for the misunderstanding. I misread your original post.
I thought you were trying to understand an incremental "encoder".
You could use the SDEC(78) instruction to handle operating the 7 segment display.
For the counter you could use the CNTR(12) instruction or possibly an INC(38) and DEC(39) instruction pair.
Take a look at the W353 Programming manual for information on the instructions.
Let us know if you have any questions.
Good Luck.
 
Firstscan bit sets a word to "#1".

If "A" and "B" are true, and the word is NOT greater or equal to #9 then oneshot ADD #1 to the word.


If "A" and "C" are true, and the word is NOT less or equal to #1 then oneshot SUB #1 from the word.

If word = #2 then output 1 is on
If word = #3 then output 2 is on
and so on..

It's been a while since I've worked with Omron, correct me if I'm wrong...
 
Thank you Everyone

Thank you for your help, I should point out that the problem I am having is due to me never being taught how to program a PLC and having to 'create' the effect of a program so I can show what the final development of the machine would look like......

If anyone is UK based and wants to talk about writing the full software for me, we can discuss price........

As long as I can show some effect of the machine, then we are onto a winner.......

I now just have to convert the infoprmation into some kind of code...... may be back asking for help soon :)
 
I don't remember the input and output addresses on CPM2A but

omron1.JPG


omron2.JPG


omron3.JPG


omron4.JPG
 
That looks complicated but not sure it fulfills the needs. A seven segment display will use the outputs in combination to make different numbers.

150px-7_segment_display_labeled_svg.png


If you need the number 3 then you would turn on A, B, G, C, and D.

I do not have Omron software but imagine it has up-down counter which can use one register and the bits in that register be used to turn on the outputs as needed.

I would also use the first pass to set the counter to 1, then condition the rungs with compare instructions to never to allow it to increment below 1 or above 9.
 
Ah, I see.

I totally misunderstood.

But all he needs to do is edit the program so that the compares turn on the right outputs.

And you're right, there's probably a much easier way to do it
 
CPM2A outputs start in channel 10 (ie: 010.00, 010.01, etc.)

The SDEC instruction is a 7 segment decoder instruction.
As Ron pointed out the decoding issue, this instruction will handle turning on the proper segments based on the value.

Hope this will help.
 
nettogrisen said:
Firstscan bit sets a word to "#1".

If "A" and "B" are true, and the word is NOT greater or equal to #9 then oneshot ADD #1 to the word.

If "A" and "C" are true, and the word is NOT less or equal to #1 then oneshot SUB #1 from the word.

I was thinking more of using an up/down counter or INC/DEC with a numeric register.

A and B and not greater than or equal to 9 (oneshot) go up by 1
A and C and greater than 1 (oneshot) go down 1.
The SDEC (DCD in AB) would use the numeric value in the register to set the outputs.

I could show it in AB and couple others, do not have Omron though.
 
Nettogrisen,

Would you upload a ZIP version of your Omron program? I would like to save if for future study. I am trying to learn the CX Programmer software.
 

Similar Topics

Hi, I am new to PLCs and would like to learn basics and possibly use them in my projects. I would like to use a PLC to generate pulses for a...
Replies
3
Views
11,374
May seem like trivial stuff to the proffesionals but i have an assignment due and im really stuck. The questions are: 1. What is a stand-alone...
Replies
12
Views
7,041
Currently tinkering with a home project for a wood router lift machine using some second hand parts from a redundant timber mill. The servo is a...
Replies
3
Views
2,428
Hello there, I'm practically new to the PLC world, I'm quite familiar with Siemens TIA Portal but I'm currently tasked to program Schneider PLCs...
Replies
5
Views
1,860
Hey guys. Quick question from my job assessment. b. You observe that a panel light fed by a 24vdc output is barely illuminated when the...
Replies
4
Views
1,670
Back
Top Bottom