Introduction
Compare
blocks are only available in the LD programming language. They are
used to execute a compare expression (<
, >
, <=
, >=
, =
, <>
) in the ST programming language.
If the state of the left link is 1 and the result of the comparison is 1, the state of the right link is 1.
Compare blocks can be placed in any free cell except the last cell directly on the right power rail.
A compare block requires 1 line and 2 columns.
If a compare block is placed in a cell that is occupied by a Boolean link, and the following cell is either empty or also occupied by a Boolean link, then these cells will be occupied by the placed compare block.
If a compare block is placed in a cell, and this cell or the following cell is already occupied by another object, an error message is returned.
A placed compare block automatically creates a connection with
its neighboring objects on the left and right if they are of the BOOL
data type and there are no free cells between them.
Activating compare block placement mode
You have the following options to activate the compare block placement mode:
Use the
menu command.Use the
menu command.Use the
menu command from the shortcut menu.Press the Ctrl+F7 key combination.
or
Choose the
symbol.
The active compare block placement mode is indicated by the cursor symbol.
Note
In the
dialog box on the tab, if the checkbox is selected, then the corresponding properties dialog box is automatically opened when an object is placed. The procedures explained here are used when the checkbox is cleared.Placing a compare block
Placing a compare block:
Step |
Action |
---|---|
1 |
Activate the compare block placement mode. |
2 |
Click the target cell in the LD section. or Use the arrow keys to move the gray field to the target position, and press Enter. Result:The compare blocks is placed. |
3 |
Placing other compare blocks:
|
Defining the compare operation
Defining the compare operation:
Step |
Action |
---|---|
1 |
Open the properties dialog box for the compare block. Result: The properties dialog box for the compare block is opened. |
2 |
Enter the desired compare operation in the text box, see also General tab. Example: ![]() |
3 |
Confirm the compare operation with .Result:
|
4 |
If you do not want to assign the
variable an address or comment, confirm using Enter or the Result: The variable is declared and enabled in the section. A syntax and semantics check is performed and the procedure ends here. Example: ![]() |
5 |
If you do want to assign the variable
an address and/or comment, use the ![]() |
6 |
Confirm with Enter or the Result:The variable is declared and enabled in the section. A syntax and semantics check is performed. Example: ![]() |