Good Programming Skills

learner

Lifetime Supporting Member
Join Date
Apr 2007
Location
British Columbia
Posts
81
Hi guys,

I heard that in PLC programming, RSLOGIX 5000, if you have 20 motors, it is better to have one routine for all the commands bits and one routine for all the status of all the motors. the way I do it is that for each motor there is a routine that contains all the control, status, communication with HMI, and etc for that specific motor in a neat order with appropriate RUNG comment. the reason I do this is that I found it easier to troubleshoot each motor. I found it hard to put all the commands for 20 motors in one routine and then go back and forth between status and command and etc routines. Please advise if you see any advantage or dis advantage between the two methods.

Regards
 
Learner,a very good question, one that illustrates perfectly the problems with and the advantages of ladder. Ladder on-line diagnostics are great for fairly simple logic, which a motor should be, but not good when the logic is done via subroutines. Here I admit that my PLC programming hands on is ancient. So maybe they have moved on, a serious question here - can you view single instance of a subroutine executing on-line?

I am guessing that you were trying to use ladder for the 'one routine' rather than using say statement list. And either way some sort of indexed addressing.

Don't give up on the one routine. Make one instance of it for testing and test it thoroughly. For troubleshooting ensure that the relevant io, status data etc is mapped to the HMI, so you do not need to use on-line diagnostics.
Treat motors as objects.
 
I prefer to use object oriented programming techniques and create a UDT that contains all the information I need for the motor so that I have a motor element in my program similar to the same way one would have a timer element in the program. The I create a single subroutine to handle the logic for all motors, create a data tag for each motor, and pass each motor tag to the one subroutine.

This thread contains a simple example of what I am talking about.
http://www.plctalk.net/qanda/showthread.php?t=42810 Its a quick and dirty example but I think it shows enough to get started on your own.



This has been discussed in a couple of different threads in just the last few days.
 

Similar Topics

hello, I got a job in a factory. I would like to develop my PLC programming skills. I know that every person has his own way of learning but if...
Replies
9
Views
2,500
Hello, I have some skills as a PLC programmer but I need to learn how to program more complex processes. Does anyone have any suggestions how to...
Replies
9
Views
4,114
Hi , I am an Electrical engineer , i am working in construction contracting field , and i would like to move to Oil and Gas sector through...
Replies
1
Views
1,792
Hi people. I have been with my current employer for the last 9 months on which I have had some basic exposure to PLC programming. I am at that...
Replies
15
Views
7,116
Dear all, I have fx2n plc on my hand but I don't have the programming cable sc-09 and it would not be easy for me to get one. I need the cable...
Replies
3
Views
74
Back
Top Bottom