The text of a spec sheet · part 2 of 2
DI135 (B&R 2003 Modules), pages 11 to 19
Pages 11 to 19 of 19
The original document is the PDF (612 KB). This is its text as extracted, unedited; tables and drawings read best in the PDF, and each page heading opens it at that page.
For the B & R Automation DI135
Page 11
Normal Reference Pulse: Path/state and timing diagrams for incremental encoder operation are shown for the NC161 encoder module. These diagrams are also valid for the DI135. Bit 0 in Data Word 0 is always 1 when the level of the reference enable switch is 0. Bit 0 only takes the level of the reference pulse when the level of the reference enable switch is 1. Bit 0 = Input 3 or (not Input 4) Input 3 Reference Pulse
Input 4 Reference Enable Switch
Bit 0 Data Word 0
0
0
1
1
0
1
0
1
0
1
1
1
Inverted Reference Pulse: Bit 0 in data word 0 is always 1 when the level of the reference enable switch is 0. Bit 0 only takes the level of the inverted reference pulse when the state of the reference enable switch is 1. Bit 0 = (not Input 3) or (not Input 4)
150
Input 3 Reference Pulse
Input 4 Reference Enable Switch
Bit 0 Data Word 0
0
0
1
1
0
1
0
1
1
1
1
0
DI135
Chapter 3
Page 12
Data Word 1 (read) Counter Value MSW Data Word 2 (read) Counter Value LSW Configuration Words 4+5 (read) After setting bit 11 in configuration word 8, the configuration words receive the latched counter value with the first positive edge of the reference enable switch. The value is valid if bit 11 is set in data word 0. Please refer to the timing diagram "Latching the Counter Value" in section "NC161".
Chapter 3 B&R 2003 Modules
Configuration Words 4+5 (write) Threshold value 1 (32 Bit) Threshold value 1 must always be ≤ threshold value 2 . Threshold values are internally arranged in increasing order including sign. Configuration Words 6+7 (read) After setting bit 10 in configuration word 8, the configuration words receive the latched counter value with the first negative edge of the reference enable switch. The value is valid if bit 10 is set in data word 0. Please refer to the timing diagram "Latching the Counter Value" in section "NC161". Configuration Words 6+7 (write) Threshold value 2 (32 Bit)
B&R 2003 Modules
DI135
151
Page 13
Configuration Word 8 (write) Incremental encoders and comparators are configured using configuration word 8. Bit 12 - 15
Description 0
11
0 ... Counter reading cannot be taken 1 ... Counter reading taken when the first positive edge arrives from the reference enable switch (see configuration words 4 and 5)1)
10
0 ... Counter reading cannot be taken 1 ... Counter reading taken when the first negative edge arrives from the reference enable switch (see configuration words 6 and 7) 1)
5-9 4
0 0 ... No effect on counter 1
Counter reset (referenced) The counter will be reset depending on the controller signal in configuration word 14 when positive edge of bit4 arrives. Bit 4 must then be reset and set again before a new reference can be taken.
3
0 ... Comparator off The comparator output will be set to level defined in bit 0. 1 ... Comparator on
2
0 ... Comparator output unconditional The comparator output will be set to the level defined in Bit 0, if Threshold Value 1 < Counter≤ Threshold Value 2 1 ... Comparator output conditional Reference enable switch = 1 The comparator output will be treated as "comparator output unconditional". Reference enable switch = 0 The compatator output will be set to the level defined in bit 0.
0 0 0 0 15
1)
0 0 0 0 0 8 7
1
0
0
Level of comparator output
0 0
The counter value is only taken once. Bit 10 and bit 11 must be reset for the value to be taken again. Bit 10 and bit 11 can be set again in configuration word 8 after the corresponding bit in the module status bit has gone to 0.
Configuration Word 12 (read) Configuration word 12 contains the module status (current status unlatched). The module status is written to data word 0.
+D=FJAH !
Page 14
Configuration Word 14 (read) The High Byte of configuration word 14 defines the module code. Bit
Description
8 - 15
Module code = $12
0-7 x.... Not defined, masked out
0 0 0 1 0 0 1 0 x x x x x x x x 15
8 7
0
Configuration Word 14 (write) The module is configured using configuration word 14.
12 6 - 11 5 3-4
Description
Chapter 3 B&R 2003 Modules
Bit 13 - 15
0 0 ... Incremental encoder operation 1 ... Event counter operation 0 0 ... No influence on counter direction 1 ... Reversed counter direction 0
2
0 ... No influence on reference pulse 1 ... Reference pulse is inverted. This change is used for encoders with high pulses.
1
0 ... Counter set immediately to 0. In data word 0 (module status), bit 7 is set directly to1 and the counter reset. 1 ... Counter continues to function. In data word 0 (module status) bit 7 is set directly to 0 (limited reference). If the reference pulse is recorded, bit 7 in data word 0 will be set to 1 depending on the status of bit 0 in configuration word 14, and reset again with a positive edge in configuration 14.
0
0 ... Reference enable switch ignored (referenced with reference pulse) 1 ... Reference enable switch activated (reference pulse and reference enable switch)
0 0 0 0 0 0 0 0 0 0 15
8 7
0 0 0
Path/state and timing diagrams for incremental encoder operation are shown for the NC161 encoder module. These diagrams are also valid for the DI135.
B&R 2003 Modules
DI135
153
Page 15
7.6.10 Variable Declaration for Event Counter Operation The variable declaration is valid for the following controllers: •
2003 PCC CPU
•
Remote I/O Bus Controller
•
CAN Bus Controller
The variable declaration is made in PG2000. The variable declaration is described in Chapter 4, "Module Addressing". Automation Studio™ Support:
See Automation Studio™ Help starting with V 1.40
Accessing screw-in modules is also explained in the sections "AF101" and "CPU". Event Counter Operation Data access takes place using data and configuration words. The following table provides an overview of which data and configuration words are used for this module. Data Access
VD Data Type
VD Module Type
VD Chan.
R
W
Data word 0
WORD
Transp. In
0
●
Counter value of counter 2
Data word 1
WORD
Transp. In
2
●
Counter value of counter 1
Data word 2
WORD
Transp. In
4
●
Module status
Configuration word 4
WORD
Transp. In
8
●
Counter value of counter 1 at positive edge of the reference enable switch
Configuration word 5
WORD
Transp. In
10
●
Counter value of counter 2 at positive edge of the reference enable switch ●
Description
WORD
Transp. Out
10
Configuration word 6
WORD
Transp. In
12
●
Threshold value 1 for counter 2 Counter value of counter 1 at negative edge of the reference enable switch
Configuration word 7
WORD
Transp. In
14
●
Counter value of counter 2 at negative edge of the reference enable switch
WORD
Transp. Out
14
●
Threshold value 2 for counter 2
Configuration word 8
WORD
Transp. Out
16
●
Counter / comparator control
Configuration word 12
WORD
Transp. In
24
●
Configuration word 14
WORD
Transp. In
28
●
WORD
Transp. Out
28
154
Module status Module type ●
DI135
Module configuration
Chapter 3
Page 16
Access using CAN Identifiers Access via CAN Identifiers is used if the slave is being controlled by a device from another manufacturer. Access via CAN Identifiers is described in an example in Chapter 4, "Module Addressing". The transfer modes are explained in Chapter 5, "CAN Bus Controller Functions". Data cannot be packed on the DI135. Therefore one CAN object is transferred per screw-in module. If an adapter module AF101 is equipped with a four DI135 modules, the CAN object has the following structure: CAN ID
1
542
Counter 2L
Word 1 Counter 2H
Counter 1L
Word 2 Counter 1H
Status L
Word 3 Status H
Word 4 free
2
543
Counter 2L
Counter 2H
Counter 1L
Counter 1H
Status L
Status H free
3
544
Counter 2L
Counter 2H
Counter 1L
Counter 1H
Status L
Status H free
4
545
Counter 2L
Counter 2H
Counter 1L
Counter 1H
Status L
Status H free
CAN ID = 542 + (nd - 1) x 16 + (ma - 1) x 4 + (sl - 1) nd ..... Node number of the CAN slave = 1 ma .... Module address of the AF101 = 1 sl ....... Slot number of the screw-in module on the AF101 (1 - 4)
B&R 2000 users have to exchange the data so that the high data is first (Motorola format)! For more information on ID allocation, see Chapter 5, "CAN Bus Controller Functions". Description of Data and Configuration Words Data Word 0 (read) Counter value of counter 2. Data Word 1 (read) Counter value of counter 1.
B&R 2003 Modules
DI135
155
Chapter 3 B&R 2003 Modules
1)
1)
Slot
Page 17
Data Word 2 (read) Data word 2 includes the module status time constant for both counter values. Bit 12 - 15
0 ....Counter status not accepted 1 ....Counter status when the first positive edge of the reference enable switch arrives.
10
0 ....Counter status not accepted 1 ....Counter status when the first negative edge of the reference enable switch arrives.
5 x x x x x ....Not defined, masked out
11
6-9
15
Description x ....Not defined, masked out 0 ....Comparator output: no error 1 ....Comparator output: Overload error indicated.
4
Output status of the comparator
3
Level encoder input A: Counter 1
2
Level encoder input B: Counter 2
1
Level of the reference enable switch
0
Level of reference pulses x x x x 8 7
0
Configuration Word 4 (read) After setting bit 11 in configuration word 8, the configuration word receives the latched counter value of counter 1 with the first positive edge of the reference enable switch. The value is valid if bit 11 is set in data word 2. Please refer to the timing diagram "Latching the Counter Value" in section "NC161". Configuration Word 5 (read) After setting bit 11 in configuration word 8, the configuration word receives the latched counter value of counter 2 with the first positive edge of the reference enable switch. The value is valid if bit 11 is set in data word 2. Please refer to the timing diagram "Latching the Counter Value" in section "NC161". Configuration Word 5 (write) Threshold value 1 (16 Bit) for counter 2. Threshold value 1 must always be ≤ threshold value 2 . Threshold values are internally arranged in increasing order. Configuration Word 6 (read) After setting bit 10 in configuration word 8, the configuration word receives the latched counter value of counter 1 with the first negative edge of the reference enable switch. The value is valid if bit 10 is set in data word 2. Please refer to the timing diagram "Latching the Counter Value" in section "NC161".
+D=FJAH !
Page 18
Configuration Word 7 (read) After setting bit 10 in configuration word 8, the configuration word receives the latched counter value of counter 2 with the first negative edge of the reference enable switch. The value is valid if bit 10 is set in data word 2. Please refer to the timing diagram "Latching the Counter Value" in section "NC161". Configuration Word 7 (write) Threshold value 2 (16 Bit) for counter 2. Configuration Word 8 (write) Event counters and comparators are configured using configuration word 8. Description
Chapter 3 B&R 2003 Modules
Bit 12 - 15
0
11
0 ....Counter reading cannot be taken 1 ....Counter reading taken when the first positive edge arrives from the reference enable switch (see configuration words 4 and 5)
10
0 ....Counter reading cannot be taken 1 ....Counter reading taken when the first negative edge arrives from the reference enable switch (see configuration words 6 and 7)
6-9
0
5
0 ....No effect on counter 2 1 ....Reset counter 2 immediately
4
0 ....No effect on counter 1 1 ....reset counter 1 immediately
3
0 ....Comparator off The comparator output will be set to level defined in bit 0. 1 ....Comparator on
2
0 ....Comparator output unconditional The comparator output will be set to the level defined in Bit 0, if Threshold Value 1 < Counter≤ Threshold Value 2 1 ....Comparator output conditional Reference enable switch = 1 The comparator output will be treated as "comparator output unconditional". Reference enable switch = 0 The compatator output will be set to the level defined in bit 0.
0 0 0 0 15
0 0 0 0 8 7
B&R 2003 Modules
1
0
0
Level of the comparator output
0 0
DI135
157
Page 19
Configuration Word 12 (read) Configuration word 12 contains the module status (current status unlatched). The module status is written to data word 0. Configuration Word 14 (read) The High Byte of configuration word 14 defines the module code. Bit
Description
8 - 15
Module code = $12
0-7 x ....Not defined, masked out
0 0 0 1 0 0 1 0 x x x x x x x x 15
8 7
0
Configuration Word 14 (write) The module is configured using configuration word 14. Bit 13 - 15 12 6 - 11 5
15
8 7
0
0 0.... Encoder operation 1.... Event counter 0 0.... Normal count direction 1.... Reverse count direction
4
0
3
0.... Only count positive edges 1.... Count both edges
0-2 0 0 0 1 0 0 0 0 0 0
Description
0
0 0 0 0
+D=FJAH !