2011年7月8日 星期五

What Makes a Good PLC Program?


PLC programmers have been faced with a steep learning curve over the last 25 years, as technologies have moved quickly and almost all industries have implemented programmable logic controllers as a standard. This means that good experienced programmers are hard to find, and while most companies offer programming services there are important features which are often missed out.

Firstly a PLC programmer should write code so that it can be easily understood. Documentation and structure are essential. This often involves a working knowledge of the plant or process, a good PLC should be able to solve engineering problems from a specification, not just produce lines of code. From my experience the best PLC programmers are always firstly engineers.

Secondly the end user should never need to look at the PLC programmer's code this might seem a contradiction of point one but a good program will perform without intervention. I work on the theory if something looks rushed and untidy it usually is.

Thirdly think robustness this means if a machine or process stops the operator/technician should know why straight away, diagnosing software faults should not require a specialist. With the implementation of field busses and integrated devices this becomes increasingly difficult as programmers often adopt the Idea of it works leave it, upon the first failure nobody can ever diagnose the issue. When using new technologies time should be spent looking at the functionality. In a recent project I managed to mimic the entire Profibus network with over 50 drives into the SCADA, two days later a drive faulted and an operator was able to show the maintenance guy exactly where the fault was, the drive was replaced and production resumed within half an hour. Think information and look at what can hang up the operation.

One good technique I have found on making code more robust is sequential counts; I have spent the last 5 years developing my own ladder sequential charts. After working with manufacturers own add -on packages ,at a premium, my opinion is ladder steps are more cost effective and usable.

Documentation - As a minimum every PLC code should include as a minimum an Operand comment, whether this is an input output or internal register. In my project I will also always try to cross reference this with the electrical drawing. Block Comment the first block in a PLC code should include important traceability information, a comment of any modifications the date and reasons should be quickly visible. Rung comment all rungs should give a functional description of what they are doing.

Structure - Structure should always follow the flow of the machine, for example a packaging machine should start a infeed, define each operation in a separate routine and end with the out feed. This technique seems to have been missed by many programmers making diagnosis and modification difficult.

It should never be underestimated how much machine/process availability can be increased through good programming techniques. Remember PLC programming is not a black art, just because something is not visible does not mean it should not be done correctly. Always demand more from systems integrators and PLC programmers.


Read more: http://www.articlesbase.com/programming-articles/what-makes-a-good-plc-program-1169532.html#ixzz1RUysHWwI 
Under Creative Commons License: Attribution No Derivatives

PLC|伺服馬達動作,分析

PLC|伺服馬達動作,分析
昨天在客戶廠內,看韓國機台的動作。

有一個左右移的平台,上搭配一個0度~90度的角度軸。
各自由一個伺服馬達帶動。

需要的動作:
1.平台在0度,跟接收玻璃位置。
2.等接收完成後。
3.平台升到90度,右移到放玻璃的位置。

有個干涉的部份。
在0度時,不可直接移到放玻璃的位置。
(會撞到門)

=========================
韓國人的動作是:
接收完玻璃後。
1.平台右移一小段(不會撞到門)
2.升到90度
3.平台再右移到放玻璃位置。

因為是2個伺服,3段動作,就會有3個加減速。
=============================
如果是自已寫的動作:
接收完玻璃後。
1.升到90度
2.平台再右移到放玻璃位置。

減化動作。也不會有撞機的危險。

2011年7月7日 星期四

PLC|CIM write by PLC Part-12

PLC|CIM write by PLC Part-11


CIM 除了上報BC外,
還有跟上下游機台在交握,
上/下游機台也是一台設備,
也是一樣在寫CIM的程式,
所以有時候,傳遞的信號錯了,
不需要認定一定就是自已程式的問題,
也有可能是上游機台在傳遞時,
發生了問題。


我們寫CIM程式,會發生問題,
相對的,上下游機台,也是在寫CIM程式,
當然也會發生問題。