Alex R

High speed counters

4 posts in this topic

Posted (edited)

I'm new to PLCs (and I'm a simple Mechanical Engineer).  I've been on a FX/GX Works 2/ladder logic training course but, of course, it hasn't covered everything that I need for my first PLC project.  My first problem is counting high speed pulses; they come on average every 7 ms (but this will vary), and each one is about 0.5 ms long.  Reading up about this suggests that I need to use High Speed Counters C235 etc, running off X0 etc.  I need to store the value of the counter at several times (e.g. at 0.5s, 2s & 2.5s) or the time to set counter settings (e.g. at 50 pulses, 350 pulses & 400 pulses). 

Anyone got a bit of sample (ladder logic) code that they could send me to help me get going?  I've tried trawling this site and similar things have been asked previously, but I can't find a suitable piece of code to modify.

Thanks,

Alex

p.s. I haven't got any hardware yet, so not restricted by that.

p.p.s. Do these high speed counters not work in Simulation?  I've tried a few examples and can't get the Counters to count.

Edited by Alex R

Share this post


Link to post
Share on other sites
1 hour ago, Alex R said:

I'm new to PLCs (and I'm a simple Mechanical Engineer).  I've been on a FX/GX Works 2/ladder logic training course but, of course, it hasn't covered everything that I need for my first PLC project.  My first problem is counting high speed pulses; they come on average every 7 ms (but this will vary), and each one is about 0.5 ms long.  Reading up about this suggests that I need to use High Speed Counters C235 etc, running off X0 etc.  I need to store the value of the counter at several times (e.g. at 0.5s, 2s & 2.5s) or the time to set counter settings (e.g. at 50 pulses, 350 pulses & 400 pulses). 

Anyone got a bit of sample (ladder logic) code that they could send me to help me get going?  I've tried trawling this site and similar things have been asked previously, but I can't find a suitable piece of code to modify.

As i understand (by Gx works 2 and FX) you looking for something like fx3 (or older) plcs. 

Yes, you need high speed counter. I cant help you with a code. But you may check this manual (4.8 item - High-Speed Counter [C] (FX3U/FX3UC PLC)):

http://dl.mitsubishielectric.com/dl/fa/document/manual/plc_fx/jy997d16601/jy997d16601q.pdf

There are some examples of code and many useful information.

1 hour ago, Alex R said:

p.p.s. Do these high speed counters not work in Simulation?  I've tried a few examples and can't get the Counters to count.

As far as i know - you cant simulate high speed counter. At least when i tried - i failed.

P.s. A little bit hard task for first plc project.

Share this post


Link to post
Share on other sites

C235 is driven from pulses seen on X0.

X0 must not actually exist in the program.

|-|M8000|------------(C235 K1000)-|

M8000 is always on when the plc in in run more

Any pulses seen on X0 will count on C235.

C235 is a 32 bit counter (uses 2 consecutive D registers)

To move the value from the counter you have to use DMOV instead of MOV

 

Share this post


Link to post
Share on other sites

Thanks for your replies on this.  Unfortunately the project that I was describing was put on hold soon after and I hope that it will be resurrected soon.  Fortunately I now have some hardware to play with and am getting to grips with it.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now