NOP Instruction Execution Time - Is It Worth The Time?
If the No Operation (NOP) instruction has no operation, then why does it have an execution time?
Can its execution really impact upon the scan time in any meaningful way?
Some insight...
The execution time of a standard instruction is made up of a couple of actions:
1. If the preceding rung logic is true, the rung-condition-in is set true - this is time interval 1.
2. Next, the instruction itself is evaluated - this time interval 2.
3. Then, the rung-condition-out is set true - this is time interval 3.
The sum of the 3 time intervals gives you the overall instruction execution time.
For the No Operation (NOP) instruction, as there is no operation, there is no evaluation time for the instruction itself. The execution time listed for the NOP refers only to its rung-condition-in and rung-condition-out being set when the preceding rung condition is true, as is the case for a rung with only a NOP instruction.
Each instructions listed execution time includes the rung-condition-in and rung-condition-out portion of the entire execution of that instruction.
The speed of setting the rung-condition-in and -out is dependant on the processor and its firmware version. In some cases, which version of RSLogix 5000 is used can vary the speed because the version of software determines the version of firmware used in the processor. So, and while negligible for the NOP, it can vary from processor family to processor family, or processor to processor within a family, as can many of the instructions execution times.
AustralIan said:
...In a 1756-L73 it is listed as 0.01uS...
...
jtteresinski said:
...
jtteresinski said:
The execution time for a NOP instruction in a ControlLogix 1756-L73 is indeed 0.01uS for all recent firmware versions up to v21, as it is for all of the newer 5370 CompactLogix processors. However, it can vary from 0.01uS to 0.04uS for the older CompactLogix, depending on which processor and which version of firmware i.e. RSLogix 5000.
jtteresinski said:
...Does the NOP instruction add to scan time? Looking at a program that has several hundred NOP instructions on their own rung.
Even though the rung-condition setting is extremely fast, it does have a bearing on each instructions execution time, and hence, a cumulative affect on the overall execution time of the program i.e. scan time. This is why there is a listed execution time for the NOP instruction. Using many of them in a program does affect the scan time, but, could they have a detrimental affect?
Let's get some perspective here while assuming the 0.01uS execution time for a NOP...
uS = microsecond
mS = millisecond
1uS = 0.001mS
Or...
1,000uS = 1mS
0.01uS = 0.00001mS
Or...
100,000 x 0.01uS = 1mS
Or...
100,000 x NOP = 1mS on scan time
50,000 x NOP = 0.5mS on scan time
25,000 x NOP = 0.25mS on scan time
2,500 x NOP = 0.025mS on scan time
1,000 x NOP = 0.01mS on scan time
So, if your "
several hundred NOP instructions" add up to 1,000, you will be impacting on the scan time in the order of a hundredth of a millisecond.
I am not saying this is, or is not, a detrimental affect on the scan time. I'll let you decide that for your self.
Regards,
George