Sign in to follow this  
Followers 0
MrDippy

Can somebody tell me what I am doing wrong?

3 posts in this topic

Hi all, 

This is one of those times, I just cannot see what I am doing wrong with this PLC program. It is for a FX5UC using GXWorks 3 in FBD/LD format. The program grown to such a size and suddenly started doing strange things. I managed to isolate the culprit code and modified it to run on its own.

Expectations for the simple program is:
 When Button tag is set, the PLS will execute the proceeding instructions only once but only if the counter value is below 46.

What is happening is that it increments continuously even when the BUTTON is no longer set. This also happens under simulation.

Am I doing something totally wrong here?

I've attached the GXW3 program and a snap shot of the program.

 

 

code.jpg

SimpleTest2.gx3

Edited by MrDippy

Share this post


Link to post
Share on other sites

 

The compare (LT_E) will only update the output when EN is on, therefore you get strange behavior.

Try this instead:

 

Snap.PNG

Edited by FredrikS

Share this post


Link to post
Share on other sites

Thanks Frediks.

I can see so many people falling into this situation if the EN in compare functions are not on continuously. 

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
Sign in to follow this  
Followers 0