Jump to content

High Speed Counting & ML over EXRC1


Recommended Posts

I have a meter inputting 48,000 pulses per minute into  a DI-16 high speed counter terminal and am  having trouble converting  this data into a long on the V1210.  I tried to have a MI count up to 30000 then reset to zero and increment a multiplier to keep total pulse count.  I end up missing pulses during the reset function.  Also if I set to close to the limit of a MI then it rolls over before the multiplier can register.  I am using greater than compares.

 

Is there an easier way to convert a MI to ML over EXRC1?

 

Thanks

Link to comment
Share on other sites

Hi Michael,

MI0 holds the real counter, it is using MI2 as a buffer that holds the difference between the real count to the counts that where added in ML0.

The count than is added to ML1 that is in absolute value, than MI0 is stored to MI2 for a new count that will hold the deference between the counts.

When MI0 will roll over it will not have any effect on ML1 (Virtual counter) sign.

 

the formula for this project is:

MI0 - MI2 = ML0

ML0 + |ML1| = ML1

MI0 = MI2 

 

Please see the attached project.

Is NET3 you can trigger MB0 to simulate running counter, you will see that MI0(out) will roll over at 32767 (you can use MB1 to increment by one), the result ML1 (Virtual Counter) will not change it`s sign.

 

 

virtual Counter.vlp

Link to comment
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
×
×
  • Create New...

Important Information

This site uses cookies. By clicking I accept, you agree to their use.