inserting a subroutine from another program

Nick Z

Member
Join Date
Jun 2015
Location
NJ
Posts
15
I work for a company with many sites and we are installing a new process on one of our machines that mirrors another factories setup. Our engineer visited there and got me a copy of their program. I can copy the subroutine and put it in my program as a subroutine and then I verified all of the rungs. I have some rungs that are trying to access an F file and this program has it as a N file (the program is looking for F18 in the data files and the program has it as N18). Can I just create a new N file and assign new addresses to those bits? What else should I look for besides making sure I/O's are assigned to open terminals etc. I am using Logix 5 for this project as the plc is a plc5/40e
 
Last edited:
Hi Nick, welcome to the forum

I know you know what type of equipment your talking about but we don't, can you give us some clues, what type of machine? are you taking about PLC's etc, you get the idea. after that I'm sure you'll get the help your looking for.
 
Yes, you can just create new files for the data. Make sure they are sufficiently sized (enough elements) for the new routine's use.

Do be CAREFUL of any other conflicts though... it is possible to be re-using other files (B3), which generally is not good. And yes, obviously, make darned sure that you aren't overwriting existing outputs, or trying to use existing inputs for a new purpose.

-----

What does the kind of machine have to do with anything?
 
Thank you there were quite a few b/3 conflicts when I copied the sub routine in but I have cross referenced about half of them and so far they look pretty good. This program came off a machine twin to mine and programmed by the same people so the addressing and structure for the permissives etc looks good and im pretty sure I can get past any problems there with testing its the speed control where my knowledge and experience gets a little fuzzy but im learning a lot and thankfully I actually have some time on this project. We have a plc guru in the company but he has to fly down from Toronto etc so if I can get this it would be a feather in my cap so to speak.
 
I have some rungs that are trying to access an F file and this program has it as a N file (the program is looking for F18 in the data files and the program has it as N18). Can I just create a new N file and assign new addresses to those bits?
Yes, creating a new N18 file will allow you to use that subroutine. But there is a possibility that in the original program, those N18 bits were used in the main program or in another subroutine. You need to somehow check on that possibility and make sure that they were not used anywhere besides in the new subroutine.

What else should I look for besides making sure I/O's are assigned to open terminals etc.?
Look in the new subroutine to see if bits are Latched or sealed on, with no corresponding Unlatch or stop bit. If so, probably the original program did the Unlatch somewhere else.
 

Similar Topics

Hi Guys, I am running an ABL33ER on firmware 33.12. I noticed that when I insert the SDcard into the controller the program stops. Not only that...
Replies
6
Views
1,858
If you attach more than 1 photo. They do not show up in the body of the post? Is that a limitation or am I doing something wrong? Thanks, Dave
Replies
5
Views
1,389
Hello, I'm new to AutoCAD and had some questions. If I make a border at roughly 8"x11" or something like that... How do I insert something that...
Replies
11
Views
3,337
Morning all Using Studio 5K v 29 Lets say...........engineering changes a design :shoot: I started my I/O tree and now I needed one more...
Replies
7
Views
1,542
How would I search an array of 52 SINTs for an available space (0) then move a (1) into the first available space?
Replies
29
Views
9,753
Back
Top Bottom