Declaration of variables
(Original Document)
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
Action_Time
TIME
Mobile stopping time at each position.
Configuration_Done
BOOL
The Lexium configuration is done.
Homing_Done
BOOL
The definition of the origin point is done.
index_subindex
DINT
CANopen parameter addresses for the WRITE_VAR block.
Lexium_Config_Step
INT
Configuration steps (program)
Lexium_Disabling
INT
Shutdown command
Lexium_operation_enable
INT
Command to start the Lexium drive.
Mobile _at_Position_A
BOOL
Mobile at the A position.
Mobile _at_Position_B
BOOL
Mobile at the B position.
Mobile _at_Position_C
BOOL
Mobile at the C position.
Mobile_at_start_position
BOOL
Mobile at the start position.
Mobile_in_Progress
BOOL
The mobile is moving.
New_SetPoint
BOOL
Start the next move.
Operation_done
BOOL
The mobile operation is done.
Position_A
DINT
First positioning value.
Position_B
DINT
Second positioning value.
Position_C
DINT
Third positioning value.
Ready_For_Stop
BOOL
The mobile goes to the last targeted position indicated before stopping the application. Then it comes back to the start position.
Run
BOOL
Start of the sequence.
Sequence_Number
INT
Number of displacements made by the mobile.
Start_Configuration
EBOOL
Start the Lexium configuration.
Stop
BOOL
The mobile stops the sequence and comes back to the start point.
Target_Reached
BOOL
The target position is reached.
The following screen shows the application variables created using the data editor :
NOTE: At start-up, the Lexium 05 is in Ready to switch on state (rdy is displayed). To be able to drive the motor, the Lexium must be in Operation enable state. To switch in this state, a bus command sets the 4 last bits of the Lexium control word to ‘1’ (00001111 (binary) = 15 (decimal)).
To switch the Lexium 05 to the Ready to switch on state, a bus command sets the sixth and the seventh bit of the Lexium control word to ‘1’ (00000110 (binary) = 6 (decimal)).
For more information on Lexium control word, consult the Lexium manufacturer manual.