AuSquirlNutz

Why (U) an OTE?

9 posts in this topic

I am following a programmer that used multiple (U) instructions related to a non latching OTE instruction and it is showing up as "Duplicate Destructive Bit Reference Detected" when I verify the program.  why would someone do this and is there and advantage to doing so?.  the program runs.

Share this post


Link to post
Share on other sites

Can you post your program?  It could be an error but there are times it could be done intentionally.

Share this post


Link to post
Share on other sites

There is no advantage to doing that.   I have seen it before and it screams poor programming practices.  Keep in mind that if you are using a PLC5 or SLC the outputs are not updated until the ladder scan is complete.  In your case, the last unlatch wins.  That can get very ugly.  If you move a rung in your program you can possibly break the program so be very careful with what you do in that program.  That said, I would be looking into the program to see how I could eliminate the OTU's if it were my program.  Keep in mind that depending on the program it could get very tricky. 

1 person likes this

Share this post


Link to post
Share on other sites

This sometimes is intentional, a quick example would be when a HMI or SCADA system writes directly to a PLC's data table (eg turning on an output), then the PLC turns this output off by unlatching (U) the output when a particular condition is met, this could be multiple conditions, hence the multiple (U)'s. Maybe a little untidy but sometimes unavoidable for the sake of clarity.

Steve

Edited by nehpets

Share this post


Link to post
Share on other sites

I agree that are uses for the OTU with HMI and SCADA interfaces, but there would be no need for an OTE in such a case.  In addition there should be one OTU with all the conditions grouped on that rung.  That's why OTL/OTU's can be evil!  People place them all over the program and it ends up making one giant mess.  Unfortunately he probably has one of these programs that has evolved over the years with a little here and a little there programming and no attention to the program as a whole.  Nothing like the patched patch of a patch to make your day interesting.

Share this post


Link to post
Share on other sites
On 11/2/2018 at 10:14 AM, PLCMentor.com said:

There is no advantage to doing that.   I have seen it before and it screams poor programming practices.  Keep in mind that if you are using a PLC5 or SLC the outputs are not updated until the ladder scan is complete.  In your case, the last unlatch wins.  That can get very ugly.  If you move a rung in your program you can possibly break the program so be very careful with what you do in that program.  That said, I would be looking into the program to see how I could eliminate the OTU's if it were my program.  Keep in mind that depending on the program it could get very tricky. 

The OP never said the OTUs are interleaving with non-OTU coils of the same bit, but all are after the initial and only OTE.

Therefore, not '"the last unlatch wins", but the bit is unlatched locally wherever required, and supposedly used after the last OTU.

I often (though not extensively) use such technique, which I call a "collector bit". The example may be resetting a machine error bit with OTU or always Off OTE in the beginning of the program, and setting it locally anywhere it is decided. At the end of the program, the bit is used for beacon light control.

Any technique has advantages and disadvantages. The advantage of this one is seamless adding or removal of standard pieces of code (the addresses of the collectors have to be standardized first, of course).

Edited by Sergei Troizky

Share this post


Link to post
Share on other sites

Sorry I have to respectfully disagree on this.  There is nothing that can be done with the OTU in the situation you mention that could not be done on the rung with the OTE. 

Share this post


Link to post
Share on other sites

Whether it is right, good, wrong, or bad is more a matter of opinion.

I don't think any further good can come out of this discussion unless AuSquirlNutz comes back and post the program so we can understand what is being done in it.

Share this post


Link to post
Share on other sites
1 hour ago, TWControls said:

Whether it is right, good, wrong, or bad is more a matter of opinion.

I don't think any further good can come out of this discussion unless AuSquirlNutz comes back and post the program so we can understand what is being done in it.

Indeed. I have written many programs and seen many programs written by others. In one group of logic designers we had a fellow we affectionately named the "Not King". He loved "nots". Used them more than anyone. Another group we had a fellow, the "One-shot King". Same as the last. Used more "one-shots" than all others.

Still both of this guys designed solid logic that worked, passed all testing, could be maintained/modified without trouble and has also be proven by the test of time.

So many times I have heard folks criticize logic/implementation/etc. only because it was not the way that person would have done it. 

My2c.

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