7 APPLICATION INSTRUCTION
7.14 Pulse related instruction
509
7
Measuring the density of 32 bit binary pulses
DSPD
This instruction counts the number of times the device input specified by (s1) turns off on only for the time (in 32-bit data
units) specified by (s2) 1ms and stores the operation result in the device specified by (d).
■Descriptions, ranges, and data types
■Applicable devices
*1 When a bit device is specified, specify one of X0 to X17.
Only X can be used for a bit device.
The nibble of a bit device cannot be specified.
*2 When a word device is specified, specify one of the channel numbers (CH1 to CH8).
• This instruction counts the number of times the device input specified by (s1) turns off on only for the time (in 32-bit data
units) specified by (s2) 1ms and stores the operation result in the device specified by (d).
• The channel number of the high-speed counter specified by (s1) interlocks with the channel number in which parameters
are set.
• When a word device is specified by (s1), this instruction counts the number of pulses by the high-speed counter setting of
the channel number corresponding to each word device.
Ladder diagram Structured text
ENO:=DSPD(EN,s1,s2,d);
Operand Description Range Data type Data type (label)
(s1) Pulse input Bit/32-bit unsigned
binary
Bit/ANY32
(s2) Measurement time (Unit: ms) -2147483648 to
+2147483647
32-bit signed binary ANY32
(d) Head device number for storing the measurement result 32-bit signed binary ANY32
Operand Bit Word Double word Indirect
specification
Constant Others
X, Y, M, L,
SM, F, B, SB
U\G T, ST,
C, LC
T, ST, C, D,
W, SD, SW, R
U\G Z LC LZ K, H E $
(s1)
*1
*2
(s2)
(d)
ON
OFF
OFF
(s2)+1,(s2)ms (s2)+1,(s2)ms
ON
(s1)
Counting start
The elapsed time is judged using
the 1ms interrupt and the counted
result is stored in (d)+1 and (d).
The elapsed time is judged using
the 1ms interrupt and the counted
result is stored in (d)+1 and (d).
Execution
command