Can subroutines on PLC5/80C be implemented?

Natanam

Member
Join Date
Aug 2003
Posts
3
Hi,

We have a set of drives with start/stop controls executed in the PLC, for which the following lines in the PLC program is repeated for every drive. Any suggestion to implement this through a subroutine to save the PLC memeory. Thanks in advance.

st cond Dr.run Dr. time out fault St Cmd
---| |-----|/|------|/|-----------------------( )-
St Cmd |
---| |--|


stp cond Dr.run Dr. time out fault Stp Cmd
---| |-----|/|------|/|-----------------------( )-
stp cmd |
---| |--|

st Cmd
---| |---------------------------------------(Timer)
stp cmd |
---| |----|

Tmr DN Reset Time out fault
---| |------|/|----------------------------------( )
T flt |
---| |--|
 
Last edited:
A PLC5/80 has a relatively large amount of memory. It seems unlikely that you would need to save memory for the kind of logic that you have shown.

Subroutines are indeed possible, and you kan pass parameters back and forth, but only words not bits. See the help tekst for the JSR instruction for more information.

The kind of subroutine that you are looking for, is typical for a Siemens S5 or S7 PLC, the AB PLC5 is different in this and many other ways.

I recommend that you make JSR subroutines, but without passing parameters. Just make simple and straight programming with no indirect adressing or such. The program will be much easier to understand in a hurry. And you will not waste memory for passing the parameters.
Tip: You can use cut-and-paste and search-and-replace to speed up your code writing.
 

Similar Topics

I have been asked to extensively modify a piece of machinery that is very mission critical to the operation, thus not allowed much downtime or...
Replies
4
Views
2,287
We have an application where we need to indicate a piece of machinery needs maintenance. I have created a routine which resets a value of "days...
Replies
12
Views
3,727
Hi all. Please see attached. Tried to google the error with absolutely no results. I did the same at payed version and real PLC so I'm almost...
Replies
7
Views
2,337
hello all is there a rule of thumb as to using or not using subroutines when writing a program ? i am using an Allen Bradley slc 500 thank you...
Replies
5
Views
1,735
All, Using RSLogix 5000. I was wondering if there is a way to quickly check to see if all subroutines are being called by the Main Routine (in...
Replies
3
Views
1,592
Back
Top Bottom