enky007

CNTX instruction issue in SFC

7 posts in this topic

Hi, it's my first time posting S:

 

Here's the issue:

When I start a simulation and activate a CNTX instruction with Step.X or P_On nothing happens, it's either stuck at the set value or doesn't behave properly.

Is there a way to decrement a CNTX instruction in SFC with the Step itself?

I know I can use other means but, I was specifically asked to use a CNTX instruction.

 

Type: CJ1M CPU23

Cx-Programmer V.9.524519fe525d924f6e177890a8dcbcddf.png

 

lmk if you guys need more details, thx

Edited by enky007

Share this post


Link to post
Share on other sites

I am not sure what you are doing wrong.  Is your simulated PLC in Monitor or Run mode.  It is working fine for me. 

I forced on the count input 3 times in the ladder below and you can see the results:

A8ZAFQDayUnhAAAAAElFTkSuQmCC

My instruction is set up to be displayed horizontally, but otherwise the same. 

One other thought:  are you using C5 somewhere else in the code perhaps?

Share this post


Link to post
Share on other sites

Are the Program Properties for the Task containing your code set for Operation Start?

Task Properties.JPG

Share this post


Link to post
Share on other sites
On 2016-11-11 at 9:40 AM, Michael Walsh said:

I am not sure what you are doing wrong.  Is your simulated PLC in Monitor or Run mode.  It is working fine for me. 

I forced on the count input 3 times in the ladder below and you can see the results:

My instruction is set up to be displayed horizontally, but otherwise the same. 

One other thought:  are you using C5 somewhere else in the code perhaps?

I'm trying to use the ''Step.X'' to activate the counter instruction.

C5 is only used there, I've uploaded a video showing the problem with a simpler SFC program (Link is down)

On 2016-11-12 at 9:46 AM, BITS N BYTES said:

Are the Program Properties for the Task containing your code set for Operation Start?

Task Properties.JPG

Yes, it's checked.

 

>> I've uploaded a YouTube video with the issue: https://youtu.be/dV7poubuKAU

 

When I try with TIMX the timer works like it should... Why is the CNTX instruction not counting down?

 

Edited by enky007

Share this post


Link to post
Share on other sites

Counters only count on a rising edge. If the input does not turn off and on again it will not count.

1 person likes this

Share this post


Link to post
Share on other sites
13 hours ago, BobB said:

Counters only count on a rising edge. If the input does not turn off and on again it will not count.

ohh thx

If I put a 1sec ''Pulse'' (P_1s) it does count down.

So I would have to find a way to turn off and on the step or the line, but only once, hmm

 

 

 

 

Edited by enky007

Share this post


Link to post
Share on other sites

If I understand correctly, here's how I think I solved my problem:

I've put the Counter action to my initial Step with the Qualifier ''S'' which means it's gonna keep the action always active.

So as soon as I start my SFC simulation the counter instruction will remain with a ''off'' (instead of being inactive).

Then to activate the counter, I just have to get on the Step#.X I've input.

The instruction will pass from a ''off'' to a ''on'', resulting in a count down.

 

Here's my simulation on video: https://youtu.be/WJPzQaCrXxE

 

lmk what you guys think?

 

Edited by enky007

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