Modifying logic of application
Previous: Creating project "Counter"
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 →variableup
.
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 Neuron Power Engineer: 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 valueTRUE
:
-
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, enterTRUE
and press the Enter-key.
This illustration shows how the initial value for the variableup
is being modified: -
Save the FBD-logic: menu File, command Save
Continue with: Transferring application to controller
Interested in details? See the following articles in the reference documentation:
-
Reserved keywords in ST - This article lists the keywords which you have to avoid using when entering the identifiers in the ST-code (e.g. names for variables).
-
Supported data types (in ST) - This arcticle lists the data type which are supported in Neuron Power Engineer.
-
On ST: section "Creating application in ST-editor" and in particular:
-
Supported ST-syntax - This section is the best place to start when you need information on using ST-elements
-
On FBD: section "Creating application in FBD-editor" and in particular: