Wednesday 13 December 2017

PLC Programming when to write good code

PLC programming JMP and LBL functions

Sometimes in plc programming you want to manipulate how the plc scanner behaves. You may want to allow it to move to other labels of the ladder rugs. For this we make use of JMP and LBL. LBL allows us to label a certain rung on the left and hand side and JMP allows us to specify a label which we want to jump to. This is very similar to how it works in assembly language. It is important to note that any rung which has a label and does not contain some type of jmp instruction somewhere may never be executed. So these rungs usually will be completely ignored. It’s always good practice to try and avoid this scenario as jmp and lbl can make your ladder program really messy and hard to debug if things are jumping around all the time.

Below is an eg of how JMP and lBL works.

Eg: of JMP and LBL

img_58b022f55c0aa.png

plc programming jmp and lbl

Word of warning when using JMP and LBL functions

Remember that having this sort of command can make it nice and easy to change the jumps. However the complexity can quickly outweigh the advantages when using this instruction too much in your plc programs. Try and keep jmp and lbl to a minimum when implementing in your programs. It will just simplify things and dodge lots and lots annoyances which you may encounter later on. It is better to organize your programs in a structured way where it is easy to read and easy to grasp for any future projects which you may encounter. However jmp and lbl can be quite easily utilized in tiny programs, but word of warning to the less wise.

More info :


plc programming
plc suppliers
industrial automation

No comments:

Post a Comment