C-14Maximizing System Performance

Using Program Control Instructions

Scan time can increase based on how you use JMP/LBL instructions and FOR/NXT instructions.

Using JMP/LBL Instructions

Keep in mind these issues when programming JMP/LBL instructions:

Instruction

Consideration

 

 

JMP

The execution time required for a JMP instruction depends on

 

the program file that contains the JMP instruction.

 

The estimated execution time for a JMP instruction is:

 

8.9 + (file_number 2) 0.96

 

The greater the program file number, the longer it takes to

 

complete a scan of the JMP instruction.

 

 

LBL

Each LBL instruction uses 2 words of memory in the program file

 

plus additional memory, depending on the label number itself.

 

Each label number is placed in a label table. Each entry in the

 

label table uses 2 words of memory, starting from label 0. For

 

example, LBL 10 uses 22 (2 words 11th entry) words of

 

memory in the label table.

 

If you later delete LBL 10, the label table does not deallocate

 

previously used space. The only way to recover this space is to

 

upload and then re-download the program.

 

 

Using FOR/NXT Instructions

The FOR/NXT instructions have the same impact on execution time as the JMP instruction. The execution for a FOR/NXT loop depends on the program file that contains the instructions.

The estimated execution time for a FOR/NXT loop is:

8.1 + (number_of_loops 15.9) + (file_number 2) 0.96

The greater the program file number, the longer it takes to complete the FOR/NXT loops.

Publication 1785-UM012D-EN-P - July 2005

Page 300
Image 300
Bradley Smoker PLC-5 Using JMP/LBL Instructions, Using FOR/NXT Instructions, Instruction Consideration, Jmp, Lbl