In the Previous Post we saw that how can we connect encoder with PLC for the feedback and calculation of speed and position. In this section we will clearly discuss the PLC Programming of Encoder and associated settings in CX Programmer. If you are unfamiliar with encoder connection with PLC then you can review here. Also you can see the basics of Encoder and some information on types of encoder here.
Settings In CX-Programmer to configure High speed Input:-
First of all we have to configure the high speed counter inputs to which we are connecting encoder outputs. we will see here step by step detail as how to configure it. We are taking example of Omron PLC Cp1E here, however similar settings are there for omron PLC CP1H.
Just open CX-Programmer, then click on settings and go to rightmost tab i.e Built in Input. Under this tab you select Linear and Reset of encoder accordingly. You can see the below picture for a better understanding.
Note:- Click on the picture for a better enlarged View.
Reset of Pulses of Encoder can be done through Z phase or Either Software Reset i.e through our PLC Program. In the Input setting we can choose either of differential type or Up-down input, generally these are selected if we want to track both forward and reverse position i.e while calculating the position of job-piece. In these cases if encoder shaft moves in forward direction and we read 300 pulses and encoder shaft rotate in reverse direction then the pulses will decrease accordingly.
Recommended Article: Using High Speed Counter in Omron PLC
If in any application you just want that pulses from encoder should increase despite of its rotation direction then select Pulse + or Increment as input type in the settings section. Now we are done with settings part.
PLC Program for Reading Encoder Pulses :-
Now we will see how to do the PLC Programming for reading the PV values of encoder. Well there is one instruction PRV in omron PLC which is used to read the high speed counter input values, we have to write that instruction accordingly. In the PRV Instruction we have to specify the Port i.e at which Port we are connecting the encoder, #0010 for port 1, #0011 for port 2, #0012 for port 3 and so on , also we have to specify in the control word as #0 i.e we are reading the value. Also we can reset the encoder PV by setting the System bit, all the things are clearly depicted in PLC Program. You can download sample PLC program for Omron Encoder interfacing here.
If you are facing any kind of problem regarding PLC Programming with encoders yo can write in comment section and we will get back to you. You can subscribe to Automation-Talk by Email for more such tutorials.
Advertisements :-
Please i have a problem displaying pulses on my hmi.
ReplyDeleteMy application:Is to Measure length,cut and count
a metal sheet.
My components are
Omron PLC CPM2A-CDR-A
Omron NT ST123EV
Omron encoder E6A2-CS3C .P/R100
The problem i have is how to display the pulses on the NT screen,to be able to measure to length cut and count
For instance;
1,Measure 3Meters,10 pieces
2,Measure 16 Meters 12 pieces
Best Regards
Mickens ADEJO
Dear MAC,
ReplyDeleteAre you able to read encoder pulses in PLC?
If yes then move the encoder pulses in a CIO word and display that same word in HMI.
If NO, then first try to read pulses in PLC.
If you need further help , feel free to ask.
"In the Previous Post we saw that how can we connect encoder with PLC for the feedback and calculation of speed and position"...
ReplyDeleteHow to get sample programming calculation of speed and position using omron PLC ?
Best Regards
Tigor
Dear Tigor,
ReplyDeleteFirst of all welome to Automation-Talk.
The sample program you can download from the link given in the above post.
If u need a specific program then please tell us.
Reagrds
Injy
Dear Automation Talk,
ReplyDeleteCool information, but I cannot download the sample program as the link seems to be broken. I would appreciate it if you could fix the link problem. Thanks!
Best,
Vefik
@vefizoo link is working fine. I have checked and verified.
ReplyDeleteDear Injy
ReplyDeleteCould you please repost sample programming calculation of speed and position using omron PLC, pulse from encoder or proximity?
Best Regards
Tigor
There is download link above.
ReplyDeleteHello! I have an Omron PLC CJ2M-CPU32 with input/output modules, ID211 and OD212. Can i activate option "high-speed counters" from CX-Progammer and connect and encoder to the inputs of the ID211?
ReplyDeleteMy encoder is supplied by 5V.
I would appreciate an answer, Thank you!
Yes, it can be connected. See I/O Module Tab page in the PLC Setting dialog box
ReplyDeleteDear Costin ,
ReplyDeleteWelcome to automation talk.
Yes you can connect the 5v output from the encoder at id211 high speed input terminals and for programming details you can download the sample program from above.
Thanks
Automation Talk
How can I connect delta encoder(line driver-ES3-11LG6841) to the any PLC???
ReplyDeletehow to connect encoder to plc?
ReplyDelete@ckbak : You can connect delta encoder to any PLC having high speed counter. let us know to which PLC you want to connect.
ReplyDelete@Anil : Please see above post. Or let us know the Encoder and PLC name.
omron encoder 360ppr and cp1e plc
ReplyDeleteplease help me to do programme for Encoder with omron plc.
ReplyDeletePlease see above article there is a sample Program.
ReplyDeleteTHIS POST AND DISCUSSION HELPED ME , THANKS
ReplyDeletei have a high counter unit CJ1W-CLT41 connected to CJ2M CPU32
ReplyDeleteIt is enough to use the PRV instruction and do the configuration as shown in the picture above or i have to configure other parameters to interface the encoder because in the operation manual of the counter unit, we can see a lot of parameters to set and reset in order to interface tne encoder. Help please
Hi,
ReplyDeletePlease help me.
So i use Omron PLC CP1H,
i want to use rotary encoder as a feedback to drive the stepper motor.
How can i program the encoder?
Thanks
I try your program but i don't understand, and nothing work
ReplyDeleteThanks
What issue you are getting ? You will have to modify program according to your needs. It is just a sample program.
DeleteHI, I want to connect my CPM1A (Omron) to a rotary encoder (Omron E6B2-CWZ6C). How do i read the value from the encoder. I've tried to use PRV but it didn't work. Help please
ReplyDeleteThanks!
Please try sample program once. PRV is the right instruction for getting Encoder output.
DeleteCan you explain the CTBL "Register Comparison table" and the INI "Mode Control" and how to write a plc program with them. I'm looking for example online but I'm having a hard time to find some.
ReplyDeleteThanks
We will try to make tutorials on that. Thanks.
ReplyDeleteHi, I'm using Cx-server Lite to read & write data from an Excel spreadsheet and I was wondering if there is anyway to trigger a write "Command" when the number "1" appears into a specific cell "A1" for example?
ReplyDeleteI'm using the timer function presently but I find it slows down Excel when it read & writes several data at the same time, so I would like to trigger the "write command" only when its really needed without using the timer function or the manual command button!
I would use the timer function only to read one DM memory and when a "1" would appear in that memory it would trigger the write command from the Excel spreadsheet.
Thanks
hi,
ReplyDeleteI want to know about device net and can open difference and how they are differ in wiring
Hi, I need the instruction to read encoder pulse in Mitsubishi fx5u plc,can any one pls help me on this...
ReplyDeletehi, i have cp1le plc i wanna use flow sensor on pulse input how to calculate in ltr/hr.please help me
ReplyDeletehi,
ReplyDeleteIm using Cpm2a-30cdr-d.how i can use high speed counter in this????Pls help me.