ML1000 Washing machine program

Ken Moore

Lifetime Supporting Member
Join Date
May 2004
Location
North, West, South Carolina
Posts
3,473
Well we had terrible weather yesterday, and I was stuck in the house, so I wrote a simple washing machine program for a ML1000 (1761-L32BWA). It is fairly well documented, and has been debugged on a test bed, I may have missed a bug or two, it's hard to fully test your own logic. If anyone finds a bug, please let me know, so that it can be corrected.

It uses conditional subroutines, and I don't think any instructor will believe it was written by a student. However, students may be able to obtain some insights that can be used in thier own programs.

The attached file is a zipped .rss file. I posted it via dial up, and hope someone else can convert to a PDF for me. PDF's are kinda of large for a dial up connection.


Ken
 
Last edited:
Talk about commenting a program! Way to go Ken.

washer1vv.jpg
 
Re: The KenMoore washer program

Rung 3: You probably want a short timer for the detection of HiHi level swtich, rather than a one-shot. That way, you don't get a false alarm if the sensor is just "splashed" for a moment.

Various places (Ex: Rung 2:3; 6:2). You really are one-shot happy - aren't you, Ken? Counters have built-in oneshots, as does S:1/15 "First Pass". And does it really matter if you do lots of resetting if you're "idle". Nothing wrong with what you are doing, I'm just commenting.... Nice sequencer in LAD 6, BTW.....


LAD 7. Again, debounce timers on your float switches would be a good improvement.


I'm not crazy about the conditional JSRs. It seems possible (though I haven't found a case yet), where a bit which drives an output can be left in an ON state when the JSR is no longer called. This would, of course, be a bad thing. True, you are getting faster scan times, but how much longer would your scan take without the conditional JSRs?



Very good job. Especially on the annotation. Program is well laid out, easy to follow.
 
Allen,

This is a scaled down version of logic I use in PLC-5's for batch processing. The PLC-5's are very heavily loaded and optimizing scan time is all ways a good thing, I may have 50-100 of these "phases" and only scan them when needed.

I normally would have one main subroutine (Lad 6),
and kept all the logic for that "Phase" in the one sub, I threw in the conditional JSR's within LAD6, just for the heck of it.
Never used them before, and wanted to see if I could overcome the left on condition you mentioned.

As noted in my documentation, I know the counter one-shot is not needed.

Wrote the program on a whim, and you're right debounce timers on all the float switches should be added.
 
??

Isnt all that a bit much I mean did you see the cool program I wrote for my washing machine? :) Wow I feel real simple after seeing that. It is a washing machine right? Not a space shuttle. My professor told me he once worked on a machine with 7000 lines of code. What is the most for anyone here?
 
I cann't open it with RS500 for ML1000 (10 point starter) !!
Is it because you are using a 32 pt controller (1761-L32BWA)?

Thanks
 
My professor told me he once worked on a machine with 7000 lines of code. What is the most for anyone here?

Having just about had a fit over the holiday when I opened up an S7-Graph program on a PC on which S7-Graph was not installed and saw the result in its STL/IL form, this got me thinking.


I checked out half a dozen Blocks having between 18 and 682 lines of code. After subtracting the 38 Bytes of overhead that an empty block has, I came up with values between 4 and just over 7 Bytes / Line of code.

The largest Block in the program is an S7-Graph Block which is not far short of the maximum 256 Action/Transition pairs which are possible. I actually had to split what I wanted to do into two parts, because it wouldn't fit in. The Block's size is 24604 Bytes which if we take 6 Bytes / line as an average (taking the higher value because I assume S7-Graph does not optimise perfectly), this one Block is equivalent to about 4100 lines of code. The bit that didn't fit in, takes up another 9640 Bytes or approx. 1600 lines of code.

Having a look at the stats, the program has at the moment 10 OBs, 135 DBs, 25 FBs and 46 FCs leaving aside various SFBs and SFCs. The complete size in the working memory is 156324 Bytes or about 26000 lines of code. At the moment this is just bare functional code. There is no error checking other than Interlocks (i.e. no timing of motor driven switch travel time etc.), no archiving or logging as yet, so I reckon, in the end it's going to be well over 30,000 lines of code.

If I subtract the code for the 4 S7-Graph Blocks there are still 106578 Bytes left conventionally programmed, split approx 50/50 FB / STL/IL. So this is equivalent to about 17,760 lines of code - now I know why I've working on this project for so long! šŸ™ƒ

Edit: Because somebody else is going to have to maintain this program afterwards, in some places I have repeated code 21 times, rather than using loops, in order to make it easier to maintain/fault-find. This affects 3 of the FBs and 5 of the FCs, having a total of just over 10,000 Bytes of code, so the size is not only due to "inflationary" coding. :)
 
Last edited:
New and Improved

Okay,
I admit I got carried away with the conditional subroutines, so
I removed the conditional JSR's in LAD6, and added debounce to all float switches. Removed unneeded oneshots. .rss file attached
(Ver 6.0)
BTW this revision has not been tested, but the main logic has not been changed, so I don't expect any "gotchas", but you never know.


Will post PDF file later today.


Ken
 
Ken:

I was just picking nits. The program was execellent, really. Especially for an "off the top of my head".

I know all about phase logic. Most of my programs are pretty simple batching systems, and I haven't cared so much if the scan times get up to 250 msec - response time isn't that critical in those.

But there have been a time or two where it is, and then I've conditioned my phases, just as you have. And I've had problems, especailly if the phase gets aborted (and therefore is no longer running, therefore no longer JSRing, therefore outputs stay in their last scanned state).

To solve it, you either have to put in a separate JSR for "Aborting" which will clean up those conditions, or make sure that the JSR is active for one last scan to get it to the end. Either way its more code than the problem deserves IF you can get away with un-conditioning the JSR.



PLC Newbie:

7000 is big, no question. I can't say how large my biggest was. After 10,000 - broken into losts of different subroutines (e.g., phases), with each phase having 20-30 rungs, plus hundreds of alarms, etc, you kind of stop counting.
 

Similar Topics

Hi all, after much aggravation trying to get my SLC5/04 to talk half duplex to RSlogix so l then would be able to communicate with both RSlogix...
Replies
0
Views
2,239
I have a customer with an existing ML1000 that we installed quite a few years ago. It's function was rather limited but did what we wanted. New...
Replies
5
Views
2,682
I feel really, really dumb asking this, but I shall. I am using a Micrologix 1000 to toggle two outputs. I am using a timer to time and it...
Replies
3
Views
1,496
I have set up two 1761-net-eni modules and have them working on our network. One module will communicate with the ML1000. The other gives 2-3...
Replies
3
Views
1,766
I have a customer that has a ML 1000 we installed years ago. It is limited to the function of Stopping a series of motors when bin limits go HI...
Replies
1
Views
1,703
Back
Top Bottom