4.1 Creating a new project
The project configuration is created using the RexDraw program. Each project consists of at least two .mdl files. The first file is the main file of the project, which is used for configuration of tasks, drivers, priorities and timing. The other file(s) contain the individual control algorithms (tasks).
Standard approach:
- Run the RexDraw program, start with an empty project and save the new file as e.g. myproject_exec.mdl.
- Open Block Library, choose View/Block Library in the menu or use the ./../MULTILANG/MANUALS/RexGettingStarted/images//ikonka_bl.png width="12.045pt" height="11.29218pt" /.
icon from the toolbar.
- Drag&drop the main block called EXEC and one TASK block to the myproject_exec.mdl file. Both of them are contained in the EXEC library. Further the location of blocks within the libraries will be denoted as library/block, e.g. EXEC/TASK.
- Now connect the two blocks, namely the Level0 output of the EXEC block
and the prev input of the TASK block. To connect the blocks, drag the output
arrow to the input arrow using the left mouse button. The connection will
be established when the line goes bold and green. After releasing the mouse
button you can recognize a successfully connected line by its style. A full line
terminated by a full arrow at the input of the connected block indicates a valid
connection.
- Each block can be configured by double-clicking on it. A block parameters and
properties dialog appears. The parameters of all blocks of the REX Control
System are described in the Help (press the F1 key) and in the Block reference
manual [1].
- Set in the block parameters dialog of the EXEC block, i.e. the task connected to the Level0 output will be executed each tick*ntick0=0.1 seconds.
- Rename the TASK block to myproject_task (the Block name field in the block parameters dialog). By this, we define the file associated with the TASK block. The myproject_task.mdl file will be created later.
- Save the myproject_exec.mdl file. At this moment it is necessary to define the main file of the project. Pick File/Set as main in the menu. The window title changes to myproject_exec - RexDraw [myproject_exec].
- Open a new file and save it as myproject_task. Use the following function blocks from
Block Library:
- MATH/CNB – constant of type Boolean, change name to CNB_SWITCH1, set parameter ,
- MATH/CNB – constant of type Boolean, change name to CNB_SWITCH2, set parameter ,
- LOGIC/AND_ – logical AND,
- LOGIC/TIMER_ – a timer block, set parameter , ,
- ARC/TRND – real-time recording, set parameters , , leave the default values otherwise
- MATH/CNB – constant of type Boolean, change name to CNB_RUN, set parameter ,
Connect the blocks as shown below.
New branch of a line can be created by right mouse button dragging.
At this moment the executive myproject_exec.mdl and the corresponding file with the algorithm myprojec_task.mdl are ready for compilation.
[Back to top] [Up] [Next]