NOP instruction

foremanml

Member
Join Date
Feb 2014
Location
VA
Posts
2
Can someone please explain the NOP instruction. What happens when you have a routine and the first rung only shows a NOP output instruction with no conditions. Is the whole routine that follows ignored? The instruction explanation in the book is no help.
 
Omron? NOP means no operation - a gap in the program if you like - it has no effect. Must be an old PLC!
 
Logix 5000 processors have a NOP instruction. They don't do anything. I use then sometimes as a placeholder when I'm writing new code. Or a way to attach a comment.
 
NOP = No Operation. It's a means of inserting a rung of code with no output instruction (OTE, MOV, COP, et al). As mentioned, it's usually used to break up a section of code, usually with a rung comment attached to it. Can also be used as a placeholder for future code. And lastly, it's good practice if you have an empty subroutine to at least have a rung with a NOP. RS has a bit of a 'feature/bug' that when you create a new routine, it'll compile unless you open the routine. Then it creates an empty rung that won't compile. You can delete the empty rung and compile, but next time you open the routine again, it will recreate the empty rung. For that purpose, it's usually wise to put a single rung with NOP in an empty routine. Of course if you can, don't leave empty routines, but often it's practical to create routines for future code/features.
 
The A-B NOPs I'm familiar with are merely input placeholders. They do not scan as false but rather are interpreted as if they didn't exist - as far as solving the rung goes. So, if you had a rung with only a NOP and an OTE the OTE would always be TRUE.
 
Thanks

I appreciate the prompt replies. The AB book definition makes no sense. I got the impression from looking at it that it shorted the rungs and the routine would be ignored. I was looking at a program offline. Probably would make more sense if I seen it in a program that was executing. I'm a newbie and I am learning.
 
If you see a solitary NOP on the first rung of a subroutine chances are it is there solely as a placeholder to provide a rung to hang a comment on to describe the purpose/operation of the subroutine. Its a fairly common practice.
 
I like to use a couple rungs with an NOP at the end of each one to separate chunks of code within a routine. Some people will do the same thing with a comment line, but when you upload a program without the source code then you lose all your comments. NOP's will stay there and will continue to keep your code grouped.
 
I appreciate the prompt replies. The AB book definition makes no sense. I got the impression from looking at it that it shorted the rungs and the routine would be ignored. I was looking at a program offline. Probably would make more sense if I seen it in a program that was executing. I'm a newbie and I am learning.

I think I've seen that documentation, and remember that it wasn't clear.

Don't scratch your head, just remember that a NOP instruction does ABSOLUTELY NOTHING, and is not classed as either an Input (or Conditional) instruction, or an Output instruction, which means it can be used for either.

I personally can't see a valuable use for it when used as a conditional (input) instruction, it would just be the same as if it didn't exist, so sitting on a branch would mean that the branch is "shorting" whatever is above or below it.

However it can be useful as an output instruction, (1) to allow the use of the "does nothing" rung to attach a rung comment to, or (2) when you don't want to mix Program Control Instructions, like SBR, with your application code.
 
Does the NOP instruction add to scan time? Looking at a program that has several hundred NOP instructions on their own rung.

What brand of PLC? some may have the NOP on a lot of rungs but if you have a ((END)) statement before them (the NOP's) then the CPU is not going to scan them, also some CPU's use them as place holders so they will have to be there if you are going to change the view... say from STL to LAD
 
What brand of PLC? some may have the NOP on a lot of rungs but if you have a ((END)) statement before them (the NOP's) then the CPU is not going to scan them, also some CPU's use them as place holders so they will have to be there if you are going to change the view... say from STL to LAD
AB CompactLogix. There is no ((END)) before them. They seem to be used for documentation purposes. I do not necessarily have a problem I just was not able to find a clear response to this on the AB sight or in help. Programming is done in LAD style. Thanks for the help.
 
Any chance the program was wrote in on the other side of the pond? I saw a German program like that before
 

Similar Topics

Is there an equivalent Rockwell PLC NOP instruction that is available for the M340 M580 Schneider PLC? Thanks,
Replies
10
Views
2,681
Good evening , I was looking thru some Rockwell Automation programs , and took notice in some programs , UDT’s , AOI’s , etc. the NOP...
Replies
13
Views
3,099
Hi guys! I was wondering why I've seen some guys put a lot of NOP in their STL code. For example: CALL FC4 NOP 0 What is the purpose of this...
Replies
12
Views
3,608
I have read the Instruction help on this. I am still not clear or sure on why this would even be used. I see this a lot on Rung 0 inside of the...
Replies
5
Views
4,472
Anyone know if there is an equivalent to the NOP instruction in Logix 500? I like to use them in my Logix 5000 for program organization and...
Replies
3
Views
4,404
Back
Top Bottom