Cristian Sulighetean

Implementation of a counter in ST on GX Works 3

4 posts in this topic

Hello everyone,

I am new to Mitsubishi PLC. My device is  IQ-F series FX5u-80 and GX Works 3 to set up parameters using ST.

I've tried numerous methods to implement a simple counter, however when I test the code, it doesn't add 1 to the counter, instead it adds a much more bigger value like 144.

It is possible to use a pulse to increment the counter by 1 ?

Thank you  

Edited by Cristian Sulighetean

Share this post


Link to post
Share on other sites

See below, a full example of a counter with pulse (PLS) to trigger the counting:

PLS(yourTrigger, singlePulse);
MOV(TRUE, K32000, counterMaxValue);
OUT_C(singlePulse, C1, counterMaxValue);
RST(rstCounterValue, C1);

 

Share this post


Link to post
Share on other sites

Or if you want to use an integer (D-register) instead of a counter:

INCP(Your_Trigger, Your_Integer); // Increment register on rising edge.

RST(Your_Reset, Your_Integer); // Reset of register

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