help with omron counter instruction

Weivreif

Member
Join Date
Nov 2010
Location
Manila
Posts
17
hi guys, just new to plc.
im using cj1m cpu22
currently working on a program that measures distance by means of a rotary encoder

if my understanding is correct encoders will count the number of turns then it will do some math to convert the number of turns to a unit of measurement like centimeters.

so heres what I did, I used a reversible counter input the conditions for incrementing and decrementing the counter. then I will use a math function to multiply the present value of the counter by a certain number.

my question is how do you program it in a way that the multiplicand would be the present value of the counter?

for example counter set value is at 50 but present value is 20, how do you use that present value to perform operations with it. like math operations and such

also how do you use to always on flag, and what is the function of cf-bit. thanks, appreciate evry help i can get.:)
 
Great question, the answer is very long...
I suggest that you High Speed Counter, it is not a beginner solution.

Take your counter, make the set value 9999, (#9999 if you are using BCD)you can then compare CMP the count present value to a Data memory that contains the set value that you need (50). When equal or grater than set a bit that preforms your logic.

Then you do need to worry about what resets the the count value.

The CJ has floating point math avaiable USE it. *F, /F, +F you will get Real Numbers as a result. The decimal point will float as the name suggests. Use <F, >F, or gerater then = so on for your compare.
This will allow you to work in engineering units, cm instead of pusles.

Happy to email you an example in CXP is you want.
 

Similar Topics

I'm an old AB guy who is working on a CT021 Omron high speed counter. This has the markings of a dumb question but here goes. I'm trying to read...
Replies
0
Views
5,658
with high speed counter boards that fit into either port 1 or 2 of the cpu on the omrom cqm1h plcs thers is some configeration to do when setting...
Replies
4
Views
4,344
We have an omron CJ2M-CPU12 PLC that we are having issues with an AD04U analog card. it is connected to a K type thermocouple sensor. The card is...
Replies
4
Views
611
Hi all, While i am not new to omron, i'm totally new to the analog part and lost. i have a CJ2M cpu 33. then there are 4 i/o cards card 5 is a...
Replies
26
Views
2,614
I have a question about SET instruction in Cx-programmer. When condition goes true it is supposed to give value 1. But, my controller is giving 0...
Replies
24
Views
2,311
Back
Top Bottom