It's "Thump on Tim" Time!

Join Date
Apr 2002
Location
Just a bit northeast of nowhere
Posts
1,117
Hi gang!

This request is a little elaborate, so if nobody takes it, I'll understand :)

At the plant where I work, I am the only PLC programmer, and while I've been doing this sort of work for years, this is the first time I've been doing it to this degree. I've developed programs for three complete systems, reprogrammed another, and troubleshot a host of equipment.

The problem is, I had about 9 weeks of PLC in technical college, and the rest is entirely self-taught. I've taken elements of everything I could find - other people's code, a few books, you guys' input (only plagarize the best!) - to develop a style that makes perfect sense to me.

But having nobody else to discuss it with, I can't tell if I'm using the best techniques, or if my logic will make sense to anybody else who comes after me.

So what I'm looking for is a critique. Attached is a program I wrote for one of my shorter projects, and a brief description of how the machine operates. The op interface file is there too, if you wish to see it. Everything is RSLogix and Panelview.

Mind you, I'm not looking for a free debug. What I want to know is, can you follow the program easily? Does the logic make sense? Is the layout clean enough? Basically, if you saw this in a machine, would you like it, or want to rip it out and start anew?

Any feedback would be deeply appreciated.

Thanks!

TM
 
Tim- Like you I am mostly self taught.
Anyway I like what I see.
I can understand the file and follow it nicely.
I'm sure that there are a slim few, if any people at your company that can apreciate the work that you put into that project.
FWIW ATTABOY!
 
Tim,

I think you did a nice job.
The lay out is nice and easy to follow. Things are organized into
their own subroutines. (That makes trouble shooting a lot
easier.) ;) I try to write all of my code just like that.
I have found that it also helps if you have a section for I/O that has the real world Inputs and Outputs controlling and being controlled by internal coils/relays. That way when someone makes a change to the wiring at a later date banghead you can change one rung of code in one routine instead of hunting through the whole program and making changes.
Good work !
 
excellent work

Good job! Code is well documented and easy to follow. The first thing I check on any SLC500 or PLC5 job is that Page Titles were used. Those little things are a big time saver.

I can offer a couple minor suggestions.

#1 Maybe look at using some sort of startup subroutine. This could be a new ladder that has everything you want done on the first scan of the PLC program. Things like clearing registers, resetting counters and such. This could all be triggered using the first scan bit (S:1/15). You might not need this function but I always find there are certain things I want to do on startup. This is always the first rung of Lad 2 of my programs.

#2 You aren't doing much in the way of math in this program but if you ever did, you would want to be aware that math overflows can lead to a faulted processor. The last rung in Lad 2 for me is always an unlatch (OTU) on the S:5/0 status bit. If you added two values together and had a result greater than 32,767 two bits turn on. An overflow bit (S:0/1) and the overflow trap bit (S:5/0). If the trap bit is still set at the end of Lad 2, you get a processor fault. Unlatching that bit resets the trap but leaves the overflow bit intact (S:0/1) so you would still know an overflow occurred without a faulted plc.

Just minor suggestions though. Looks very good! I'll look at the PV later, but if it is anything like the ladder, your company is very lucky.

OG
 
Hey Tim, probably I've got an older version of RSLogix 500, so I can't read your file.
Could you export the file in the .ach format, and attach the database files too?

Thank you, Luca
 
I agree with RDay regarding the I/O subroutine.

Where I work we make a lot of very similar machines that will sometimes have minor variations in I/O. Occasionally one machine might use an NPN rather than a PNP sensor, for example. Like RDay said, this subroutine makes it very simple to adjust to such changes.

I know there has been a fair amount of criticism about this technique, but it can be a real time-saver once you get use to it.

Steve
 
Archive Edition

Here's the file in archive form, fully zipped and ready to go :)

Also, I think RDay and Steve's idea has merit. I've seen this done before, and cursed it myself before I understood what was going on :) It seems like a good idea for several machines of similiar construction. Alot of the stuff I do is custom build, one of a kind, and I think not really applicable, though. If I need to change a single I/O point, I could do it with Search and Replace functions.

Thanks for the feedback!
 
Hi Tim

Just a quick comment - Was there a reason why you didn't use of an alarm banner in the PV program? I thought an alarm banner may make fault finding easier.

In your fault file/sub routine, instead of using a heap of XIC's, you could examine the word addresses (ie B:18.3, B:18.4 etc) to see if the word value is anything but zero; anything but zero would indicate a fault condition.

Hope I don't sound too critical, its just a way of checking for faults that we use.
 
Last edited:
Hi Ian

>>Just a quick comment - Was there a reason why you didn't use of an alarm banner in the PV program? I thought an alarm banner may make fault finding easier. <<

The boss's preference. I've experimented with using alarm banners before, but the boss didn't care for the resulting esthetics. Being an "old school" kinda guy, he preferred the discrete fault lamp approach. This is changing, however...

>>In your fault file/sub routine, instead of using a heap of XIC's, you could examine the word addresses (ie B:18.3, B:18.4 etc) to see if the word value is anything but zero; anything but zero would indicate a fault condition. <<

I've begun using something similiar to this. In my newest project, I created a stack system (Hi Allen, Alan) that stacks and stores up to ten fault codes. The latest fault is the active one, and when cleared, the previous one pops up. Anything but a "0" indicates a fault state.

The advantage of this approach is, I use the fault number and an offset value to send the panel to a specific page. This page has detailed instructions on how to clear the individual fault. Press reset, go to the next fault page, until all are cleared, at which point the reset PB takes you to the main screen.

I should note we generally use Exor panels, PVs have some button-duplication issues that may complicate this when I implement it there :)

>>Hope I don't sound too critical, its just a way of checking for faults that we use.<<

Heck, no! All feedback is welcome, especially those with suggestions!

Thanks!

TM
 

Similar Topics

I would like to use the external clock source function to display time on a 15" C-more EA9 panel. The source would be a Logix processor. When I...
Replies
2
Views
1,324
Hi, Trying to get my head around the TIM instruction on a Omron CP1E plc. The maximum set valve is 9999 which is only 9.9 seconds. (BCD ) What if...
Replies
12
Views
3,459
I have an older CQM1H-CPU21 with cs-programmer 4.0. I have a TIM instruction and I'm trying to lower the time. The value for the timer is stored...
Replies
5
Views
2,165
hello to all I set a timer in omron plc(CPM2A) to count seconds but I have problem here!! time in omron plc is faster than I expect ! I know TIM...
Replies
7
Views
3,099
We inherited a WinCC system which comprises a ST7 driver. However a near station we have connected to it over fiber optic therefore we have direct...
Replies
0
Views
2,387
Back
Top Bottom