Modifying logic of application
Modifying the ST-code
The ST-object program already contains a sample application for a counter. The existing application is enhanced just a bit during this step.
In the ST-object program, search for the declaration of the →variable up.
It is this line: up : BOOL;Enhance the declaration by the →initial value TRUE.
Mind that the icon is shown on the left edge while your are entering the code. This indicates a faulty term in the ST-code.
Example for errors in the ST-Code:
If you are not too familiar with the ST-syntax, use the content assist of logi.CAD 3: context menu within ST-editor, Content Assist – Double-click an element in the list.
Here the error-free ST-code for the declared variable with the initial value TRUE:
Save the ST-code: menu File, command Save
Modifying the FBD-logic
The FBD-object Counter already contains a sample application for a counter. The existing application is enhanced just a bit during this step.
In the FBD-editor press Ctrl+L in order to display the list of the declared variables.
Search for the declaration of the variable up.
Enhance the declaration by the initial value TRUE: Double-click into the column Initial value for the variable, enter TRUE and press the Enter-key.
This illustration shows how the initial value for the variable up is being modified:Save the FBD-logic: menu File, command Save