Tricom Controls
Here we will illustrate jump instructions
and how to be used inside the application
program.
9. JUMP INSTRUCTIONS
Tricom Controls S.A.E ام
ا
20 Street 295, New Maadi, Cairo - Postal Code 11435 - Tel: 002 02/25181138, Fax: 002 02/25181137
Email: info@tricomcontrols.com
٠٠٢ ٠٢/٢٥١٨١١٣٧ : ف٠٠٢ ٠٢/٢٥١٨١١٣٨ : ت- ١١٤٣٥ ر ى- ا
دى اة- ٢٩٥ رع٢٠
139
Tricom Controls
Jump Instruction In LAD/FBD, the label (NEW1) is entered as an identifier above the coil
symbol
or assignment symbol. In STL it comes after the Jump (JU) instruction. The label can have up to
four characters, the first of which must be a letter or the “_” character.
The label marks the point where execution of the program is to continue. Any instructions or
networks between the jump instruction and the label are not executed. Jumps can be made both
forwards and backwards. The jump instruction and the jump destination must both be in the same
block (max. jump length = 64kbyte). The label’s name can only be used once in a block. Jump
instructions can be used in FBs, FCs and OBs.
Inserting In LAD and FBD, you use the Program Elements browser to insert a label:
a Label Program Elements -> Jumps -> LABEL.
Jump Label The label may be as many as four characters of which the first character must be a
letter. Jump labels are followed with a mandatory colon “:“and must precede the program
statement in a line.
Example: NEXT: A I 0.0
JMP An unconditional jump instruction causes a program jump to a label regardless of the
RLO.
Tricom Controls S.A.E ام
ا
20 Street 295, New Maadi, Cairo - Postal Code 11435 - Tel: 002 02/25181138, Fax: 002 02/25181137
Email: info@tricomcontrols.com
٠٠٢ ٠٢/٢٥١٨١١٣٧ : ف٠٠٢ ٠٢/٢٥١٨١١٣٨ : ت- ١١٤٣٥ ر ى- ا
دى اة- ٢٩٥ رع٢٠
140
Tricom Controls
JC The "JC" conditional jump is only executed if the RLO is "1". If the RLO is "0", the jump is
not executed, the RLO is set to "1" and program execution continues with the next instruction.
JCN The "JCN" conditional jump is only executed if the RLO is "0". If the RLO is "1", the jump
is not executed and program execution continues with the next instruction.
Note STL provides additional jump operations, which are discussed in another
programming course.
Tricom Controls S.A.E ام
ا
20 Street 295, New Maadi, Cairo - Postal Code 11435 - Tel: 002 02/25181138, Fax: 002 02/25181137
Email: info@tricomcontrols.com
٠٠٢ ٠٢/٢٥١٨١١٣٧ : ف٠٠٢ ٠٢/٢٥١٨١١٣٨ : ت- ١١٤٣٥ ر ى- ا
دى اة- ٢٩٥ رع٢٠
141
Tricom Controls
Comments:
----------------------------------------------------------------------------------------------------
----------------------------------------------------------------------------------------------------
-------------------------------- -------------------------------------------------------------------
----------------------------------------------------------------------------------------------------
----------------------------------------------------------------------------------------------------
----------------------------------------------------------------------------------------------------
----------------------------------------------------------------------------------------------------
----------------------------------------------------------------------------------------------------
----------------------------------------------------------------------------------------------------
----------------------------------------------------------------------------------------------------
----------------------------------------------------------------------------------------------------
--------------------- ------------------------------------------------------------------------------
----------------------------------------------------------------------------------------------------
----------------------------------------------------------------------------------------------------
----------------------------------------------------------------------------------------------------
----------------------------------------------------------------------------------------------------
----------------------------------------------------------------------------------------------------
----------------------------------------------------------------------------------------------------
----------------------------------------------------------------------------------------------------
----------------------------------------------------------------------------------------------------
---------- -----------------------------------------------------------------------------------------
----------------------------------------------------------------------------------------------------
----------------------------------------------------------------------------------------------------
----------------------------------------------------------------------------------------------------
----------------------------------------------------------------------------------------------------
----------------------------------------------------------------------------------------------------
----------------------------------------------------------------------------------------------------
----------------------------------------------------------------------------------------------------
---------------------------------------------------------------------------------------------------
----------------------------------------------------------------------------------------------------
----------------------------------------------------------------------------------------------------
----------------------------------------------------------------------------------------------------
----------------------------------------------------------------------------------------------------
----------------------------------------------------------------------------------------------------
--------------------------------
Tricom Controls S.A.E ام
ا
20 Street 295, New Maadi, Cairo - Postal Code 11435 - Tel: 002 02/25181138, Fax: 002 02/25181137
Email: info@tricomcontrols.com
٠٠٢ ٠٢/٢٥١٨١١٣٧ : ف٠٠٢ ٠٢/٢٥١٨١١٣٨ : ت- ١١٤٣٥ ر ى- ا
دى اة- ٢٩٥ رع٢٠
142
Tricom Controls
Here we will illustrate how to use Compare
instructions and differences between its
types in application program.
10. COMPARE INSTRUCTIONS
Tricom Controls S.A.E ام
ا
20 Street 295, New Maadi, Cairo - Postal Code 11435 - Tel: 002 02/25181138, Fax: 002 02/25181137
Email: info@tricomcontrols.com
٠٠٢ ٠٢/٢٥١٨١١٣٧ : ف٠٠٢ ٠٢/٢٥١٨١١٣٨ : ت- ١١٤٣٥ ر ى- ا
دى اة- ٢٩٥ رع٢٠
143
Tricom Controls
CMP You can use comparison instructions to compare the following pairs of numerical values:
I Compare integers (on the basis of 16 bit fixed-point number)
D Compare integers (on the basis of 32 bit fixed-point number)
R Compare floating-point numbers (on 32 bit real number basis = IEEE floating-point numbers).
If the result of the comparison is "true", then the RLO of the operation is "1", otherwise it is "0".
The values at inputs IN1 and IN2 are compared for conformity with the specified condition:
== IN1 is equal to IN2
<> IN1 is not equal to IN2
> IN1 is greater than IN2
< IN1 is less than IN2
>= IN1 is greater than or equal to IN2
<= IN1 is less than or equal to IN2.
Tricom Controls S.A.E ام
ا
20 Street 295, New Maadi, Cairo - Postal Code 11435 - Tel: 002 02/25181138, Fax: 002 02/25181137
Email: info@tricomcontrols.com
٠٠٢ ٠٢/٢٥١٨١١٣٧ : ف٠٠٢ ٠٢/٢٥١٨١١٣٨ : ت- ١١٤٣٥ ر ى- ا
دى اة- ٢٩٥ رع٢٠
144
Tricom Controls
CMP ? I Compare Integer
Description
CMP ? I (Compare Integer) can be used like a normal contact. It can be located at any position
where a normal contact could be placed. IN1 and IN2 are compared according to the type of
comparison you choose.
If the comparison is true, the RLO of the function is "1". It is linked to the RLO of the whole
rung by AND if the box is used in series, or by OR if the box is used in parallel.
Output Q4.0 is set if the following conditions exist:
• There is a signal state of "1" at inputs I0.0 and at I0.1
• AND MW0 >= MW2
Tricom Controls S.A.E ام
ا
20 Street 295, New Maadi, Cairo - Postal Code 11435 - Tel: 002 02/25181138, Fax: 002 02/25181137
Email: info@tricomcontrols.com
٠٠٢ ٠٢/٢٥١٨١١٣٧ : ف٠٠٢ ٠٢/٢٥١٨١١٣٨ : ت- ١١٤٣٥ ر ى- ا
دى اة- ٢٩٥ رع٢٠
145
Tricom Controls
CMP ? D Compare Double Integer
Description
CMP ? D (Compare Double Integer) can be used like a normal contact. It can be located at any
position where a normal contact could be placed. IN1 and IN2 are compared according to the
type of comparison you choose.
If the comparison is true, the RLO of the function is "1". It is linked to the RLO of a rung
network by AND if the compare element is used in series, or by OR if the box is used in parallel.
Tricom Controls S.A.E ام
ا
20 Street 295, New Maadi, Cairo - Postal Code 11435 - Tel: 002 02/25181138, Fax: 002 02/25181137
Email: info@tricomcontrols.com
٠٠٢ ٠٢/٢٥١٨١١٣٧ : ف٠٠٢ ٠٢/٢٥١٨١١٣٨ : ت- ١١٤٣٥ ر ى- ا
دى اة- ٢٩٥ رع٢٠
146
Tricom Controls
CMP ? R Compare Real
Description
CMP ? R (Compare Real) can be used like a normal contact. It can be located at any position
where a normal contact could be placed. IN1 and IN2 are compared according to the type of
comparison you choose.
If the comparison is true, the RLO of the function is "1". It is linked to the RLO of the whole
rung by AND if the box is used in series, or by OR if the box is used in parallel.
Tricom Controls S.A.E ام
ا
20 Street 295, New Maadi, Cairo - Postal Code 11435 - Tel: 002 02/25181138, Fax: 002 02/25181137
Email: info@tricomcontrols.com
٠٠٢ ٠٢/٢٥١٨١١٣٧ : ف٠٠٢ ٠٢/٢٥١٨١١٣٨ : ت- ١١٤٣٥ ر ى- ا
دى اة- ٢٩٥ رع٢٠
147
Tricom Controls
Comments:
----------------------------------------------------------------------------------------------------
----------------------------------------------------------------------------------------------------
-------------------------------- -------------------------------------------------------------------
----------------------------------------------------------------------------------------------------
----------------------------------------------------------------------------------------------------
----------------------------------------------------------------------------------------------------
----------------------------------------------------------------------------------------------------
----------------------------------------------------------------------------------------------------
----------------------------------------------------------------------------------------------------
----------------------------------------------------------------------------------------------------
----------------------------------------------------------------------------------------------------
--------------------- ------------------------------------------------------------------------------
----------------------------------------------------------------------------------------------------
----------------------------------------------------------------------------------------------------
----------------------------------------------------------------------------------------------------
----------------------------------------------------------------------------------------------------
----------------------------------------------------------------------------------------------------
----------------------------------------------------------------------------------------------------
----------------------------------------------------------------------------------------------------
----------------------------------------------------------------------------------------------------
---------- -----------------------------------------------------------------------------------------
----------------------------------------------------------------------------------------------------
----------------------------------------------------------------------------------------------------
----------------------------------------------------------------------------------------------------
----------------------------------------------------------------------------------------------------
----------------------------------------------------------------------------------------------------
----------------------------------------------------------------------------------------------------
----------------------------------------------------------------------------------------------------
---------------------------------------------------------------------------------------------------
----------------------------------------------------------------------------------------------------
----------------------------------------------------------------------------------------------------
----------------------------------------------------------------------------------------------------
----------------------------------------------------------------------------------------------------
----------------------------------------------------------------------------------------------------
--------------------------------
Tricom Controls S.A.E ام
ا
20 Street 295, New Maadi, Cairo - Postal Code 11435 - Tel: 002 02/25181138, Fax: 002 02/25181137
Email: info@tricomcontrols.com
٠٠٢ ٠٢/٢٥١٨١١٣٧ : ف٠٠٢ ٠٢/٢٥١٨١١٣٨ : ت- ١١٤٣٥ ر ى- ا
دى اة- ٢٩٥ رع٢٠
148