Declaration of Variables
Original instructions
At a Glance
All of the variables used in the different sections of the program must be declared.
Undeclared variables cannot be used in the program.
NOTE: For more information, refer to chapter Data Editor.
Procedure for Declaring Variables
The table below shows the procedure for declaring application variables.
Step
Action
1
In Project browser / Variables & FB instances, double-click on Elementary variables
2
In the Data editor window, select the box in the Name column and enter a name for your first variable.
3
Now select a Type for this variable.
4
When all your variables are declared, you can close the window.
Variables Used for the Application
The following table shows the details of the variables used in the application.
Variable
Type
Definition
Run
EBOOL
Startup request for the labelling process.
Stop
EBOOL
Stop the labelling process.
Last_Box_late
BOOL
The process is in deflection.
Nb_Box
DINT
Number of labelled boxes.
Position_0
BOOL
Box at the beginning of the conveyor.
Position_1
BOOL
Box with the first label.
Position_2
BOOL
Box with the two labels.
First_Labelling_Point
DINT
Lower Threshold value.
Second_Labelling_Point
DINT
Upper Threshold value.
Deflection_Parameter
DINT
Deflection alarm triggering value.
Waiting_First_Part
BOOL
The first box is waited.
Waiting_Other_Parts
BOOL
The first box has already passed.
The following screen shows the application variables created using the data editor :
NOTE: Click on in front of the derived variable Encoder to expand the I/O objects list.