Configuring the Module DC541-CM for Use as X4-Counting Device¶
The DC541 supports an encoder counting mode with channels A/B. This counting mode usually just supports to count 1 edge out of possible 4 edges from the 2 encoder lines. These are connected to C0 and C1 on DC541 module.
Counting in X1-mode | |
Counting in X4-mode |
For increasing the accuracy, it is possible to use a special mode with counting all 4 edges. This mode just supports a frequency up to 4 kHz. Despite of counting 4 edges on a lower frequency, the functionality is the same as 32 bit encoder on channel 0 and 1 and also the same Function Block DC541_32BIT_CNT DC541_32BIT_CNT has to be used. The configuration is different and looks as follows:
How to add the device in the PLC configuration is described in the chapter before (see Configuring the module DC541 Configuring the Module DC541-CM).
The next step is to set the operating mode of the device. To do so, position the cursor on the entry of the device DC541-CM, right click to open the context menu and then select the function Append Device:
Select “DC541 Encode X4 mode” to configure the device.
The channels C0..C3 are to be used for the encoder mode. In the module parameters, the channels C4..C7 can be configured as:
Input | -Input |
Output | -Output |
To do so, select the corresponding value for each channel.
Note
Note: The channels C1..C3 are automatically used, too. In the PLC configuration, these channels are left at the default setting “Input”.
The specified configuration can be read using the Function Block DC541_GET_CFG DC541_GET_CFG.