Machsupport Forum
Mach Discussion => Mach4 General Discussion => Topic started by: MKMill on March 12, 2024, 06:06:37 PM
-
I am looking for some help getting a simple logic ladder in the PMC to work on my machine. I am running an ESS, with this I have created a PMC code that looks at inputs given a set of conditions, I trigger two outputs to run relays for air solenoids, and when new input conditions are met, I turn those two outputs off to return my air cylinders.
I have logic that functions, however, when it is running, it is constantly sending a signal to deactivate my two outputs. Because of this I have had issues with my FIFO drain when homing and other general lag and step loss in my motors. Is it normal for the PMC to constantly tell the controller to deactivate an output like thus even when all the rungs are false?
I tried to implement a fix where instead of using a standard coil that I turn on or off, I am using a set-only coil and and reset-only coil for those outputs. This kind of works, it eliminates the constant spamming of deactivating my outputs, and will activate the set coils and relays when appropriate. However, the reset only coils do not turn my output back to 0 and return my air cylinders. I have looked at the LUA ouptutted code and can see that it is telling those outputs to go to a 0 state, but it is not actually happening in practice.
I have attached an image of my original logic that is working while showing the log screen with the constant signal to deactivate my output.
Any help on this is appreciated, thus is not behaving like any other plc I have worked with in the past. Thanks.
-
first off.. place One Shots before the latches and unlatches so that the code doesn't continually write to the output..I'll look at the rest of the code and see if I have any other suggestions. :o
-
Thanks for taking a look. I appreciate any input you can provde. I've tried multiple variations with one shots, however the one shot only seems to temporarily trigger the output relay which doesn't keep my air cylinder extended.
I also tried something along the following attachment, and it works, however my reset coils don't actually turn my output off and bring my air cylinders back.
-
I was able to get this working. I had to use a combination of OSR and resetting some internal relays to get things to fire correctly.