Benji000

setting my counter to a specific starting number

4 posts in this topic

Hello everbody i need a little bit of help with my counter. So basically i have a counter that shows numbers on a hmi screen and when the counter counts down from 10 000 to 1000 i need to create a function that make that my right numbers picks up the numbers from the middle counter and countinues to count down. any tips on how to program this in cs/cj

Share this post


Link to post
Share on other sites

A timer has 2 output elements to it. A BOOL that will turn ON when the value reaches 0 (zero). The other element is the current value. The compiler will choose which to use depending upon the instruction used. You will reference it the same (Tx). It's kind of like a hidden structure. Be mindful of the timer's Data Type. In this example I'm using a Binary (or Decimal) timer and preceding my value with a '&'. A BCD timer will require a preceding '#'. 

Mr_PLC_MonitorTimer.JPG.4f9812d4755c8c87

Share this post


Link to post
Share on other sites
Quote

a function that make that my right numbers picks up the numbers from the middle counter and countinues to count down

This sentence makes no sense to me.
If all you need is to force a counter to specific value, do it by MOV instruction.

Share this post


Link to post
Share on other sites

I guess I was still sleeping this morning..... Here is an example comparing to the counter. Same rules as the Timer. Also, to Sergei's point, an example to modify the current value.

Mr_PLC_ModifyCounter.JPG.6bde72977bde93d

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