?? New on ladder programming

hidroela

Member
Join Date
Sep 2003
Location
Across from nasa
Posts
74
I am working on e bus washer project that have 3 lines they are identical ,and my question is if I can make one subroutine and use it for each line if so how can I archive That
Assume they work at the same time
 
As you mentioned - "assumed they work at the same time",---- you can have parallel outputs to control 3 of them
 
chavak

As you mentioned - "assumed they work at the same time",---- you can have parallel outputs to control 3 of them


each line has there own output so i want to them to be operated at the same time or one first the other one 5 second after and the 3TH 20 second after the second
 
If they don't share I/O, you can just put each identical program (with distinctive I/O) in a separate subroutine, then call each one unconditionally from the main program.

By "bus" do you mean the vehicular or electrical kind of bus?
If electrical, please make sure the power's off before washing!... :eek:

beerchug

-Eric
 
Hidroela, unless the logic is extremely complex and you are out of memory, the effort involoved in setting up indirect referencing and so on to use a single subroutine will undoubtedly exceed the effort required to copy the same logic into three separate subroutines and changing the registers and I/O as required. The effort in de-bugging alone mitigates against using anything but the straightforward approach.
 
This is answer bothers me.

Tom Jenkins said:
Hidroela, unless the logic is extremely complex and you are out of memory, the effort involoved in setting up indirect referencing and so on to use a single subroutine will undoubtedly exceed the effort required to copy the same logic into three separate subroutines and changing the registers and I/O as required. The effort in de-bugging alone mitigates against using anything but the straightforward approach.

So what does one do when there are 10 identical items that must be controlled? Does one make 10 copies and with just small changes for the inputs and outputs and local data? What if 50 identical items need to be controlled? I think the chances for making errors in the many copies of almost identical subroutines is very high. What if another device needs to be added? What if the function or subroutine or function needs to change? Does one make 50 almost identical changes?

Tom, would you have given me the same answer? Do you really make multiple almost identical copies of subroutines in your projects?

Hidroela, Tom’s answer could be the easiest to get going correctly if the PLC you are using is limited and you are new to PLCs AND new to programming. You have only 3 lines to control.

I think this is an excellent question, but the best(most pragmatic) answer really does depend on the PLC and the level of knowledge of the programmer which you didn’t provide.

Here are some very brief descriptions of how Hidroela’s might accomplish his goal.

Using one subroutine to handle many almost identical items is easy to do with a S7-3XX. One function block can have many instance data blocks. Each instance data block would handle one production line.

On a Control Logix I would declare an array of structures where there is one structure for each item that is controlled. I could then call a subroutine using an index parameter to select the current structure out of the array. Inside the subroutine array addressing must be used such as AXIS.position and AXIS.velocity.

Mitsubishi has index registers that can be used to point to data tables. One would need to load the address of the items data in the index register then call the subroutine. In side the subroutine one uses indexed addressing with offsets to load or store data items at different offsets in the data table.

One can see that different PLCs require different techniques. I waited for someone else show the way and no one did. This suggests that indirect, indexed or array addressing is still not common and/or is avoided which is sad.
 

Similar Topics

Hi, New to the forum, completely inexperienced in ladder programming but the logic is there. I was wondering if anybody had experience with...
Replies
2
Views
1,369
Hey guys, I am replicating an old ladder logic program recently. And I have some questions, I am not sure these logic was made for a purpose or...
Replies
2
Views
1,121
have very little programming experience. I'm taking a basic course at a community college. We use RSLogix5000. Can anyone please tell me what the...
Replies
2
Views
1,396
Hello Everyone, I would like to get some advice from seniors!! Currently, I involve in writing PLC logic and Robot programs (ABB rapid...
Replies
5
Views
3,857
Back
Top Bottom