Cristian Sulighetean Posted February 20, 2019 Report Posted February 20, 2019 (edited) 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 February 20, 2019 by Cristian Sulighetean
kaare_t Posted February 21, 2019 Report Posted February 21, 2019 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);
Bryll Posted February 21, 2019 Report Posted February 21, 2019 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
Cristian Sulighetean Posted February 26, 2019 Author Report Posted February 26, 2019 Thank you, the increment register on rising edge works perfectly
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now