Examples and register assignments
4.3 Registers
SIMATIC PCIe DIO4
Compact Operating Instructions, 11/2011, A5E03493449-01
29
CxTR1: Counter 0 Trigger Register 1 (BASE + (x*0x100))
If the trigger is enabled, the counter is decremented, see description CxTR0.
CxTR2: Counter 0 Trigger Register 2 (BASE + (x*0x100))
If the trigger is enabled, the counter 0 is deleted, see description CxTR0.
CxTR3: Counter 0 Trigger Register 3 (BASE + (x*0x100))
If the reload trigger is enabled, the counter is described with the value of CxRELR, see
description CxTR0.
CxTR4: Counter 0 Trigger Register 4 (BASE + (x*0x100))
If the capture trigger is enabled, the current counter value of the counter is written to the
capture register CxCAPR, see description CxTR0.
Counter trigger sources
Value (decimal)
Signal
0
0
1
1
2
Reading DIO
3
Writing DIO
4
DIO Interrupt (GSR.IF)
5-7
Reserved
8/12/16/20/24/28/32/36
Counter x Overflow
9/13/17/21/25/29/33/37
Counter x Comparison "equal to" (CxSR.CE)
10/14/18/22/26/30/34/38
Counter x Comparison "greater than" (CxSR.CE)
11/15/19/23/27/31/35/39
Counter x Comparison "less than" (CxSR.CE)
40-43
Input 0-3 (INP 0..3)
44-47
Output 0-3 (OUTP 0..3)
48-63
Reserved
You should calculate the values for the index of input, output and counter according to the
following formula:
Counter x index
Index = 8 + x*4
Input x index
Index = 8 + VER.NRCT*4 + x
Output x index
Index = 8 + VER.NRCT*4 + VER.NRIP + x
CxCOMR: Counter x Compare Register (BASE + (x*0x100))
Bit
Access Name
Default Description
35..0
RW
CMP
0
Compare value