An Example of using the Internal and External Preset

An Example of using the Internal and External Preset

The following example uses 1 Phase 2 Multiplication (High Active) and Linear Counter. After reaching a certain value by decremental count from 0, internal and external preset will be used to continue the decremental count.

*Internal Preset: When the count decreases from 0 to -25, the count continues to decrease from 50,000.
*External Preset: When the external preset is applied to the current value at any point, the count begins to decrease from 60,000.

Wiring Diagram
The wiring diagram is the same as that of 1.6.1 ‘Linear Counter Example.’

High Speed Counter Program Configuration
Configure ‘M100’ for Start Address (You can enter a desired address), Channel as ‘1’
Check [Enable Count] and [Enable External Preset] for the Channel Configuration.
Select ‘Linear Counter’ for the Count Mode and ‘1 Phase 2 Multiplication (High Active)’ for the Input Pulse Type.
Enter 50,000 for Internal Preset Value and 60,000 for External Preset Value.
Enter ‘1000’ for Unit Time (mSec) and Pulse per 1 Cycle.

 

image-20240326-071608.png

 

Write a Scan Program
Write the scan program as shown below.

 

image-20240326-071612.png

 

Enable Linear Counter Low Active increasing count signal. *F90: 0.02 seconds
Configure the initial value of the memory.
When the current count value (M310) is higher than 1,000, the device M256 will be SET.
When the current count value is less than 1,000, PPS will be displayed.
When the current count value exceeds 1,000, RPM will be displayed.

Check the operation
When the current count value is -25, the decremental count begins.

 

 

When the external preset is applied to the current value at any point, the count begins to decrease from 60,000.