JZerb

RTO Timer Issue

12 posts in this topic

Was modifying an exsisting program today and wanted to add in an RTO timer to an used spot in the Timers file. I set the ladder up and loaded it into the PLC but the timer would never start to accumulate. As soon as the program started it would just set the DN bit for the timer and that would be that. I then just set an RTO to an exsisting timer within the file that used to be used for something else that's no longer applicable and everything worked out fine. Am I missing something?

Share this post


Link to post
Share on other sites

Can you post the program with the timer that did not work? (tell us which one it is)

Preset value to low?

Edited by Mickey

Share this post


Link to post
Share on other sites

If the timer register is used in another place, it will not work properly.  IOW, if you're using T4:10 as a TON in one part of the program and then add an RTO (or another TON or a TOF) elsewhere that's also using T4:10, it will not work correctly if both timer instructions are being scanned at the same time.

Do you have a free register in the timer file?

Share this post


Link to post
Share on other sites
2 hours ago, Joe E. said:

If the timer register is used in another place, it will not work properly.  IOW, if you're using T4:10 as a TON in one part of the program and then add an RTO (or another TON or a TOF) elsewhere that's also using T4:10, it will not work correctly if both timer instructions are being scanned at the same time.

Do you have a free register in the timer file?

I thought that the register was free when I looked in the Timers bin file, but perhaps it was used somewhere and just didn't have a description name added to it so I thought it was free.  But as I was browsing through the program today I noticed a timer on a rung that had not been deleted from the previous rendition of this program from another piece of equipment. I'm pretty sure that was what was messing me up, but I figured out another way around it regardless. I have the old program still and I'll look at that tomorrow. If it's still an issue I'll post that file to see what I'm missing in regards to making it work properly. 

Share this post


Link to post
Share on other sites

In RSLogix 5 and 500, the timer file opens by default to the data file view.  If you click "Usage" at the bottom:

(T4_DataFile.png)

 

It will take you to this view:

(T4_Usage.png)

A "W" indicates that the register is used at the "Word" level (like in a TON/TOF/RTO instruction).  An "X" indicates that that bit is used.  Here, they're using the Enable (EN) and Done (DN) bits of T4:0 and T4:1.  They're also using the DN bits of timers T4:10 through 15.  If there are only dots in a row, that timer register is not used in the PLC program.  An HMI or other outside device may still be reading/writing values, though.

Alternatively,  you can rt-click on the address in the code window and select "Cross Reference" or "Find All".  They will tell you where it's used and in what type of instruction.  If you see more than one TON/TOF/RTO, that's a red flag that there is most likely a problem that you should investigate.

T4_DataFile.png

T4_Usage.png

Edited by Joe E.
Images didn't post in line, added them as attachments

Share this post


Link to post
Share on other sites

Thank you for taking the time and explaining this to me. The pictures are even more helpful then just words! I'm pretty sure like I said above I tried to use a timer that when I opened Timers data file seemed that it didn't have a name to it under symbol so I figured it wasn't used. I'll have to look again at work Monday now that you've shown me where to properly look and see if it was indeed used and just not labeled, or if there is another issue. 

Dont want to push my luck here and ask to much but another issue I was having the other day was that under the Binary bits data file I wasn't able to name a word. So that say any of the 16 bits that were in that word could be looked at all at once within the ladder and if they weren't all true or false then an output would or would not turn on. If that doesn't make sense I can try and post screencaps like you did above for clarity. 

Share this post


Link to post
Share on other sites

Word-level instructions can refer to Binary file elements just like Integer files.  For example, if your bit flags are in B3:1/0-B3:1/15, you can quickly check to see if all of them are off with EQU:

 

 

The reverse is also true; you can use a binary instruction (like XIC, XIO, OTE, etc.) on a bit in an integer file by addressing it like N7:1/0.

EQU-B3-1.png

Edited by Joe E.
Added image as attachment

Share this post


Link to post
Share on other sites

This is exactly how the program I modified is written. The bit flags are, for example, B3:1/0-B3:1/15, and there are OTEs that are controlled by checking to see if all of the bits in that word are set to 0. My issue was I couldn't figure out how to name the word. I wanted to add another one for another function we were adding into the program and I couldn't quite figure out why it wouldn't let me name the entire word like it was with the exsisting program. Which say said Invert_Fwd for the word at the bit address I said above, and then each bit within that word was labeled accordingly.  Invert_Fwd/0, 1,2, etc 

Share this post


Link to post
Share on other sites

It sounds like they're using symbols.  Can you share the program file?

Share this post


Link to post
Share on other sites

They have assigned the symbol "INVERT_FWD" to word B3:13.  I have RSLogix configured to show both the address and the symbol in the code window so I see both.  The symbols are the black text on a green background.  The text with the yellowish background is a comment. 

B3_Stuff.thumb.png.113f89dc253d7611cf5eb

You can use the bit either as B3:13/0 or as INVERT_FWD/0.  Both methods refer to the same memory location.  You can write code referring to INVERT_FWD/1,2,3,etc. just by typing that into the address field of the instruction.  Similarly, you can use the word in a GRT or NEQ instruction.  They're not using very many bits in each word, so their method of using GRT is fine, but if you wanted to use all 16 bits, you would need to use NEQ instead of GRT since bit 15 is the sign bit and the PLC will interpret that word as a negative number if it's set.

If you want to create a new symbol at an unused address, like B3:17, just go to the data table and click on the word number on the left to select the whole row.  Then type in a symbol in the "symbol" field:

NewSymbol.png.28434cb5ffe92bfd60b787747a

There are other ways to add a symbol, but this way will work.

 

B3_Stuff.png

Share this post


Link to post
Share on other sites

Thank you for taking the time and explaining some of this stuff to me, it's very much appreciated. 

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