states of rungs containing SCP s and PIDs that are not true

realolman

Member
Join Date
Mar 2009
Location
here
Posts
584
RsLogix 500 Micrologix 1500

I read that you should not put any logic in front of a PID on a rung because when the rung is not true the output of the PID stays in it's last state.

What becomes of the output of a SCP on a rung that is false?

I am trying to trouble shoot a system that is so screwed up, I would like to just start over...

So anyway ...what is the effect of an PID or a SCP on an untrue rung... and is there any problem with putting logic on a JSR rung, to skip existing routines and use my new ones instead?

thank you.
 
They all stay in their last state.

The problem with conditional "JSR's" is the same, all conditions within the subroutine will stay in their last state unless written to somewhere else in the program ( another subroutine or the main program file ladder 2). I don't recommend conditional subroutines.
 
PID is a special case, because it's one of the few instructions that relies on data from the past to make its calculation.

The Scale With Parameters (SCP) acts only on the Destination address, immediately.

So if you have pre-conditions that cause the SCP to not execute, the Destination address will remain at whatever value it was prior to the rung being scanned.

There's also no problem using instructions to condition a JSR instruction. Just make sure you understand that the logic in the subroutine won't be solved at all; any value or state set by an instruction in the subroutine (and nowhere else) will remain at its last state.

Swapping between alternative subroutines using JSR instructions is a very good way to quickly test your version of the logic while retaining the ability to immediately switch back to the original.
 
The Logix500 PID will also clear its integral sum when the rung is false. If you really need to disable a PID instruction on a SLC or ML then put it in manual and set the output to the desired condition. If you are using a low select or something similar where two PIDs control one output then put the PIDs in conditional subroutines.

(This only applies to Logix500. Logic5 and Logix5000 PIDs are different.)
 
The Logix500 PID will also clear its integral sum when the rung is false. If you really need to disable a PID instruction on a SLC or ML then put it in manual and set the output to the desired condition. If you are using a low select or something similar where two PIDs control one output then put the PIDs in conditional subroutines.

(This only applies to Logix500. Logic5 and Logix5000 PIDs are different.)
I think something very similar to this is going on... there are varying conditions where the folks who wrote this stuff wanted to use different PID's for different conditions... there are two (or more ) PID's controlling the same analog output ... actually they control an integer; which is then used in two or more logic selectable SCP's to control the output.

I think actually the SCP's might be a good thing because the integers that are the control variables from the various PID's don't ( I guess ) have any "connection" to the output if the rung controlling the SCP is false, because they are only controlling integers.

The whole thing is very confusing as the inputs and set points to the PID's are manipulated in various different locations in the ladder logic as well. It often seems that they are trying to use the ladder logic to do what the PID should do or augment the PID with ladder logic because the physical system is incapable of delivering what the PID is calling for.

I think the whole thing just got out of hand. I don't mind the confusing part too much, because I like a challenge, but sometimes it just seems like too much spaghetti. wiping your butt with a hoop.
 
Last edited:
sometimes it just seems like too much spaghetti

you might want to take a look at the first attachment (signal mapping pdf) in the following post ...

http://www.plctalk.net/qanda/showthread.php?p=505010&postcount=21

basically this shows a way to UNTANGLE spaghetti code – by laying out (on paper) how the various signals flow through the program ...

basic ideas:

(a) where does the signal come from? ...
(b) where does it go to? ...
(c) what makes it move from one location to another? ...
(d) what are the expected range of values in each location? ...

in other words, you could consider it something like a schematic for an electrical wiring system ... but instead of electricity, you're drawing out a schematic to help track down "numbers/values" through the ladder logic code ...

I've been using (and teaching) this same technique for years to give my students a SYSTEMATIC approach to troubleshooting their way through their companies' programs ...

survival tip: use a BIG piece of paper – and write SMALL ... and make good use of the RSLogix500 software's "Find All" feature ...

good luck with your project ...
 
you might want to take a look at the first attachment in the following post ...

http://www.plctalk.net/qanda/showthread.php?p=505010&postcount=21

basically this shows a way to UNTANGLE spaghetti code – by laying out (on paper) how the various signals flow through the program ...

basic ideas:

(a) where does the signal come from? ...
(b) where does it go to? ...
(c) what makes it move from one location to another? ...
(d) what are the expected range of values in each location? ...

in other words, you could consider it something like a schematic for an electrical wiring system ... but instead of electricity, you're drawing out a schematic to help track down "numbers/values" through the ladder logic code ...

I've been using (and teaching) this same technique for years to give my students a SYSTEMATIC approach to troubleshooting their way through their companies' programs ...

survival tip: use a BIG piece of paper – and write SMALL ... and make good use of the RSLogix500 software's "Find All" feature ...

good luck with your project ...

You guys are the best. That is very kind and helpful of you.

I have actually tried to do what you describe... sort of a flow chart. but I was trying to figure something out on my own and I didn't get too far. No doubt your method is much better than what I tried to do... I will look at your link right now... thank you.

"Find All" is burned into the display of my laptop Always nice to see about 15 results in the results box when you look for the input to a PID.... not.

thank you.
 

Similar Topics

Greetings ... someone sent me a request for some student handsouts that I developed ... turns out that I had this hosted on my business website...
Replies
0
Views
155
I want to know how to make a flip flop rung that will change states every scan. This is for a fast sequencer. Is there a special bit similar to a...
Replies
8
Views
2,215
Does anyone know if it's possible to display the alarm Log with just the on State of an Alarm and not the Off state.
Replies
0
Views
1,002
Hello. I am dealing with an issue with the ModuleStates function. My program passes the value "1" to the parameter LADDR. This value "1" is set...
Replies
4
Views
1,650
Hi, im having an issue with programming on a 1756-L72 ControlLogix 5570 where every time I update a tag value it will save for that day, then the...
Replies
4
Views
1,846
Back
Top Bottom