Jump to content

Recommended Posts

Posted

i have my counter error in cx programmer. i have set my value in reversible counter (C0000) at #1, when the set value has become 1, the NO / NC contact C0000 didn't go on. please, how should i do

Screenshot 2025-05-12 104359.png


Posted

What is the error? It  would be helpful for you to look at the instruction help. Select the CNTR instruction right click then select instruction help.

image.png.7c110dca534248a8f57bf8f16ca2cc7e.png

Posted

The counter contact activates if the present value become equal to the set value as a result of counting. 
It will not activate if either value was forcibly set to match another one.

Posted
38 minutes ago, Sergei Troizky said:

The counter contact activates if the present value become equal to the set value as a result of counting. 
It will not activate if either value was forcibly set to match another one.

As per my previous attachment for the CNTR instruction, the completion flag will be turned on when the PV is incremented from the SV back to 0 and will turn off again when the PV is incremented from 0 to 1. 

Posted
16 hours ago, chelton said:

As per my previous attachment for the CNTR instruction, the completion flag will be turned on when the PV is incremented from the SV back to 0 and will turn off again when the PV is incremented from 0 to 1. 

i dont understand, so when the pv = sv, the contact will not go on (as my programs) until it crossed the sv?. i just want to when counter pv = sv, the contact will on. then when pv < sv, the contact off. what should i do?. is this the nature things of the cx programmer?

Posted

If that is the operation you desire, then use a compare instruction. If your SV is going to be #0001, then you should consider using the SET / RSET instructions.

CNTR.thumb.PNG.e2f17717559c1a0a1278b0eaab47b294.PNG

Posted

I'm one that never uses counter instructions. I much prefer to increment/decrement a register (@++ / @--) and use comparison instructions where required.

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...