Jump to content
Sign in to follow this  
mikecbmc

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

Share this post


Link to post
Share on other sites

Guy,

What happens when MI0 turns rolls over to a negative  and MI2 is at the upper end of the MI range for a scan?  This would cause a large value to be inserted into the second formula and thus inaccurate?  What am I missing?

 

Thanks

Michael.

Share this post


Link to post
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

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Sign in to follow this  

×
×
  • Create New...