Output polarity selection

5 posts in this topic

Hello to everyone. Nice to meet you all. How are you? I hope you are doing well.

I’m developing a program with the purpose of make something similar to a pulse train in the output. However, sometimes I need the output to be a “positive” pulse and sometimes a “negative” one. By positive and negative I mean the polarity in relation to the pulse train source.

I’m trying to use a pair of bits in order to switch between the two choices of polarities. I attach a simplified version of the ladder diagram I’ve made. When I thought about the logic, it seemed logical to me, however, it isn’t working as supposed.

SM0.4 is a pulse train source. According to the software manual, it is a pulse train with 50% duty cycle and a cycle time of 2 s. That it to say it says at TRUE for one second and return to FALSE for another second. I assign the value of that variable bit to the M0.0 memory bit. I get the negative version of the pulse train logically negating it in the Network #2.

                I assign the value of two inputs, I0.0 and I0.1, to other two memory bits, M0.1 and M0.2.

·         When both inputs are in a FALSE state, the output stays FALSE, disregarding the state of SM0.4. (Case #1)

·         When I0.0 is TRUE, M0.1 is TRUE. However, Q0.0 stays at FALSE no matter SM0.4 is TRUE or FALSE. I attach a pair of pictures. (Case #2)

·         On the other side, when I0.1 is TRUE, M0.2 is TRUE. In this case, the output shows the correct behavior. It is the negated version of the pulse train source. (Case #3)

                Has any of you experienced something similar? Is there a better way to execute my purpose?

                I’m not executing the program, just simulating it with KincoBuilder from Kinco. However, it has always worked fine for me.

Thanks for you attention. I look forward for your responses.

Kind regards!

Case #1.png

Case #2.png

Case #3.png

Share this post

Link to post
Share on other sites

you need to learn what scan is and how the data changes after each instruction. this will help you understand issue with double coils and why the code acts the way you observe and not the way you want. if i am not mistaken this seem to be the problem and solution.



Share this post

Link to post
Share on other sites

Dear panic mode,

Thank you so much. You are right, I think I need to understand better the scan cycle. I did not notice the problem with double coils.

Thanks for your attention. That is the output behavior I'm looking for.

Best regards!

Share this post

Link to post
Share on other sites

you are welcome. also try not to do anything too complex. when things do not work, break them down in smaller pieces and test each independently. 

this is what the approach should look like.... create one rung with positive train, then separate one with inverted train. then combine both using some logic (OR) before passing result to an output. output should be used only once when using normal coil. in your case rung 2 (network 2) was always overwriting the output state that was established in previous network. this is why rung 1 had no effect, regardless of value of %M0.1 (controlled by %I0.0).


step by step.jpg

Share this post

Link to post
Share on other sites

Sorry for the delay in aswering. I did not notice your response.

I appreciate your attention. Thanks for the advice.

After analyzing your previous approach, I reached a similar result to the one you are presenting now.

Thanks. Kind regards!

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