subroutine problem

praj17

Member
Join Date
Jul 2008
Location
pune
Posts
6
hi ,

i m new to ladder prgramming. i would like to know that in Allen bradley i have seen that when u call a subroutine program flow goes to that particular lad no. and it scans it(this happens in normal scan) but when that subroutine is not supposed to be called then the output of that ladder remains in their earlier state . how shall i keep them in reset state when that ladder is not called.
 
Conditional subroutines can be tricky.
In the main ladder, use the opposite of what ever is calling your sub to set the outputs to the desired state.

Something like this:

If Condition TRUE THEN
Go Sub
Else set outputs
Endif;

You can download a simple Washing Machine program that uses conditional subs here: http://forums.mrplc.com/index.php?download=359
You can see how the resets are handled outside the sub.
 
Last edited:

Similar Topics

Hello, I have a simple JSR problem which confuses me. The software is RSLogix 5000. In the main routine, I have a rung like this A ------|...
Replies
9
Views
3,473
Greetings, I am new to unity pro PLC programming. I am having problem getting out of a subroutine when calling of subroutine stops. the output...
Replies
1
Views
2,600
I have a bender table that I am automating. I have added a Kinco HMI and PLC, I am also using an Omron encoder sensing the rotation of the table...
Replies
49
Views
9,285
See image below. Look at line 95. I tested all data type, but none of them works. https://ibb.co/H2Csr15 See this. TEMPDATA2 is used only...
Replies
3
Views
2,702
With RS5000 and a Clogix, I would like to know if i can work with same coils adresse on 2 different subroutine and just call one at the time? I...
Replies
13
Views
3,118
Back
Top Bottom