Chapter 16 PLC Function ApplicationsMS300 (High Speed Model)
16-102
16-9 Count function using pulse input
16-9-1 High-speed count function
The MS300's MI7 supports one-way pulse counting, and the maximum speed is 33K. The starting
method is very simple, and only requires setting M1038 to begin counting. The 32 bit count value is
stored on D1054 and D1055 in non-numerical form. M1039 can reset the count value to 0.
Current count value
of MI8(H word)
※ When the PLC program defines MI7 for use as a high-speed counter, and also for use in PLC
procedures, it must be written to M1038 or M1039, and the original MI8 functions will be disabled.
16-9-2 Frequency calculation function
Apart from high-speed counting, the MS300's MI7 can also convert a received pulse to frequency.
The following figure shows that there is no conflict between frequency conversion and count
calculations, which can be performed simultaneously.
PLC speed calculation formula
D1056 MI7 Corresponding speed
D1057 Speed ratio (pulse number divided by frequency)
D1058 Interval between calculations
D1059 Decimal places
Assuming that there are 5 input pulses each second, (see figure below) we set D1058=1000 ms=1.0
sec. as the calculation interval. This enables five pulses to be sent to the drive each second.
Assuming that each 5 pulses correspond to 1Hz, we set D1057=5.
Assuming that we wish to display numbers to two decimal places, we set D1059=2, which is also
1.00Hz. The numerical value displayed at D1056 is 100. For simplicity, the D1059 conversion formula
can be expressed as in the following table: