Working sequence, priority and cycle time
1 Working sequence/block number
The numbers in the right upper corners of the blocks in edit mode also define their working sequence in the target system. Blocks with a lower number are called before blocks with a higher number. The working sequence may have a major influence on the function of the program and act, for instance, like parentheses in an arithmetic term.
Blocks without any number do not have a target function. Usually, they are only used for parameterizing and visualization.
Different results because of different working sequence
The following example shows how the execution of the same operation in two different working orders will result in different results.
The first operation is to provide a value by the sine generator. In the top row, the substraction is called first and afterwards the addition function block. In the lower row the working sequence is inverted.
The first substraction (block number 2) operates with an up to date value from the sine generator as well as a value provided by the addition (block number 3) from the previous working cycle. This value will be updated after the addition is called, what happens after the substraction. Because of this two differnt values are substracted.
The secound substraction (block number 5) operats always with values from the current program cycle. Because the addition (block number 4) does not change that value the same values are subtracted.
Therefore the results of the two rows are different.
Within the configuration the program block number refers to the priority of the assigned task. Here, lower numbers are indicative of higher-priority tasks. Within the working sequence in the target system, tasks of a lower priority may be interrupted by higher-priority tasks.
3 Set cycle time in test.con
In the following video "test.con 6 part 1: Program the real-time kernel of the Q.station" you can see how to set the cycle time over test.commander.
- Structure of the Q.station (00:20)
- Adjust cycle time in test.commander (00:56)
- Introduction in test.con and the real-time application (01:13)
- Program real-time kernel (Example: Q.station and tweezers with strain gauge) (04:06)