Sign in to follow this  
Followers 0
turbotater

trouble understanding allen bradley copy instruction

7 posts in this topic

i am having trouble following the logic in a program on some plant equipment i have. i have a pan conveyor system with a dozen speed variations based on different recipes. there is a "network" of (5) 504 processors i have 2 504 PLC's with touchscreens that determine when the conveyors change speeds. when a recipe is selected on one of the 2 touchscreens there is a value that is entered into the PLC for this pan conveyor system in interger file address N100:254 in the ladder logic there is a copy function that is source #N[N100:254]:0 dest #N9:1 length 10 from what i understand the length function in a copy instruction is how many addresses starting with the source number i want to move. example: if i wanted to move 5 values in sequential address N9:0>N9:4 source N9:0 dest wherever length 5 the problem i have is in my first example there are not 10 more addresses starting with N100:254 there are only addresses thru N100:255 does an interger address have subcomponents in the same way a timer or counter have? example t4:1 , t4:1/en , t4:1/tt , t4:1/dn

Share this post


Link to post
Share on other sites
I'm mobile so I can't be very wordy. The source address is what is called an indirect address. Very handy tool.

Share this post


Link to post
Share on other sites
As Michael mentioned, the N100:254 is a pointer for indirect addressing. What that means is that if the value in N100:254 is 10, then you will be moving your values from N10:0. Whatever value you have in N100:254 will be substituted for the file number. This is a simple way (for the programmer) to quickly program the system to move values from several different locations to a single destination. In your case I would guess that there are recipes and the pointer allows the selection of those recipes. Unlike Michael, I do not like indirect addressing. It is simple during programming, but difficult to troubleshoot and throws most field technicians for a loop. My mantra is always program for your audience. In other words keep it simple. That said, there are times that it is very useful and necessary.

Share this post


Link to post
Share on other sites
got it i think it just clicked thanxs for your help

Share this post


Link to post
Share on other sites
Michael is correct: the [N100:254] is an indirect address pointer for the Data File number. COP Source #N[N100:254]:0 Dest #N9:1 Length 10 When N100:254 is equal to "10", then the Source is N10:0 When N100:254 is equal to "11", then the Source is N11:0 When N100:254 is equal to "12", then the Source is N12:0 and so on. While this is a powerful programming tool, it can be difficult to follow when troubleshooting. In addition, if the instruction was executed when N100:254 was equal to a Data File Number that does not exist, the controller will fault. It is always good programming practice to perform a limit check on the indirect pointer immediately before executing an indirectly-addressed instruction.

Share this post


Link to post
Share on other sites
no kidding hard to trouble shoot , especially if you do not know such a thing exists. later mike

Share this post


Link to post
Share on other sites
I want to repeat and emphasize what Ken R. said about limit checking. It is critical and can save you some weird troubles down the line. We had a machine that had been running "fine" for years. Well over a decade without this problem. One day, the operator went to the setup screen on the HMI and the PLC faulted. It was repeatable, that all was well until they selected the setup screen, then it would fault. They were calling a recipe selection subroutine when the HMI went to that screen and that subroutine contained an indirect address. It somehow magically got changed to a value that pointed to a non-existent data file, which faulted the processor. We added a limit check just before that line of code and all was well.

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