User guide

Win+Drive
8.
Generating Programs
After the schematics of a program have been created they should be converted to programs that can be
executed either on the PC or on the target system. The total code generation is split into two parts:
-
generating the C program from the schematics
-
compiling the C program to binaries.
8.1
Generating the Program from the Schematic
To generate the C program from the schematic select
Generate C-Code
from the
Tools
menu. This will start
the code generation. Output messages and error messages are placed into the output window.
If errors occured there will be error messages in the output window. Double-clicking these lines will open the
schematic where this error is located and will put the cursor position at the appropriate block or port. The item
that caused the error will be blinking. This can be used to go very quickly to the source of the error.
8.2
Execution
Order
After generating the code the execution order is displayed if the appropriate option was selected within the
View
menu. The order is shown in the left upper corner of each basic block and consists of two numbers. The
first gives the number of the chain of basic blocks in the order they are calculated. Win+Drive always places
blocks whose output values are only used by one other block or variables into a chain. The second number is
the order within this chain. This order is on a stack basis: a block with a lower number will call the block with
the number above. This block will thus be calculated before. Therefor the order of the second number is from
back to front within one chain.
.
.
,
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
Figure 8.2.1: Execution order
To change the execution order, basic blocks can be connected. These connnections are created similar to the
connections of ports of blocks, but now the body of the blocks is selected. A connection line will appear that
extends from one block to another.
39