Why does this NOT re-cycle after delay

OK I see what you mean. I did try something like this in a PLC5 a while back.

In this case the proc is an L81 and the .enables are not in the same scope. They are all "public parameters" from their own programs so I would have to map the controller scoped index pointer to each public parameter.
I will think about this a bit. I like the indexing idea but sometimes these solutions make maintenance harder a few years down the road.
 
OK I see what you mean. I did try something like this in a PLC5 a while back.

In this case the proc is an L81 and the .enables are not in the same scope. They are all "public parameters" from their own programs so I would have to map the controller scoped index pointer to each public parameter.
I will think about this a bit. I like the indexing idea but sometimes these solutions make maintenance harder a few years down the road.

Ah, if you have to write 50 rungs of what is essentially an input map to save 50 lines of code here using an index, that is probably not worth it.

It might be worth hiding the code for each station in its own routine, where the first rung in each routine is [NEQ STATION n RET], where n is the station number for that routine, and then have 50 unconditional JSRs in the caller. That way if each target is slightly different from the others it is easier to keep them separate.

Well, at least we cleaned up the STATION sequence+pause code.
 
Last edited:
Exactly

What you describe is just what I have done. Each station can be vastly different from the next so the processing and data mapping of each has to be dealt with separately.

I also prefer to keep controller scoped tags to a minimum and the SCADA system only references those tags.

I think I'm on my way. Thanks again all for the assist.
 
reverse the order of the bottom two rungs.

always assume the PLC is doing exactly what you told it to do; what you want it to do, or expect it to do, or think it should do, is irrelevant. Therefore, we note the irony of your location as "State of Denial" ;); we've all been there; many times ;)

It is actually counting up more than once; it is counting up to 3 continuously, once per scan, as plvlce notes.

YEP!

PLC and Computers are very capable, very obedient.. and very stupid.

Do will do exactly as told, nothing more or less. Every bit of math you ask them to do will be accurate. if you give it bad data.. its still accurate.

GIGO!

An odd one, on a HMI.. 2+2=5 is a true statement.. because the underlying math is 2.4+2.4=4.8, then your system rounds each value to the nearest whole to display it. The math is good for computation.. the display.. not so good.


I did it a few months ago with a zero enforcement... I wanted my output variable to a HMI to not go below zero. So i Put a LES - MOV pair of instruction in place.... before the SCP that fed them.

Why am I getting zeros?! Go and look.. ahh dammit, stupid human.. its doing what you told it.. not what you want.

Put the LES-MOV after the SCP. No problems now. Now the only way to catch a negative is a split microsecond hit to grab it from when the SCP computes it to when the LES-MOV acts on it.
 
I get it. I've been doing this for a number of years and the compiled vs. interpreted nature of PLC's bites me far more often than it should. I long for the Step through and Breakpoint functionality of higher level language IDE's where you can watch the code execute line by line, that would help so very much here. I'm still surprised that doesn't exist. It's always this kind of thing that trips me up.

But the FP rounding (ieee-754 I think) you mention I hardly ever miss. Rounding errors are just part of binary math and for some reason I can pick those up fast.
 
I long for the Step through and Breakpoint functionality of higher level language IDE's where you can watch the code execute line by line, that would help so very much here. I'm still surprised that doesn't exist.

<<shudder>>

Rung 1: Start motor
Rung 2: Math to calculate encoder position.
<Breakpoint>
Rung 3: When End-of-travel limit switch is met, stop motor.

The programmer hears a loud noise was while he's troubleshooting his code.
 

Similar Topics

L P#0.0 T MW 20 A m0.0 L mw 20 + 2 T mw20 Why not increase during the cycle?
Replies
2
Views
1,801
I am trying to connect with a Schneider plc which has a firmware version only available in Somachine v4.2. In Machine expert After taking upload...
Replies
0
Views
112
They are installed in a control panel that was made in France and are intended for the termination of analog inputs. Each of the red capped...
Replies
4
Views
420
So, I'm really just trying to get some experience by practicing with arrays. I'm using studio 5000 v33. I have one rung with an XIC bit that's...
Replies
5
Views
232
Back
Top Bottom