| Contents | Index |
xPC Target Library for ADDI-DATA
A function module is individually programmable with different firmware. You do this 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 are not programmed with the incremental encoder firmware, you must invoke SET1710 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 indicated in the ADDI-DATA user manual. Use SET1710 to download the incremental encoder firmware onto the required function module. After this step, you can remove the board and plug it 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 connect the encoders to the board.
From the list select 1, 2, 3, or 4. This field specifies the function module (counter) to be used for this block. It must be programmed with the incremental encoder firmware. Two blocks for the same board cannot have the same module (channel) specified.
From the list select the type of counter evaluation as either
Virtual Absolute — Gets 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 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 if the encoder is turned multiple times. The second output can be used for controlling or switching different Simulink submodels.
Reset and Index Output Up-Dating — Gets the counter value in the range of 0 to 2π or −π to +π, where the counter is reset every time the reference point is reached. The first output of the block outputs the 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 incremented or decremented by the value 1. In other words the second output outputs the actual number of turns n because 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 multiturn angle, even if the counter is reset periodically.
From the list, choose single, double, or quadruple. This parameter specifies the phase detection mode, that is, how many phase changes of the specified module are detected (see the APC1-1710 manual).
From the list choose either off or on. The Hysteresis parameter specifies whether a counter should skip a tick if the direction changes (see the APC1-1700 manual).
Specifies the resolution of the connected incremental encoder for one revolution.
Model base sample time or a multiple of the base sample time.
If only one board of this type is in the target PC, enter
-1
to automatically locate the board.
If two or more boards of this type are 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
getxpcpci

Learn more about Simulink through this collection of videos, articles, technical literature and the Getting Started with Simulink Guide.
| © 1984-2012- The MathWorks, Inc. - Site Help - Patents - Trademarks - Privacy Policy - Preventing Piracy - RSS |