Chapter 16 PLC Function ApplicationsMS300
765
16-9 Count Function Using Pulse Input
16-9-1 High-speed count function
The MS300's MI7 supports one-way pulse counting with a maximum speed of 33 k. The starting
method is very simple, and only requires setting M1038 to begin counting. The 32-bit count value is
stored in D1054 and D1055 in non-numerical form. M1039 resets the count value to 0.
NOTE: When the PLC program defines MI7 for use as a high-speed counter, that is, when M1038 or
M1039 is written in PLC procedures, other functions of MI7 are disabled.
16-9-2 Frequency calculation function
Apart from high-speed counting, the MS300's MI7 can also convert a received pulse to a frequency.
The following figure shows that there is no conflict between frequency conversion and count
calculations, which the MS300 can perform simultaneously.
PLC speed calculation formula
D1057 Speed
D1058 Interval between calculations
D1059 Decimal places
Assume that there are five input pulses each second, (see figure below) we set D1058 = 1000 ms =
1.0 second as the calculation interval. This enables five pulses to be sent to the drive each second.
Assume that each five pulses correspond to 1 Hz, we set D1057 = 5.
Setting D1059 = 2 displays numbers to two decimal places, which is also 1.00 Hz. The numerical
value displayed at D1056 is 100. For simplicity, the D1059 conversion formula can be expressed in
the following formula: