a small ladder for you guys to look at

bob1371

Lifetime Supporting Member
Join Date
Mar 2003
Location
Southern Indiana
Posts
355
Hello

Just wanted some opinions (good or bad) on the following ladder.
http://www.angelfire.com/in4/bobbyallen/ladder.html

About the process, We run cast aluminum oil pans for Honda and this particular line runs 4 models. The last process installs 2 dowel pins into the pan for alignment with the engine block, then the pan is put onto a compound jig that checks all the holes for proper location. This process is all mechanical with stationary and push pins checking the holes. They first decided to add dowel pins sensors then a week later wanted sensors to check for warpage of the pan. We use 2 seperate compound jigs, each check two different pan models. The PLC in the pin press machine was full so we installed a small plc and use output O:0/1 to feed X27 on old plc. X27 is always on unless alarm condition.
If the operator pushes a pan onto the jig and all the sensors dont come on they get a RED light. Im also checking for stuck/broke sensors. This is a small program and not much of a problem, just wanted to get ideas on other ways? Maybe bit comparisions? I know you can ask 10 people to do this and get 10 different ladders.

thanks for any pointers.

Bob
you all have a safe and happy 4th.

🍺
 
Not Bad!...

Sure, there's a bunch of ways to accomplish this. By not 'trimming off the fat', yours wasn't too hard to follow, so I would consider it one of the BETTER ways!

From what I see, it looks like you will only get a failure if ONE sensor (in each group of 4) fails to turn on. Is this what you want? What if TWO or THREE fail to turn on? Yes, the green lamp will not turn on, but the red lamp won't either (and you won't inhibit that X27 signal). Additionally, if all four fail to turn on, it assumes the fixture is empty when it may not be.

If this is the case, you might consider adding an 'interrogate' sensor that turns ON when the part is correctly positioned in the fixture (or simply a "CHECK" pushbutton for the operator?). Use this signal to start the inspection.

The only minor 'cleanup' I'd recommend is to XIO the two internal bits rather than using the 'red lamp' output in the first rung.

| B3:0/0 B3:0/1 B3:0/2 O:0.0/1
|---]/[------]/[------]/[-----------------( )


.
Besides breaking the (unwritten) 'Don't use outputs as internal bits' rule, it saves you from having to remember what conditions turn on the red lamp.

Otherwise, good job Bob. Remember, programming doesn't have to be like the game show "Name That Tune"...
  • Contestant 1: "Bill, I can write that program in 5 rungs"

    Contestant 2: "Jim, I can write that program in 3 rungs"

    Contestant 1: "Write that program, Bill"
beerchug

-Eric
 
Thanks for the reply Eric. I will see if I can dress it up a little. Spending several years on the troubleshooting side I would like to start making things as easy as possible for the guys who work for me now. So anything I do im gonna simplify if possible and put in plenty of clear understandable comments.

thanks again

Bob
 
Hi Bob

Eric is right in saying that u have not checked for the condition where more than 1 sensor has failed. If I were in your place I would have handled the program this way. I am not saying this is the best way to do it, but this is my way. Set some internal bits for each input checked. Say you have N100:0 free to use, then

XIO I:0.0/1 OTE N100:0/0
:
:
XIO I:0.0/6 OTE N100:0/3

N100:0 can now have 2^4 = 16 combination values of which only one value will correspond to all sensors are OK signal, the value being 15.
The next rung would be
NEQ N100:0 15 TON T4:1

This can be very useful when you have an operator interface, which tells you what the fault is. Most of the operator interfaces will accept values and display a message corresponding to the value (eg. Allen Bradley Panelview). Based on the value of N100:0, you could easily tell which sensor or combination of sensors failed.

PS: I did not notice the other inputs I:0.0/3, I:0.0/8 until I finished writing the above. If you have 8 sensors, then the value of N100:0 for all sensed is 255.
 
thanks for the reply, that was kinda what im looking for. simple and easy.
I do only have 4 sensors active at any one time so the NEQ 15 is what im after.

thanks
bob
 
16 Sensors...

I like ettikudiappan's suggestion! Nice and simple, yet still easy to figure out by the next guy... (y)

One important point you might want to write down for future reference... :nodi:

If you ever go to 16 sensors. remember that the decimal representation of all 16 bits ON is NOT 65535 (2^16), but rather -32767 (note the negative sign). Bit 15 is used to indicate the 'sign' of the value in AB and other PLCs.

Just another thing you have to keep stored in your head... :rolleyes:

This very thing had bitten me once, so it's something I'll now never forget!... :oops:

beerchug

-Eric
 
Oh Eric. I finally found something good that came out of the IEC garbage. Normally in IEC compliant software you can select signed and unsigned integer for a word type. Beats lokking at funny figures.
Double beer for that.
beerchug 🍺
 
Oh great, you're telling me that now I ALSO have to remember to check whether the word type is set to 'signed' or 'unsigned'?... :rolleyes:

I'd better write THAT one down... :D

beerchug

-Eric
 
Eric, it gets worse. Here is a list of address types from the latest Omron software and PLCs. These are basically an IEC address type list except for CHANNEL which is word support for older PLCs.

1. BOOL (bit)
2. CHANNEL (word support for older PLCs)
3. DINT (signed double integer 2 words)
4. INT (signed integer 1 word)
5. LINT (signed long integer 4 words 64 bit maths)
6. LREAL (long real IEC754 64 bit)
7. NUMBER (as it says)
8. REAL (32 bit real IEC754)
9. UINT (unsigned integer)
10. UDINT (unsigned double integer)
11. ULINT (unsigned long integer)
12. UINT_BCD (unsigned integer BCD)
13. UDINT_BCD (unsigned double integer BCD)
14. ULINT_BCD (unsigned long integer BCD)

They are all really quite useful in their place. 64 bit maths is particularly usefull at times and some of the extended functions are great. I regularly use long differentiated increment for example (32 bit) for accumulation of water/power meters.
The other thing they have done is in the latest processors one can select BCD or decimal for timers and counters. You can limit all your timers and counters etc to 0-9999 BCD or 0-65535 (FFFF) as you wish but you only get one shot. The PLC works one way or the other.
 
To quote Capt. Kirk...

"Too... many... choices...
nut.gif
Must... stick to... Automation... Direct...
"

beerchug

-Eric
 

Similar Topics

Here is the logic i am designing. The X3 is basically a push button when u press it once it put something in on position. when u press it again it...
Replies
7
Views
5,347
Hello my name is NAGESH . Recently ijoined PLC PROGRAMMING COMPANY. SO i want practice more ladder logic programmes. any one knows...
Replies
2
Views
4,021
...and I agree. Context: TIA Portal/HMI = KTP1200 (12" screen) In the attached redacted image, the values in the white boxes are entered by the...
Replies
10
Views
678
Hi all, I’m new to programming and want to write a simple routine. Push start button, turns on sensor. 2 second delay before anymore logic read...
Replies
1
Views
325
Hi! I'm wondering if PLCs are used for small-scale production. I've got four machines doing different things with textiles, and I'm exploring the...
Replies
16
Views
1,326
Back
Top Bottom