xPC Target | ![]() ![]() |
A function module is individually programmable with different firmware. This is done by using the ADDI-DATA utility SET1710. This driver supports the APCI-1710 if the specified function module is programmed with the incremental encoder firmware.
If the board and its specific module is not programmed with the incremental encoder firmware, SET1710 has to be invoked before the driver can be used within an xPC Target application. In this case, plug the board into a PC running Microsoft Windows and install the board as it is indicated in the ADDI-DATA user manual. Use SET1710 to download the incremental encoder firmware onto the appropriate function module residentially. After this step the board can be removed and be plugged into the target PC.
This driver block has two block outputs. The values output depend on the value of the Type of Evaluation parameter. See below for further information. Refer to the APCI-1710-manual for information on how to electrically connect the encoders to the board.
Driver Block Parameters
Function Module -- From the list select 1
, 2
, 3
, or 4
. This field specifies which function module (counter) is used for this block. It has to be programmed with the incremental encoder firmware. For the same board two blocks cannot have the same module (channel) specified.
Type of Evaluation -- From the list select the type of counter evaluation as either Virtual Absolute
or Reset and Index Output Up-Dating
.
Choosing Virtual Absolute
allows to get the counter value as an absolute value after the reference point of the encoder has been reached for the first time. The first output of the block outputs the actual absolute angle of the connected encoder in radians. As long as the reference point has not been reached for the first time, the second block output is zero. If the reference point is reached for the first time and only for the first time the corresponding counter is reset to zero and the second output goes to 1. From then on the output 1 outputs an absolute angle even in the case the encoder is turned multiple times. The second output can be used for controlling or switching different Simulink submodels.
Choosing Reset
and Index Output Up-Dating
allows to get the counter value in the range of 0..2*pi or -pi..+pi where the counter is reset every time the reference point is reached. The first output of the block outputs the actual angle of the connected encoder in radian. As long as the reference point has not been reached for the first time, the second block output is zero. Every time the reference point is reached the counter is reset to zero and depending on the direction of the encoder at this event the output value is either incriminated or decremented by the value 1. In other words the second output outputs the actual number of turns n since the reference point has been reached for the first time. If the second output is multiplied by 2*pi and added to the value of the first output you get an absolute multi-turn angle, even if the counter is reset periodically.
Mode -- From the list, choose single
, double
, or quadruple
. This parameter specifies the phase detection mode i.e. how many phase-changes are detected of the specified module (see the APC1-1710-manual).
Hystheresis -- From the list choose either off
or on
. The Hystheresis parameter specifies if a counter should skip a tick if the direction changes (see the APC1-1700 manual).
Resolution -- This field specifies the resolution of the connected incremental encoder for one revolution.
Sample time -- Model base sample time or a multiple of the base sample time.
PCI Slot (-1:autosearch) -- Enter a number between -1 and n. If only one board of this type is physically present in the target PC, enter
If two or more boards of this type are physically present in the target PC, enter the bus number and the PCI slot number of the board associated with this driver block. Use the format [BusNumber
, SlotNumber
]. To determine the bus number and the PCI slot number, type
![]() | APCI-1710 | PA-1700 | ![]() |