This example shows how to fire a barcode like pattern, configured in Fifo mode. The Pulsing Unit is documented in AN152.
- The program doesn't depend on a specific axis unit, nevertheless it is designed for the example in mm.
- The start position of the barcode is at 20mm.
- The peripheral system is triggered with a pulse ON-time of 10us.
- The gaps are pulsed with an ON-time of 0 seconds, which results in no pulse output.
The whole pattern consists of 2 rows with 5 sequences each. The second row is fired in reverse direction.
Axis_0 needs to be enabled to run this example
- Set the
PU_ReferencePosition = 20
, defining the start position of the first row. - Activate the Pulsing Unit by setting the
PU_Mode = Fifo
. - Fill in the first row by pushing each sequence to the FIFO with the command
PU_FIFO = Append
.
Sequence | 1 | 2 | 3 | 4 | 5 |
---|---|---|---|---|---|
PU_PulseWidth | 0.00001 | 0 | 0.00001 | 0 | 0.00001 |
PU_DeltaPosition | 0.1 | 0.1 | 0.1 | 0.1 | 0.1 |
PU_Count | 8 | 13 | 21 | 26 | 31 |
- Now the row is fired by moving the axis left to right (positive direction).
- As soon as the first row is fired (check for
PU_Count == PU_ActualPulseCount
), a move with an other axis can be commanded to align to the next row. - Set a new reference position with the following steps.
- Disable the mode by setting
PU_Mode = Disabled
. - Set the new start position for row 2 with
PU_ReferencePosition = 20.3
. - In the next cycle, activate the Pulsing Unit by setting the
PU_Mode = Fifo
.
- Disable the mode by setting
- Fill in the second row by pushing each sequence to the FIFO with the command
PU_FIFO = Append
. The sequence index restarts at 1 because the mode was reset.
Sequence | 1 | 2 | 3 | 4 | 5 |
---|---|---|---|---|---|
PU_PulseWidth | 0.00001 | 0 | 0.00001 | 0 | 0.00001 |
PU_DeltaPosition | -0.1 | -0.1 | -0.1 | -0.1 | -0.1 |
PU_Count | 5 | 10 | 18 | 23 | 31 |
- Now the second row is fired by moving the axis right to left (negative direction).