Schneider Electric TSXCCM100 Rapid counting module User Guide
Publicitate
Publicitate
X
Preface
The TSX CCM 100 module is a development of the TSX CTM 100 module.
In addition to the 5 functions available in the TSX CTM 100 module:
• Counter,
• Up/Down counter,
• Timer,
• Position Measurement,
• Tachometer, the TSX CCM 100 module proposes a sixth function:
• Electronic cam, which is equivalent to a cam mechanism with 4 cams and 16 thresholds.
The TSX CCM 100 module is wholly compatible with all the applications previously developed for a TSX CTM 100 module. That is to say that all applications that can be executed on a TSX CTM 100 module can also be executed, without any modification, on a TSX CCM 100 module.
The locating device code number (730) is common to both modules, which allows a
TSX CTM 100 module to be replaced in the PLC configuration by a TSX CCM 100 module without causing any problems.
Important Note
The parts of this manual that deal with the electronic cam function of the TSX CCM 100 module are identified by a ● .
2
Introduction
1.2 Physical Description ●
Operation
2.3 Counting Principle ●
2.4 Sub-functions ●
Configuration
3.2 Configuration Parameters ●
Functions
4.6 Electronic Cam Function ●
Programming
5.2 Programming Examples ●
23
24
26
33
34
37
40
43
46
49
53
54
56
68
Page
5
6
9
11
12
13
15
16
X
Installation and Wiring
Specifications
Appendix
Contents
Page
77
78
79
80
89
92
93
94
85
86
86
88
3
4
Xx _________________________________________________________
Introduction 1
Introduction Section 1
___________________________________________________________________________________________
___________________________________________________________________________________________
1.1
General Description
1.1-1 General
1.1-2 Functions
1.2
Physical Description
Page
6
6
7
9
___________________________________________________________________________________________
5
___________________________________________________________________________________________
1.1
General Description
___________________________________________________________________________________________
1.1-1 General
The TSX CCM 100 multifunction rapid counting module is an intelligent module that is capable of performing predefined data processing functions and making decisions according to the information received.
It is designed for use in all TSX Series 7 PLCs (except the TSX 47-10) for applications that require rapid counting functions (up to 40 KHz) such as the counting of parts or events, or the measurement of lengths, speeds, times, etc.
After the module has been initialized and received its parameters, it can operate completely independently of the user program in the PLC.
However, where necessary, the operation of the module can be synchronized with the execution of the user program by means of:
• The Register interface, which exchanges input words (IW) and output words (OW) with the CPU on each cycle of the task in which the module is configured,
• The generation of Interrupts (IT) to the CPU, which have the effect of jumping the scan to the Interrupt task, which has the highest priority.
The TSX CCM 100 incorporates the following functions:
• Counter function,
• Up/Down counter function,
• Timer function,
• Position measurement function,
• Tachometer function.
• Electronic cam function •.
Counting inputs
Validation
In0
In1
In2
Preset
Capture
In3
In4
➤ ▲
Selection by configuration
Counter Up/Down counter
Timer Pos.
meas.
Tachometer
Electr.
cam
▲
▲
➤
Preset
▲
Current value
Capture
▲ ▲
Dialogue with the CPU
4 transistor outputs
O.0
O.1
0.2
O.3
➤
Comparison with thresholds
___________________________________________________________________________________________
6
Introduction 1
___________________________________________________________________________________________
1.1-2 Functions
Counter function
This function counts input pulses at a rate of up to 40 KHz and stores the count in single length (16 bit) or double length (32 bit) values.
For this function the module uses:
• 1 input channel (5/24 V),
• 3 inputs acting directly on the counting system:
- validation of counting,
- capture (24 V),
- preset (24 V).
Counting of pulses
These last three operations can also be triggered by the CPU.
• 4 transistor outputs (24VDC - 300 mA) whose states are determined by the position of the current or captured value in relation to the two thresholds defined by the user program.
This function can also be configured to include the modulo and hysteresis sub-functions.
Up/Down counter function
This function upcounts and downcounts input pulses at a rate of up to 40 KHz in 3 different modes and stores the result in single or double length values.
For this function the module uses:
• 2 input channels (5/24 V),
• 3 inputs (as for the counter),
• 4 transistor outputs (as for the counter).
Up/down counting of pulses
Timer function
This function counts units of time and stores the count in single length values. The time base (10ms, 100ms, 1s, 10s) is defined during the configuration.
For this function the module uses:
• 3 inputs (as for the counter),
• 4 transistor outputs (as for the counter).
Unit of time
Counting of units of time
This function can also be configured to include the modulo sub-function, but not the hysteresis sub-function.
___________________________________________________________________________________________
7
___________________________________________________________________________________________
Position measurement function
This function counts the input pulses received from an encoder at up to 40 KHz and stores the count in single or double length values.
For this function the module uses:
• 2 input channels (5/24V).
Up/down counting of pulses
• 1 encoder zero mark input (5/24V) which, with the input below, establishes the reference point.
• 1 reference point validation input (24 V) wired to a cam detector.
Zero mark
• 1 capture input (as for the counter).
• 4 transistor outputs (as for the counter).
Ref. point validation
The operations of establishing the reference point, capture and validation of counting can also be triggered by the CPU.
Tachometer function
This function:
• Counts the number of pulses received at up to 40 KHz and stores the count in single or double length values.
• Counts the number of pulses per unit of time and stores the result in single length values; the time base is selected during configuration.
For this function the module uses:
• 2 input channels (5/24V).
• 2 inputs acting directly on the counting system:
- validation of counting (5/24V),
- preset (24V), on the counting of the number of pulses only,
The operations of validation of counting and preset can also be triggered by the CPU. The capture function is not available.
• 4 transistor outputs (as for the counter).
Unit of time
Up/down counting of pulses per unit of time
This function can also be configured to include the modulo and hysteresis sub-functions, the modulo being associated with the counting of pulses only.
___________________________________________________________________________________________
8
Introduction 1
___________________________________________________________________________________________
Electronic cam function ●
This function simulates the operation of a cam mechanism with 4 cams and 16 thresholds.
The module ensures:
• The counting of the number of pulses, the field of evolution of the measurement being circular.
• The comparison of the measurement with predefined threshold values.
For this function the module uses :
• 2 input channels (5/24V),
• 3 inputs acting directly of the counting system (as for the counter),
• 4 transistor outputs (as for the counter).
___________________________________________________________________________________________________________________________
1.2
Physical Description
________________________________________________________________________________________
The TSX CCM 100 module can be installed in any TSX Series 7 PLC (except the TSX
47-10) equipped with the complete I/O bus.
On the front panel of the module are:
1 2 3 4
1 "F" (Fault) indicator light
(red = module fault)
2 "OK" indicator light
(green = normal operation)
3 Output O.0 status light
4 Output O.1 status light
5 Output O.2 status light
6 Input In0 status light
7 Input In1 status light
8 Input In2 status light
9 Input In3 status light
& Input In4 status light
é Connector for terminal block
TSX BLK 4.
OF
0K
O0
O1
O2
In0
In1
In2
In3
In4
5
6
7
8
9
10
Note
Output O.3 does not have an indicator light.
11
___________________________________________________________________________________________
9
___________________________________________________________________________________________
___________________________________________________________________________________________
10
X ________________________________________________________
Operation 2
Section 2
___________________________________________________________________________________________
2.1
Dialogue with the PLC
2.2
Operating Modes of the Module
2.3
Counting Principle
2.4
Sub-functions
2.4-1 General
2.4-2 Comparison
2.4-3 Output Assignments
2.4-4 Preset
2.4-5 Capture
2.4-6 Validation
2.4-7 Operation with Hysteresis
2.4-8 Operation with Modulo
2.4-9 Generation of Interrupts
Page
12
13
15
16
19
20
20
20
21
16
17
17
19
___________________________________________________________________________
11
___________________________________________________________________________
2.1
Dialogue with the PLC
General
The communication between the TSX CCM 100 and the user program in the PLC is established through:
• The Discrete interface (discrete I/O bits),
• The Register interface (input words IW and output words OW of 16 bits),
• The Message interface (tables of words of 16 bits),
• Interrupts (except for the TSX 47-20).
Discrete I/O bits I/Oxy,i
The TSX CCM 100 has a discrete interface similar to that of a discrete I/O module with
8 inputs and 8 outputs. The output bits are used by the CPU to initiate certain operations
(preset, capture, etc.). The input bits are used to control the states of the physical inputs and outputs of the module. These bits are updated on each scan cycle of the task in which the module is configured.
Register words IW/OWxy,i
The input register words are read-only words which give information concerning the operating status of the module. They contain, among other things, the image of the current count value and the captured count value.
The output register words are read/write words which permit the selection of the functional parameters of the module (selection of threshold values, preset values, etc.).
These words are exchanged with the CPU on each scan cycle of the task in which the module is configured (or on every second scan cycle in the case of the TSX 47-20).
Message interface
The message interface is used to exchange word tables between the user program and the module by means of Text function blocks. These Text blocks permit the writing of the configuration of the module by the user program and the execution of specific requests.
Interrupts
The module can be configured to generate interrupt commands to the CPU on the occurrence of certain preselected events. These interrupts have the effect of jumping the program scan to the Interrupt task (which has the highest priority), thus permitting a rapid, programmed response to the occurrence of an event.
___________________________________________________________________________________________
12
Operation 2
___________________________________________________________________________
Diagram of exchanges with the PLC
Zero mark or validation
Preset
Capture
Contactors
TSX CTM 100
In0
In1
In2
In3
U
T
S
I
N
P
In4
Selected preprogrammed function
O.0
O.1
O.2
O.3
T
S
O
U
T
P
U
Configuration
Ixy,8 to F Oxy,O to 7
CPU l T
Discrete interface
PLC program
8 output register words :
• OWxy,0 to
• OWxy,7
8 input register words :
• IWxy,0 to
• IWxy,7
Request interpreter
OW
Register interface
• • OWxy,z
IWxy,z • •
IW
Message interface
TXT
CPL
__________________________________________________________________________
2.2
Operating Modes of the Module
The TSX CCM 100 module has 4 operating modes as follows:
• Self-test,
• Not configured
• Stop mode,
• Run mode.
Configuration saved
Conf request OK
Init
DE-ENERGIZED
SELF-TEST
Configuration not saved
NOT CONF
Conf request OK
STOP
Conf request NOK
Run module
RUN
Module stop or fault
Conf request NOK
___________________________________________________________________________
13
___________________________________________________________________________
Self-test
The self-tests are executed each time the module is powered up; they monitor and indicate the internal faults of the module.
During the self-tests the outputs of the module are reset to 0.
If no faults have been detected at the end of the self-tests, the "OK" light comes on.
Not configured
If the module has not received the configuration information, operation of the module is impossible (the module does not have a configuration by default).
The "Not configured" state can also be caused by an incorrect configuration, an alteration of the contents of the module's memory, or by a failure of its back-up battery.
Stop mode
In the Stop mode, the module has been configured and assigned a function by the user, but certain functions are inactive; the operating status of the module is as follows:
• The pulses arriving on the input channels continue to be counted,
• The threshold comparison, preset and capture functions are inactive,
• The physical outputs are forced to 0,
• The interrupts are inhibited,
• The module can receive a new configuration.
Run mode
In the Run mode, the module has been configured and assigned a function and all its functions are active (counting of input pulses, threshold comparison, preset, activation of outputs, etc.).
The module can continue to operate in the Run mode even if there is a CPU failure or if the user program is stopped (see Section 5.3-2).
___________________________________________________________________________________________
14
Operation 2
___________________________________________________________________________
2.3
Counting Principle
The range within which the pulses are counted depends on the function selected.
Counter and Timer functions
➤
➤
Lower
➤
- 32 768
- 2 147 483 648 or
Counting overflow
Range limits
➤ ➤
Intermediate
➤
Thresh. 0
➤
Higher
➤
➤
Tresh. 1 + 32 767
+ 2 147 483 647 or
In the Timer function, the count is stored in single length values only.
Up/Down counter and Position measurement functions
Downcounting overflow
➤
Range limits
➤
Lower
➤ ➤
Intermediate
➤ ➤
Higher
➤
Upcounting overflow
➤
➤
- 32 768
- 2 147 483 648 or Tresh. 0 Tresh. 1 + 32 767
+ 2 147 483 647 or
➤
Tachometer function
➤
Space not used
➤ ➤
➤
- 32 768 0
➤
Lower
Range limits
➤ ➤
Intermediate
Tresh. 0
➤ ➤
Tresh. 1
Higher
➤
➤
Overflow of
No. of pulses per unit of time
+ 32 767
The Tachometer function counts the number of pulses and calculates the speed
(expressed as a single length value) according to the number of pulses counted during the unit of time, i.e. the time base defined during configuration.
Electronic cam function •
➤
0 Threshold 1 Threshold 3
Threshold 2 Threshold 4
Modulo-1
➤
___________________________________________________________________________
15
___________________________________________________________________________
Associated bits
• IWxy,1,0 : Indicates the direction of the count:
State 1 : incrementing,
State 0 : decrementing.
• IWxy,1,3 : At state 1, indicates an overflow of the resources of the selected
function (see Section 5.3-2),
• Oxy,7 : Fault acknowledgement command (active on a rising edge).
The fault must be acknowledged after it has disappeared.
After acknowledgement of a counting overflow, the user must correct the current value by setting it to a value that is within the limits of the range. For example by effecting a preset to the value 0.
________________________________________________________________________
2.4
Sub-functions
2.4-1 General
In each of its functions, the TSX CCM 100 module has the following sub-functions:
• Comparison of the current value, the captured value or the number of pulses per unit of time, with 2 dynamic thresholds (1),
• Assignment of the physical outputs,
• Preset,
• Capture,
• Validation of the counting pulses,
• Operation with hysteresis,
• Operation with modulo,
• Choice of the sources of interrupts (see Section 5.3-1).
_____________________________________________________________________
2.4-2 Comparison
This function permits:
• The definition of 2 thresholds (1) written by the user program and stored in two single or double length register words,
• The comparison of the threshold values with the current value, the captured value or the number of pulses per unit of time and, according to the result, the control of the physical outputs according to a predefined matrix (see below) and the generation of interrupts. These selections are made during the configuration of the module.
_________
(1) 16 fixed thresholds in the case of the electronic cam function.
___________________________________________________________________________________________
16
Operation 2
___________________________________________________________________________
2.4-3 Output assignments
The physical outputs are assigned according to a matrix written by the user program in the register word OWxy,7 (except in the electronic cam function).
This matrix must be updated by the program at the same time as the thresholds in order to ensure the coherence of the threshold values and the assignment of the outputs.
Output matrix
Count/Threshold Count < Th0 and comparison Count < Th1
(IWxy,1,4 = 1)
State of O.0
OWxy,7,8 = x
State of O.1
State of O.2
State of O.3
OWxy,7,9 = x
OWxy,7,A = x
OWxy,7,B = x
Count
≥
Th0 and < Th1 or
Count
≥
Th1 and < Th0
(IWxy,1,5 = 1)
OWxy, 7,4 = x
OWxy, 7,5 = x
OWxy, 7,6 = x
OWxy, 7,7 = x
Count
≥
Th1 and
Count
≥
Th0
(IWxy,1,6 = 1)
OWxy, 7,0 = x
OWxy, 7,1 = x
OWxy, 7,2 = x
OWxy, 7,3 = x
Bit x = 1 : output at state 1.
Bit x = 0 : output at state 0.
The following 3 bits of the register word give the user the result of the comparison:
• IWxy,1,4 = 1 : Count value less than both thresholds.
• IWxy,1,5 = 1 : Count value between the two thresholds.
• IWxy,1,6 = 1 : Count value more than both thresholds.
Case of the electronic cam function ●
An output matrix is associated with each of the 16 thresholds. These matrices are defined in the Configuration mode at the same time as the threshold values.
The nibble [IWxy,1,7 to IWxy,1,4] indicates the number of the threshold immediately below the count value.
To permit the outputs to adopt the states defined by the matrix, the following bits must be controlled by the user program:
• Oxy,3 - output validation command,
- State 0 : outputs frozen in their existing states,
- State 1 : output states determined by the matrix.
Note
This bit must be controlled only if validation of the physical output states has been requested in the configuration (VAL OUT bit = 1 - see Section 3.2).
___________________________________________________________________________
17
___________________________________________________________________________
• Oxy,4 - output forcing command,
- State 0 : output states determined by the matrix,
- State 1 : outputs forced to the states defined by the nibble FORCING in the table of configuration parameters (see Section 3.2).
• OWxy,0,F - physical output reset command,
- State 1 : resets the physical outputs of the module to 0.
The module can also be configured so that it continues to operate even if there is a counting overflow or CPU failure. In this default mode of operation (DEFMOD), the states of the outputs are determined by the default code (DEFCOD) written in the table of configuration parameters (see Section 3.2).
Priority Oxy,3.VAL-OUT+VAL-OUT Default mode
N
Output matrix defined in OWxy,7
Y
➤ ➤ ➤ ➤
Nibbles defined by configuration
➤
DEFCOD
Oxy,4
0
1
➤ ➤ ➤ ➤
FORCING
Oxy,0,F
0
O.0
O.1
O.2
O.3
1
➤ ➤ ➤ ➤
0000
___________________________________________________________________________________________
18
Operation 2
___________________________________________________________________________
2.4-4 Preset
This function transfers the values contained in the register words OWxy,1 (in single length) or OWxy,1/OWxy,2 (in double length) to the current value.
This transfer takes place when there is:
• A change of state of the physical input In3 (rising edge or falling edge),
• A rising edge on discrete output bit Oxy,1,
• A change of state of input In3 when bit Oxy,1 is at 1.
The choice of the above events, together with the type of edge that activates input In3 and the decision to effect a preset when a threshold is reached, is defined during the configuration.
Note
The preset value must be present in the register words OWxy,1/OWxy,2 at least one cycle before the preset command is given by setting bit Oxy,1 to 1.
_____________________________________________________________________
2.4-5 Capture
This function captures the current value and transfers it to register words IWxy,4 (SL), or IWxy,4/IWxy,5 (DL).
The transfer can be configured to occur on:
• A rising edge on physical input In4,
• A rising edge on output bit Oxy,2.
• A rising edge on input In4 when bit Oxy,2 is at 1.
This sub-function cannot be used in the Tachometer function.
If monitoring of the captured value in relation to the thresholds is requested, monitoring becomes active as soon as the module goes to the Run mode and before the first capture is made (the captured value being reset to 0 by the module).
To prevent the outputs from adopting undesired states, the user can:
• Effect a capture by the CPU (Oxy,2) to initialize the captured value.
• Or use the output validation bit Oxy,3 to prevent the outputs from being validated before the first capture is made.
___________________________________________________________________________
19
___________________________________________________________________________
2.4-6 Validation
This function permits the acquisition of the input pulses in the selected mode of operation.
The validation function can be configured for either:
• Physical input In2 at state 1, or
• Discrete output bit Oxy,0 at state 1, or
• The combination of both these events.
_____________________________________________________________________
2.4-7 Operation with Hysteresis
This function allows a hysteresis value to be assigned to each of the thresholds to ensure stability. The value is defined during the configuration.
with Th0 = Real threshold
H = Hysteresis value/2
(common to both thresholds)
Th0 -H
H
Th0
This function is not available in the electronic cam mode.
H
Th0 +H
Measurement
_____________________________________________________________________
2.4-8 Operation with Modulo
This function, which can be selected during the configuration, defines the upper limit of the counting range, which becomes a "circular" range as shown below.
The modulo is always a positive number from 200 to 32600 or 2147483600 (in double length).
The current value is always between 0 and the modulo minus 1. If the user loads threshold values that are outside the modulo, the fault is not indicated.
On the other hand, if the preset value is outside the modulo, the overflow bit
IWxy,1,3 is set to 1, even if the preset input is absent.
Upper range
Th 1
Modulo -1
In the electronic cam mode, operation with the modulo is mandatory.
Lower range
Intermediate range
Th 0
___________________________________________________________________________________________
20
Operation 2
___________________________________________________________________________
2.4-9 Generation of Interrupts
During the configuration of the module, the user can select the events that will generate interrupts to the CPU. These events are listed below in descending order of priority:
• Crossing of a threshold,
• Input pulse on the physical capture input (In3),
+
Highest
• Input pulse on the physical preset input (In4),
• Input pulse on the physical validation input (In2),
Descending order of priority
• Sampling period of the tachometer.
-
Lowest
___________________________________________________________________________
21
___________________________________________________________________________
___________________________________________________________________________________________
22
X
3.1
Principle
3.1-1 General
3.1-2 Configuration Parameters
3.1-3 Coding and Entering the Parameters
3.1-4 Transferring the Configuration Table
3.2
Configuration Parameters
3.2-1 Common Part : Operating Mode
3.2-2 Specific Part : Electronic Cam Mode ●
Configuration 3
Section 3
Page
24
24
24
25
25
26
26
30
___________________________________________________________________________
23 x
___________________________________________________________________________
3.1
Principle
3.1-1 General
The configuration procedure enables the user to adapt the operation of the module to the requirements of the application.
The configuration procedure comprises 3 steps:
• Definition of the configuration parameters,
• Coding of the parameters, in hexadecimal codes or decimal values, in a word table,
• Transfer of the configuration table from the user program to the module.
Note
After reconfiguration of the module, the current value, the captured value and the number of pulses per unit of time are all set to 0.
`
______________________________________________________________________
3.1-2 Configuration Parameters
The configuration parameters are divided into 2 parts.
A part common to all modes (configuration of the operating mode) defining:
• The operating mode of the module,
• The type of counting information,
• The assignment of the functional inputs,
• The assignment of the thresholds,
• Operation with hysteresis,
• Operation with modulo,
• The events generating interrupts.
A specific part, relating to the electronic cam mode, defining:
• The value of the thresholds,
• The states of the outputs associated with each threshold.
___________________________________________________________________________
24
Configuration 3
___________________________________________________________________________
3.1-3 Coding and Entering the Parameters
The configuration parameters must be coded in a word table that can be stored in either of the following user memory zones :
• Zone W (internal words) by program or by using the terminal in the Data mode,
• Zone CW (constant words) by using the terminal in the Constant mode, or in the
Program mode in the case of the TSX 47-20.
The parameters are expressed in:
• Hexadecimal for a Code,
• Decimal for numerical values.
The number of words in the configuration table is:
- For the common part
• 8 (16 bytes ) for a single length format,
• 9 (18 bytes ) for a double length format.
- For the specific part
• 3 to 46 (6 to 92 bytes) depending on the number of thresholds and the format (SL or DL).
________________________________________________________________________________________________
3.1-4 Transferring the Configuration Table
The configuration table is transferred from the user program to the module by means of a CPL type Text block.
Principal parameters of the CPL Text block:
• TXTi,M = H’••63'
→
Channel number (63 : coupler system),
→
Slot number of the module in the rack,
→
Rack number.
• TXTi,C = H’0040' : Configuration write request,
• TXTi,L = Length of the transmission table in number of bytes:
- Configuration of the operating mode, TXTi,L = 16 (or 18),
- Configuration of the thresholds/outputs, TXTi,L = 6 to 92,
- Configuration of the operating mode and the thresholds/outputs, TXTi,L = 22 to 110.
The report of the transfer, sent back by the module (TXTi,V or TXTi,R for TSX 47-20) is used to check that the configuration has been correctly transferred. It is equal to H'FE' if the transfer is correct and to H'FD' if it is not correct.
Note
With a TSX 47-20 PLC, if TYPE = 15 or NTS > 7, the configuration is refused and the module goes
25
___________________________________________________________________________
3.2
Configuration Parameters
3.2-1 Common Part - Operating Mode
The table of configuration parameters is composed of 8 or 9 words, depending on the format selected by the user (single or double length).
Wi or CWi
Wi or CWi + 1
Wi or CWi + 2
Wi or CWi + 3
Wi or CWi + 4
Wi or CWi + 5
Wi or CWi + 6
Wi or CWi + 7 or
DWi or CDWi + 7
SL DL
HYSTER
FILTER COUNT-IN FUNCTION
PRST-TH TH-DET LOGIC
MODULO VAL-OUT EDGE-IN3 FORCING
DEFCOD DEFCOM IT-EVENT
0 0
TACH-PER
0 PTEM
HYS-VAL
MOD-VAL (SL-DL)
MOD-VAL (DL)
Hexadecimal code
Hexadecimal code
Hexadecimal code
Hexadecimal code
Decimal value
Decimal value
Decimal value
Decimal value
Decimal value
Word Wi or CWi
Nibble 0 FUNCTION - Selection of the main function of the module
• Code 0 : Counter,
• Code 1 : Up/Down counter,
• Code 2 : Timer,
• Code 3 : Position measurement,
• Code 4 : Tachometer,
• Code 5 : Electronic cam.
Nibble 1 COUNT-IN - Selection of the counting input mode
• Code 0 : With direction discriminator.
In0
▼
In1 ▼
90° ➤ ➤
▼
▼
▼
▼
• Code 1 : With direction discriminator.
In0
In1
▼
▼
▼ ▼
▼
Upcounting
Downcounting
• Code 2 : Without direction discriminator.
Note
The counting pulses are active on the falling edge.
In0
In1
▼ ▼ ▼
▼
Upcounting
Downcounting
___________________________________________________________________________
26
Configuration 3
___________________________________________________________________________
Nibble 2 FILTER - Selection of the filter of inputs In0, In1, In2
• Code 0 : F max = 2 kHz.
• Code 1 : F max = 40 kHz.
Nibble 3 SL-DL- Format (Single Length or Double Length)
• Code 0 : Single length, 15 bits + sign.
• Code 1 : Double length, 31 bits + sign.
Word Wi + 1 or CWi + 1
Nibble 0 LOGIC - Selection of the logic of the inputs and CPU commands
With : x = 0 : logical AND x = 1 : Logical OR
3 2 1 0
0 X X X
Validation
Preset
Capture
Reserved
Example : Nibble 0 = 5 i.e. L'0101
• The validation function is activated when bit Oxy,0 = 1 OR input In2 = 1.
• The preset function is activated when bit Oxy,1 = 1 AND an edge on input In3.
• The capture function is activated on a rising edge on bit Oxy,2 OR on input In4.
Nibble 1
Nibble 2
TH-DET - Selection of threshold detection
• Code 0 : Threshold detection on the current value,
• Code 1 : Threshold detection on the captured value
PRST-TH - Selection of preset on threshold detection
• Code 0 : No preset on threshold detection
• Code 1 : Preset on detection of threshold 0,
• Code 2 : Preset on detection of threshold 1.
(Not used in the electronic cam mode)
Nibble 3 HYSTER - Selection of the hysteresis function
• Code 0 : Without hysteresis,
• Code 1 : With hysteresis.
(Not used in the electronic cam mode)
___________________________________________________________________________
27
___________________________________________________________________________
Word Wi + 2 or CWi + 2
Nibble 0 FORCING - Selection of forcing of the physical outputs
With: x = 0 : Output at 0 x = 1 : Output at 1
3 2 1 0
X X X X
Output O.0
Output O.1
Output O.2
Output O.3
Nibble 1
Nibble 2
Nibble 3
EDGE-In3 - Selection of the active edge of input In3
• Code 0 : Active on a rising edge,
• Code 1 : Active on a falling edge.
VAL-OUT - Validation of the physical outputs by the CPU
• Code 0 : Without validation by the CPU,
• Code 1 : With validation by the CPU by Oxy,3.
MODULO - Selection of the modulo function
• Code 0 : Counting without modulo,
• Code 1 : Counting with modulo (mandatory in the electronic cam mode).
Word Wi + 3 or CWi + 3
LSB IT-EVENT - Selection of events generating interrupts
With: x = 0 : Without IT x = 1 : With IT
7 6 5 4 3 2 1 0
X X X X X X
Crossing of threshold 0 (1)
Crossing of threshold 1
Capture input pulse
Preset input pulse
Validation input pulse
Tachometer period
(1) Or crossing of one of the thresholds in the electronic cam mode.
___________________________________________________________________________
28
Configuration 3
___________________________________________________________________________
Nibble 2 DEFMOD - Selection of default mode operation
• Code 0 : Without default mode,
• Code 1 : With default mode.
Nibble 3 DEFCOD - Default code
With: x = 0 : Output at 0 x = 1 : Output at 1
3 2 1 0
X X X X
Output O.0
Output O.1
Output O.2
Output O.3
Word Wi + 4 or CWi + 4
Nibble 0 TIME-PER:- Timer function period
• Code 0 : Period = 10 ms,
• Code 1 : Period = 100 ms,
• Code 2 : Period = 1s,
• Code 3 : Period = 10s.
Word Wi + 5 or CWi + 5
TACH-PER - Tachometer function period
• From 1 to 32 767 x 10 ms.
Word Wi + 6 or CWi + 6
HYS-VAL Hysteresis value
• From 0 to 32 767.
Word Wi + 7 or CWi = 7
MOD-VAL - Modulo value in single length
• From 200 to 32 600.
Word DWi + 7 or CDWi + 7
MOD-VAL - Modulo value in double length
• From 200 to 2 147 483 600 .
___________________________________________________________________________
29
___________________________________________________________________________
3.2-2 Specific Part : Electronic Cam Mode ●
This part permits the definition of a table of 15 thresholds and associated outputs. The first word identifies the type of table and the number of thresholds to be coded. The single or double length format is defined in the common part (operating mode) by the nibble
SL/DL.
Table in single length
CWj / Wj
CWj / Wj + 1
CWj / Wj + 2
CWj / Wj + 3
CWj / Wj + 4
Nibble 3 Nibble 2 Nibble 1 Nibble 0
OSQ0 NTS 1 F
OSQ1 0
Th 1
0 0
Th 2
OSQ2 0 0 0
Hexadecimal code
Decimal value
Hexadecimal code
Decimal value
Hexadecimal code
CWj / Wj + (2 x NTS) OSQn 0
Th n
0 0
Decimal value
Hexadecimal code with n = NTS
Table in double length
Nibble 3 Nibble 2 Nibble 1 Nibble 0
CWj / Wj
CDWj / DWj +1
CWj / Wj + 3
CDWj / DWj + 4
CWj / Wj + 6
OSQ0 NTS 1
Th 1 (LSB)
OSQ1
OSQ2
0
(MSB)
0
Th 2 (LSB)
(MSB)
0 0
0
0
F Hexadecimal code
Decimal value
Hexadecimal code
Decimal value
Hexadecimal code
CWj / Wj + (3 x NTS) OSQn
Th n (LSB)
(MSB)
0 0 0
Decimal value
Hexadecimal code with n = NTS
The first nibble of the first word (value F) characterizes the configuration table of the thresholds and associated outputs.
___________________________________________________________________________
30
Configuration 3
___________________________________________________________________________
NTS : This nibble defines the number of thresholds in the table :
1
≤
NTS
≤
15. The threshold 0 (always null) is not counted in NTS.
OSQ0 to OSQn : These nibbles define the states of the outputs associated with the
corresponding thresholds (0 to n).
X X X X
Output O.0
Output O.1
Output O.2
Output O.3
x = 0 : Output OFF, x = 1 : Output ON.
OSCi: state of the outputs when threshold i
≤
COUNT < threshold i + 1
Th 1 to Th n :
These words define the values of thresholds 1 to n (with n = NTS) and:
0 (Th 0)
≤
Th 1
≤
Th 2
≤
Th 3 •••
≤
Th 15 < modulo.
Notes • The configuration of the thresholds/outputs is not accepted unless the module is config-
ured following a hot restart or after reception of a correct operating mode configuration.
It is not accepted unless FUNCTION = 5 (electronic cam function).
• On each configuration of the operating mode, the table of thresholds/outputs of the module is inhibited and reset to 0.
• If the configuration of the thresholds/outputs received by the module is incorrect, the module goes to the NCONF (Not configured state). In this case a new transfer of the whole of the configuration (operating mode + thresholds/outputs) is necessary.
• With the TSX 47-20 PLC, the length of the messages to be transmitted cannot exceed
30 bytes. For this reason, the number of useful thresholds that can be used is limited to
7 (i.e. a total of 8 including threshold 0).
• The number of active thresholds depends on the number of thresholds configured. On each reception of a threshold/output configuration request, the number of thresholds is reset and a test for the coherence of all the new threshold values declared is effected.
___________________________________________________________________________
31
___________________________________________________________________________
___________________________________________________________________________
32
X ________________________________________________________
Functions 4
Section 4
____________________________________________________________________
4.1
Counter Function
4.1-1 Principle
4.1-2 Configuration Table
4.1-3 Functional Diagram
4.2
Up/Down Counter Function
4.2-1 Principle
4.2-2 Configuration Table
4.2-3 Functional Diagram
4.3
Timer Function
4.3-1 Principle
4.3-2 Configuration Table
4.3-3 Functional Diagram
4.4
Position Measurement Function
4.4-1 Principle
4.4-2 Configuration Table
4.4-3 Functional Diagram
4.5
Tachometer Function
4.5-1 Principle
4.5-2 Configuration Table
4.5-3 Functional Diagram
4.6
Electronic Cam Function ●
4.6-1 Principle
4.6-2 Configuration Table
4.6-3 Functional Diagram
Page
34
34
35
36
43
43
44
45
40
40
41
42
37
37
38
39
49
49
50
51
46
46
47
48
___________________________________________________________________________
33
___________________________________________________________________________
4.1
Counter Function
________________________________________________________________________________________
4.1-1 Principle
When configured for the Counter function, the TSX CCM 100 module counts the pulses on input In0 at a frequency of up to 40 KHz.
The range limits are:
• 0 to 32767 in single length format (SL),
• 0 to 2 147 483 647 in double length format (DL),
• 0 to modulo -1 if the modulo function is selected. The value of the modulo must be consistent with the selected format (SL or DL).
The Counting function can be activated by an external event or a command from the
CPU. The module also permits:
• Presetting of the current value to a value supplied by the CPU (see Section 2.4-4),
• Capture of the current value (see Section 2.4-5),
• Comparison of the current or captured value with 2 thresholds (with or without hysteresis), (see Section 2.4-2).
• Activation of the outputs according to the position of the current or captured value in relation to the thresholds (see Section 2.4-3).
• Generation of interrupts to the CPU on the occurrence of selected events (preset, capture, validation of counting, crossing a threshold), (see Section 2.4-9).
The user program can transmit the following commands to the module in order to synchronize its operation with the sequential processing of the application:
• Validation or inhibition of counting,
• Validation, inhibition or forcing of outputs,
• Modification of comparison thresholds,
• Modification of the preset value,
• Modification of the output matrix.
In return, the module supplies the following information:
• The current value,
• The captured value, together with binary information concerning the events detected by the module.
___________________________________________________________________________
34
Functions 4
___________________________________________________________________________
4.1-2 Configuration Table
Nibble 3 Nibble 2 Nibble 1 Nibble 0
Wi or CWi
Wi or CWi + 1
Wi or CWi + 2
Wi or CWi + 3
Wi or CWi + 4
Wi or CWi + 5
Wi or CWi + 6
Wi or CWi + 7 or
DWi or CDWi + 7
SL DL FILTER 0
HYSTER PRST-TH TH-DET
0
LOGIC
MODULO VAL-OUT EDGE-IN3 FORCING
DEFCOD DEFMOD IT
0 0 0 0
0
HYS-VAL
MOD-VAL (SL-DL)
MOD-VAL (DL)
Hexadecimal code
Hexadecimal code
Hexadecimal code
Hexadecimal code
Hexadecimal code
Decimal value
Decimal value
Decimal value
Decimal value
The parameters outlined with a thick line are specific to the Counting function, the others are described in Section 3.2.
___________________________________________________________________________
35
___________________________________________________________________________
4.1-3 Functional Diagram
Sensors and actuators
TSX CCM 100 module
Complete
I/O bus
Counting input
In0
Filtre
LO/HI
❊
COUNTER
Validation of counting input
In2
LO/HI
❊ & or
1
❊
MODULO*
Preset input
(transfer of words
OWxy,1/OWxy,2 to current value)
In3
& or
1
❊ PRESET
VALUE
▲
CURRENT
VALUE
Oxy,0
IT CPU
IT CPU
❊
: Validation of
counting
❊
Oxy,1 : Preset of the
current value
OWxy,1 / (OWxy,2):
Preset value
Capture input
(transfer of the current value to words
IWxy,4/(IWxy,5))
In4
& or
1
❊
CAPTURED
VALUE
IWxy,6 / (IWxy,7)
IT CPU
Current value
❊
Oxy,2 : Capture of
the current
value
IWxy,4 / (IWxy,5)
Captured
value
4 outputs
24V - 300 mA
O.0
O.1
→
→
O.2
→
O.3
→
❊
OUTPUT
FORCING
CODE
M
A
T
R
I
X
O
U
T
P
U
T
▲
COMPARISON
▲
Thresholds 1 and 2
HYSTERESIS*
IT CPU
❊
OWxy,3 / (OWxy,4) and
OWxy,5 / (OWxy,6)
OWxy,7
Oxy,3
Oxy,4
: Output
matrix
: Validation
of outputs
: Forcing of
outputs
Note
• The register words shown between parentheses are used for double length values.
• *Selection defined during the configuration of the module.
___________________________________________________________________________
36
Functions 4
___________________________________________________________________________
4.2
Up/Down Counter Function
4.2-1 Principle
In this mode, the module counts the pulses on inputs In0 and In1 according to the counting mode defined in the configuration.
The maximum frequency is 40 KHz and the range limits are as follows:
• - 32768 to + 32767 in single length format (SL),
• - 2 147 483 648 to + 2 147 483 647 in double length format (DL).
• 0 to modulo - 1 if the modulo function is selected. The value of the modulo must be consistent with the selected format (SL or DL).
The Up/Down counting function can be activated by an external event or by a command from the CPU. The module also permits:
• Presetting of the current value to a value supplied by the CPU (see Section 2.4-4).
• Capture of the current value (see Section 2.4-5).
• Comparison of the current or captured value with 2 thresholds (with or without hysteresis), (see Section 2.4-2).
• Activation of the outputs according to the position of the current or captured value in relation to the thresholds (see Section 2.4-3).
• Generation of interrupts to the CPU on the occurrence of selected events (preset, capture, validation of counting, crossing a threshold), (see Section 2.4-9).
The user program can transmit the following commands to the module in order to synchronize its operation with the sequential processing of the application:
• Validation or inhibition of counting,
• Validation, inhibition or forcing of outputs,
• Modification of comparison thresholds,
• Modification of the preset value,
• Modification of the output matrix.
In return, the module supplies the following information:
• The current value,
• The captured value, together with binary information concerning the events detected by the module.
___________________________________________________________________________
37
___________________________________________________________________________
4.2-2 Configuration Table
Nibble 3 Nibble 2 Nibble 1 Nibble 0
Wi or CWi
Wi or CWi + 1
Wi or CWi + 2
Wi or CWi + 3
Wi or CWi + 4
Wi or CWi + 5
Wi or CWi + 6
Wi or CWi + 7 or
DWi or CDWi + 7
SL-DL FILTER COUNT-IN
HYSTER PRST-TH TH-DET
1
LOGIC
MODULO VAL-OUT EDGE-IN3 FORCING
DEFCOD DEFMOD IT-EVENT
0 0 0 0
0
HYS-VAL
MOD-VAL (SL-DL)
MOD-VAL (DL)
Hexadecimal code
Hexadecimal code
Hexadecimal code
Hexadecimal code
Hexadecimal code
Decimal value
Decimal value
Decimal value
Decimal value
The parameters outlined with a thick line are specific to the Up/Down counting function, the others are described in Section 3.2.
___________________________________________________________________________
38
Functions 4
___________________________________________________________________________
4.2-3 Functional Diagram
Sensors and actuators
TSX CCM 100 module
Complete
I/O bus
Counting input
Validation of counting input
In0
FILTER
LO/HI
❊
In1
LO/HI
❊
In2
LO/HI
❊
COUNTER
Preset input
(transfer of words
OWxy,1/OWxy,2 to current value)
Entrée capture
(transfer of the current value to words
IWxy,4/(IWxy,5))
4 outputs
24V - 300 mA
In3
In4
O.0
O.1
→
→
O.2
→
O.3
→
❊
OUTPUT
FORCING
CODE
M
A
T
R
I
X
O
U
T
P
U
T
Modulo
❊
& or
1
❊
& or
1
❊
PRESET
VALUE
▲
CURRENT
VALUE
Oxy,0
IT CPU
❊
IT CPU
❊
: Validation of
counting
Oxy,1 : Preset of the
current value
OWxy,1 / (OWxy,2)
Preset value
& or
1
❊
CAPTURED
VALUE
IWxy,6 / (IWxy,7)
Current value
IT CPU
❊
Oxy,2 : Capture of
the current
value
IWxy,4 / (IWxy,5)
Captured
value
▲
COMPARISON
▲
Thresholds 1 and 2
HYSTERESIS*
IT CPU
❊
OWxy,3 / (OWxy,4) and
OWxy,5 / (OWxy,6)
Threshold values
OWxy,7 : Output matrix
Oxy,3
Oxy,4
: Validation
of outputs
: Forcing of
outputs
Note : The register words shown between parentheses are used for double length values.
* : Selection defined during the configuration of the module.
___________________________________________________________________________
39
___________________________________________________________________________
4.3
Timer Function
4.3-1 Principle
In this mode, the module counts the pulses from an internal clock whose time base is selectable (10 ms, 100 ms, 1s, 10s).
The maximum counting capacity is 32767, or modulo -1 if the modulo function is selected.
The Timer function can be activated by an external event or by a command from the
CPU. The module also permits:
• Presetting of the current value to a value supplied by the CPU (see Section 2.4-4).
• Capture of the current value (see Section 2.4-5).
• Comparison of the current or captured value with 2 thresholds (with or without hysteresis), (see Section 2.4-2).
• Activation of the outputs according to the position of the current or captured value in relation to the thresholds (see Section 2.4-3).
• Generation of interrupts to the CPU on the occurrence of selected events (preset, capture, validation of counting, crossing a threshold), (see Section 2.4-9).
The user program can transmit the following commands to the module in order to synchronize its operation with the sequential processing of the application:
• Validation or inhibition of counting,
• Validation, inhibition or forcing of outputs,
• Modification of comparison thresholds,
• Modification of the preset value,
• Modification of the output matrix.
In return, the module supplies the following information:
• The current value,
• The captured value, together with binary information concerning the events detected by the module.
___________________________________________________________________________
40
Functions 4
___________________________________________________________________________
4.3-2 Configuration Table
Wi or CWi
Wi or CWi + 1
Wi or CWi + 2
Wi or CWi + 3
Wi or CWi + 4
Wi or CWi + 5
Wi or CWi + 6
Wi or CWi + 7
Nibble 3 Nibble 2 Nibble 1 Nibble 0
0
0
FILTER 0
PRST-TH TH-DET
2
LOGIC
MODULO VAL-OUT EDGE-IN3 FORCING
DEFCOD DEFMOD IT-EVENT
0 0 0 TIME-PER
0
0
MOD-VAL (SL)
Hexadecimal code
Hexadecimal code
Hexadecimal code
Hexadecimal code
Hexadecimal code
Decimal value
Decimal value
Decimal value
The parameters outlined with a thick line are specific to the Timer function, the others are described in Section 3.2.
___________________________________________________________________________
41
___________________________________________________________________________
4.3-3 Functional Diagram
Sensors and actuators
TSX CCM 100 module
CLOCK*
10,100ms 1,10s
COUNTER
Complete
I/O bus
Validation of counting input
Preset input
(transfer of words
OWxy, 1 to current value)
Capture input
(transfer of the current value to words IWxy,4)
4 outputs
24V - 300 mA
In2
In3
In4
O.0
O.1
FILTER
LO/HI
❊
→
→
O.2
→
O.3
→
❊
OUTPUT
FORCING
CODE
M
A
T
R
I
X
O
U
T
P
U
T
& or
1
❊
MODULO
& or
1
❊ PRESET
VALUE
▲
CURRENT
VALUE
Oxy,0 : Validation of
counting
IT CPU
❊
IT CPU
❊
Oxy,1 : Preset of the
current value
OWxy,1 : Preset value
& or
1
❊
CAPTURED
VALUE
IWxy,6 : Current value
IT CPU
❊
Oxy,2 : Capture of
the current
value
IWxy,4 : Captured
value
▲
COMPARISON
▲
Thresholds 1 and 2
HYSTERESIS*
IT CPU
❊
OWxy,3 and OWxy,5
Threshold values
OWxy,7
Oxy,3
Oxy,4
: Output
matrix
: Validation of
outputs
: Forcing of
outputs
Nota
• *Selection defined during the configuration of the module.
___________________________________________________________________________
42
Functions 4
___________________________________________________________________________
4.4
Position Measurement Function
4.4-1 Principle
In this mode, the module counts the pulses on inputs In0 and In1 from a position measurement encoder at a frequency of up to 40 KHz.
The range limits are:
• - 32768 to + 32767 in single length format (SL).
• - 2 147 483 648 to + 2 147 483 647 in double length format (DL).
• 0 to modulo -1 if the modulo function is selected. The value of the modulo must be consistent with the selected format (SL or DL).
The Position measurement function can be activated by a command from the CPU. The module also permits:
• Presetting of the current value to a value supplied by the CPU:
- On command from the CPU,
- On an external event (reference point set-up - see below)
• Capture of the current value (see Section 2.4-5).
• Comparison of the current or captured value with 2 thresholds (with or without hysteresis), (see Section 2.4-2).
• Activation of the outputs according to the position of the current or captured value in relation to the thresholds (see Section 2.4-3).
• Generation of interrupts to the CPU on the occurrence of selected events (preset, capture, validation of counting, crossing a threshold), (see Section 2.4-9).
The user program can transmit the following commands to the module in order to synchronize its operation with the sequential processing of the application:
• Validation or inhibition of counting,
• Validation, inhibition or forcing of outputs,
• Modification of comparison thresholds,
• Modification of the preset value,
• Modification of the output matrix.
In return, the module supplies the following information:
• The current value,
• The captured value, together with binary information concerning the events detected by the module.
Reference point set-up
The reference point is set up by the coincidence of the encoder zero mark (In2) and the reference point cam (In3).
There must therefore be only one zero mark pulse within the limits of the reference point cam.
___________________________________________________________________________
43
___________________________________________________________________________
4.4-2 Configuration Table
Nibble 3 Nibble 2 Nibble 1 Nibble 0
Wi or CWi
Wi or CWi + 1
Wi or CWi + 2
Wi or CWi + 3
Wi or CWi + 4
Wi or CWi + 5
Wi or CWi + 6
Wi or CWi + 7 or
DWi or CDWi + 7
SL DL FILTER COUNT-IN
HYSTER PRST-TH TH-DET
MODULO VAL-OUT
DEFCOD DEFMOD
0 0
0
0
3
LOGIC
FORCING
IT-EVENT
0
0
HYS-VAL
MOD-VAL (SL-DL)
MOD-VAL (DL)
Hexadecimal code
Hexadecimal code
Hexadecimal code
Hexadecimal code
Hexadecimal code
Decimal value
Decimal value
Decimal value
Decimal value
The parameters outlined with a thick line are specific to the Position measurement function, the others are described in Section 3.2.
___________________________________________________________________________
44
Functions 4
___________________________________________________________________________
4.4-3 Functional Diagram
Sensors and actuators
TSX CCM 100 module
Complete
I/O bus
In0
FILTER
LO/HI
❊
Counting input COUNTER
In1
LO/HI
❊
Encoder zero mark input active on a rising edge
(see Note 1)
In2
LO/HI
❊ & or
1
❊
MODULO*
Cam input
(transfer of words OWxy,1/
OWxy,2 to current value, see Note1)
In3
&
& or
1
❊
PRESET
VALUE
▲
CURRENT
VALUE
Oxy,0 : Validation of
IT CPU
❊
counting
Oxy,1 : Preset of the
current value
Preset value
Capture input
(transfer of the current value to words
IW xy,4(IWxy,5))
In4
& or
1
❊
CAPTURED
VALUE
IT CPU
❊
Current value
Oxy,2 : Capture of
current value
Current value
4 outputs
24V - 300 mA
O.0
O.1
→
→
O.2
→
O.3
→
❊
OUTPUT
FORCING
CODE
M
A
T
R
I
X
O
U
T
P
U
T
▲
COMPARISON
▲
Thresholds 1 and 2
HYSTERESIS*
IT CPU
❊
OWxy,3 / (OWxy,4) and
OWxy,5 / (OWxy,6) :
Threshold values
OWxy,7
Oxy,3
Oxy,4
: Outputs
matrix
: Validation
of outputs
: Forcing of
outputs
Note
• The register words shown between parentheses are used for double length values.
• *Selection defined during the configuration of the module.
___________________________________________________________________________
45
___________________________________________________________________________
4.5
Tachometer Function
4.5-1 Principle
In this mode, the module counts the number of pulses arriving on inputs In0 and In1, according to the counting mode defined by the configuration, at a frequency of up to 40
KHz.
The range limits are:
• - 32768 to + 32767 in single length format (SL),
• - 2 147 483 648 to + 2 147 483 647 in double length format (DL).
• 0 to modulo -1 if the modulo function is selected. The value of the modulo must be consistent with the selected format (SL or DL).
At the end of each period of time, defined by the user between 1x10ms and 32767x10ms, the module calculates the number of pulses received during this period.
The result (NUMP/T), equivalent to a speed, is expressed as an absolute value in the range from 0 to 32767.
Apart from the counting and tachometer functions, which can be activated by an external event or by a command from the CPU, the module also permits:
• Comparison of the calculated value (NUMP/T) with 2 thresholds (with or without hysteresis), (see Section 2.4-2).
• Activation of the outputs according to the position of the calculated value (NUMP/T) in relation to the thresholds (see Section 2.4-3).
• Presetting of the current value to a value supplied by the CPU (see Section 2.4-4).
• Generation of interrupts to the CPU on the occurrence of selected events (preset, capture, validation of counting, crossing a threshold), (see Section 2.4-9).
The user program can transmit the following commands to the module in order to synchronize its operation with the sequential processing of the application:
• Validation or inhibition of counting,
• Validation, inhibition or forcing of outputs,
• Modification of comparison thresholds,
• Modification of the preset value,
• Modification of the output matrix.
In return, the module supplies the following information:
• The current value,
• The number of pulses per unit of time, together with binary information concerning the events detected by the module.
___________________________________________________________________________
46
Functions 4
___________________________________________________________________________
4.5-2 Configuration Table
Nibble 3 Nibble 2 Nibble 1 Nibble 0
Wi or CWi
Wi or CWi + 1
Wi or CWi + 2
Wi or CWi + 3
Wi or CWi + 4
Wi or CWi + 5
Wi or CWi + 6
Wi or CWi + 7 or
DWi or CDWi + 7
SL DL
HYSTER
FILTER COUNT-IN
0 0
4
LOGIC
MODULO VAL-OUT EDGE-IN FORCING
DEFCOD DEFMOD IT-EVENT
0 0 0 0
TAC-PER
HYS-VAL
MOD-VAL (SL-DL)
MOD-VAL (DL)
Hexadecimal code
Hexadecimal code
Hexadecimal code
Hexadecimal code
Hexadecimal code
Decimal value
Decimal value
Decimal value
Decimal value
The parameters outlined with a thick line are specific to the Tachometer function, the others are described in Section 3.2.
___________________________________________________________________________
47
___________________________________________________________________________
4.5-3 Functional Diagram
Sensors and actuators
TSX CCM 100 module
Complete
I/O bus
In0
FILTER
LO/HI
❊
Counting input COUNTER
In1
LO/HI
❊
Validation of counting input
In2
LO/HI
❊ & or
1
❊
MODULO*
Preset input
(transfer of words
OWxy,1/OWxy,2 to current value)
In3
& or
1
❊ PRESET
VALUE
▲
Oxy,0 : Validation of
counting
IT CPU
❊
IT CPU
❊
Oxy,1 : Preset of the
current value
OWxy,1 / (OWxy,2) :
Preset value
Number of pulses per unit of time IWxy,6 / (IWxy,7) :
Current value
IT CPU
❊
TIME BASE
❊
CLOCK
▲
CAPTURED
VALUE
IWxy,3
O.0
O.1
→
→
O
U
T
P
U
T
▲
COMPARISON
▲
IT CPU
❊
4 outputs
24V - 300 mA
O.2
→
O.3
→
❊
OUTPUT
FORCING
CODE
M
A
T
R
I
X
Thresholds 1 and 2
HYSTERESYS*
OWxy,3
OWxy,5
OWxy,7
Oxy,3
Oxy,4
: Output
matrix
: Validation
of outputs
: Forcing of
outputs
Note
• The register words shown between parentheses are used for double length values.
• *Selection defined during the configuration of the module.
___________________________________________________________________________
48
Functions 4
___________________________________________________________________________
4.6
Electronic Cam Function
●
4.6-1 Principle
In this mode, the module counts the pulses arriving on inputs In0 and In1, according to the counting mode defined during configuration, at a frequency of up to 40 KHz.
The range limits are:
• 0 to modulo - 1. The value of the modulo must be consistent with the selected format
(SL or DL)..
Apart from the counting function, which can be activated by an external event or by a command from the CPU, the module also permits:
• Presetting of the current value to a value supplied by the CPU (see Section 2.4-4).
• Capture of the current value (see Section 2.4-5).
• Comparison of the current value with the threshold values defined in the configuration and activation of the corresponding outputs.
• Generation of interrupts to the CPU on the occurrence of selected events (preset, capture, validation of counting, crossing a threshold), (see Section 2.4-9).
The user program can transmit the following commands to the module in order to synchronize its operation with the sequential processing of the application:
• Validation or inhibition of counting,
• Validation, inhibition or forcing of outputs,
• Modification of the preset value,
• Modification of the output matrix.
In return, the module supplies the following information:
• The current value,
• The captured value,
• The number of the threshold immediately below the current value, together with binary information concerning the events detected by the module.
Illustration of the cam function :
0 ➤
Range limits
Threshold number
0
Outputs states
OSQ0
1
OSQ1
2
OSQ2
3
OSQ3
➤ Modulo-1
14 15
OSQ13 OSQ14 OSQ15
___________________________________________________________________________
49
___________________________________________________________________________
4.6-2 Configuration Table
Wi or CWi
Wi or CWi + 1
Wi or CWi + 2
Wi or CWi + 3
Wi or CWi + 4
Wi or CWi + 5
Wi or CWi + 6
Wi or CWi + 7 or
DWi or CDWi + 7
Nibble 3 Nibble 2 Nibble 1 Nibble 0
SL DL
0
FILTER COUNT-IN
0 TH-DET
5
LOGIC
1 VAL-OUT EDGE-IN3 FORCING
DEFCOD DEFMOD IT-EVENT
0 0 0 0
0
0
MOD-VAL (SL-DL)
MOD-VAL (DL)
Hexadecimal code
Hexadecimal code
Hexadecimal code
Hexadecimal code
Hexadecimal code
Decimal value
Decimal value
Decimal value
Decimal value
The parameters outlined with a thick line are specific to the cam function, the others are described in Section 3.2.
___________________________________________________________________________
50
Functions 4
___________________________________________________________________________
4.6-3 Functional Diagram
Sensors and actuators
TSX CCM 100 module
Complete
I/O bus
In0
FILTER
L0/HI
❊
Counting input COUNTER
In1
L0/HI
❊
Validation of counting input
In2
L0/HI
❊ & or
1
❊
MODULO*
Preset input
(transfer of words OWxy,1/
OWxy,2 to current value)
In3
& or
1
❊
PRESET
VALUE
▲
CURRENT
VALUE
Oxy,0 : validation of
IT CPU
❊
counting
IT CPU
❊
Oxy,1 : Preset of the
current value
OWxy,1 / (OWxy,2) :
Preset value
Capture input
(transfer of the current value to words
IWxy,4/(IWxy,5))
In4
& or
1
❊
CAPTURED
VALUE
▲
COMPARISON
▲
Th 0 to
Th15
IWxy,6 / (IWxy,7) :
Current value
IT CPU
❊
Oxy,2 : Capture of
the current
value
IWxy,4 / (IWxy,5) :
Captured
value
4 outputs
24V - 300 mA
O.0
O.1
→
→
O.2
→
O.3
→
❊
OUTPUT
FORCING
CODE
M
A
T
R
I
X
P
U
T
O
U
T
OSQ 0 to
OSQ 15
IT CPU
❊
Oxy,3
Oxy,4
: Validation
of outputs
: Forcing of
outputs
Note
• The register words shown between parentheses are used for double length values.
• *Selection defined during the configuration of the module.
___________________________________________________________________________
51
___________________________________________________________________________
___________________________________________________________________________
52
X ________________________________________________________
Programming 5
Section 5
____________________________________________________________________
Sub-section Page
_______________________________________________________________________________________________
5.1
Principle 54
5.2
Programming Examples
5.2-1 Measurement of the Length of Parts for Sorting Purposes
5.2-2 Example of Using the Electronic Cam Function ●
5.3
Complementary Programming Information
5.3-1 Interrupt Processing
5.3-2 Fault Processing
5.3-3 Complementary Requests
56
56
61
68
68
71
73
___________________________________________________________________________
53
___________________________________________________________________________
5.1
Principle
The TSX CCM100 module can be programmed by a TSX Series 7 terminal in either the
Local or Connected modes..
The programming of the module is done in two phases:
• A preparatory phase, which consists in defining and entering the configuration parameters,
• A programming phase.
Preparatory phase
Definition of configuration paramaters
From the data concerning the process to be controlled and the functions to be implemented by the module, define the values of the various configuration parameters
(see Section 3.1).
Then use the terminal to enter the contents of the configuration parameters, preferably in the CW zone (Local mode), or in the W zone (Connected mode only).
Entry of the configuration table in the W or CW zone
The contents of the table can also be initialized by program (in the W zone only).
Programming phase
This phase concerns the entry of the program that is necessary for the operation of the module (when the PLC is running).
It consists of 3 steps:
• Configuration of the module. Stop the module and transfer the configuration table from the memory of the
PLC (in the W or CW zone) to the module by using a
Text block and the request H'40'.
• Initialization of the module. This step is designed to put the module in the conditions necessary to implement the desired function:
- Set the module to RUN (bit OWxy,0,C),
- Initialize the threshold and preset values (0Wwy, 1 to
6),
- Initialize and validate the output matrix (OWxy,7 and
Oxy,3),
- Validate the interrupts, if required (OWxy, 0,4 plus
CPU commands),
- Validate the counting function (Oxy,0).
Transfer of the configuration
Module configured
Set module to RUN
Module running
Initializations
Counter function validation command
Operation of the module
- Normal operation,
- Fault processing.
Note
It is possible to delay the start of operation of the module, in order to synchronize its operation with the sequential operation of the PLC, by using the validation/inhibition commands of the outputs and the interrupts.
___________________________________________________________________________
54
Programming 5
___________________________________________________________________________
• Operation of the module. This step corresponds to the normal operation of the module. However, depending on the type of application to be controlled, the degree of integration of the counting function in the sequential processing of the PLC (user program) can vary considerably, as shown in the table below.
The detection and processing of faults must be ensured by the user program.
No integration
Module operation
Module operation
User program
Passive integration
Module operation
⇒
User program
Active integration
User program
TSX CCM 100 module
The module operates completely independently of the user program.
Depending on the data present on its inputs, it actuates its outputs according to the output matrix.
User program
Detection and processing of faults only.
The module operates independently of the user program, but makes available to it the numerical or
Boolean information.
In addition to the detection and processing of faults, the user program recuperates the information transmitted by the module (current value, captured value) for processing or display.
The module and the user The user program is totally or program operate interactively.
partially synchronized with the events generated by the module (use or not of interrupts).
It can modify in real-time the commands and values used by the module (thresholds, preset value, output matrix).
___________________________________________________________________________
55
___________________________________________________________________________
5.2
Programming Examples
5.2-1 Measurement of the Length of Parts for Sorting Purposes
Description of the application
T
➤
B1
STOCK
Photocells
M
➤
➤
J+
J-
J
B2
REJECT
START
STOP
FORCE
The parts to be measured arrive on a continuous belt (without slippage) driven by a motor coupled to a rotary incremental encoder with a direction discriminator. The measurement is effected by counting the number of pulses between the moment when the ray from the photocell is cut by the part and the moment when the ray reappears. Jack J controls the lateral movement of belt B in order to position it opposite "Stock" belt B1 or "Reject" belt B2.
The number of pulses counted is compared with two limit values (representing the theoretical length
±
1%).
Photocell ray
Pulses
➤
1 part = 10,000 pulses
➤
.
If the number of pulses is between these 2 limit values, the part is directed to the ”Stock“ belt B1 (command J+ of jack J),
.
If the number of pulses is outside these 2 limit values, the part is directed to the ”Reject“ belt B2 (command J- of jack J).
The START and STOP push-buttons are used to start and stop the assembly, and a third push-button FORCE is used to force the part onto the "Reject" belt.
Processing the application
The TSX CCM 100 module ensures the counting of the number of pulses, the comparison with the 2 thresholds, and the command of the jack.
The user program controls the conveyor belt motors (through discrete outputs), processes the operator's push-button commands, and counts the number of good and bad parts.
Although this can be considered as a simple counting application (Function 0), it is the up/down counting function (Function 1) that must be selected since the motor is linked to a 2-channel encoder with a direction discriminator.
___________________________________________________________________________
56
Programming 5
___________________________________________________________________________
I/O assignment
Inputs
• In0 and In1 : counting inputs connected to the 2 channels of the encoder,
• In2 : validation input not connected,
• In3 : preset on a falling edge,
• In4 : capture on a rising edge.
connected to the photocell
Outputs :
• O.0 : command J+ of jack J,
• O.1 : command J- of jack J.
Functions assured by the module
The module continuously counts the pulses present on In0 and In1.
On detection of a falling edge on In3, it presets the current value to 0.
On detection of a rising edge on In4, it captures the current value, compares it with the
2 thresholds and controls one of the 2 outputs accordingly:
• O.0 : if the captured value is > Th0 and > Th1,
• O.1 :if the captured value is > Th1 or < Th0.
Definition of the configuration parameters
CW 0
CW 1
CW 2
CW 3
3
Nibbles
2 1 0
0 1 0 1
0 0 1
0 1 1
2 1 0
7
1
4
3. SL format
2. 40KHz
3. No hysteresis
2. No preset on TH-DET
3. No modulo
2. VAL-OUT by CPU
3. Forcing of 0.1 on CPUF
1 and 0. IT on capture
CW 4 0 0. Unused in up/down counting
0. Unused in up/down counting CW 5
CW 6
CW 7
0
0
0
0. No hysteresis
0. No modulo
1. With discrimination
0. Up/Down counter
1. TH-DET on captured value
0. CPU and logical OR
1. Preset on rising edge of In2
0. Forcing of O.0 by CPU
2. With default code
Entry of the configuration parameters
This is done by using the terminal in the Constant mode:
CW0 = H'0101'
CW1 = H'0017'
CW2 = H'0111'
CW3 = H'2104'
CW4 = 0
CW5 = 0
CW6 = 0
CW7 = 0
___________________________________________________________________________
57
___________________________________________________________________________
Configuration of the application
This is done by using the terminal in the Configuration mode, only the parameters necessary for the understanding of the example are mentioned below:
• Configuration of the I/O : enter the code 730 at slot 05.
RACK 1
RACK 0
0 1 2 3 4
730
5 6 7
• Configuration of the Data: assign Text block TXT0 to the transfer of the configuration table,
TXT0 LOCAL CPL DIRECT CW0 0 parameters : TXT0,M = H'0563'
TXT0,C = H'0040'
TXT0,L = 16 (8 words)
Assignment of the variables used
W 101
W102
W120
W121
I0,0
I0,1
I0,2
O1,0
: minimum length (to be initialized at 10000 - 100 = 9900),
: maximum length (to be initialized at 10000 + 100 = 10100),
: good parts counter,
: bad parts counter,
: START push-button,
: STOP push-button,
: FORCE push-button.
: belt control.
Note
The way this example is programmed is just one of many possible solutions. It has the advantage of using the structured programming possibilities offered by the PL7-3 Grafcet language, but can only be used on a compatible PLC (TSX 47-30 / 67-20 / 87-30 and the model 40 range). However, it can easily be transcribed into PL7-2 language and used on the TSX 47-20.
• The configuration and initialization of the module are written in the Master task in Grafcet language
(CHART or macro-step).
•The operating routines are written in the Interrupt task for the counting of the parts, and in the Post-
processing module for the acquisition of the operator commands and for fault processing.
___________________________________________________________________________
58
Programming 5
___________________________________________________________________________
Programming of the Sequential module in the Master task
On power-up, INIT/RUN program
0
1
2
3
4
IW5,0,3
Not IW5,0,C
TXT0,D
. Not IW5,0,B
IW5,0,C
Module available (self-tests finished)
< RESETTING OF COMMANDS
!
0 → O5,0 [8]; 0 → OW5,0,0; 0 → W120 [2]
Module stopped and not configured
< CONFIGURATION
!
H'0563 → TXT0,M; H'0040' → TXT0,C;
16
→
TXT0,L; EXCHG TXT0
Exchange ended and not waiting for configuration
< RUN MODULE
!
SET OW5,0,C
Module running
< INITIALIZATION: Preset, Thresholds, Outputs
!
0 → OW5,1; 0 → OW5,2; W101 → OW5,3;
0 → OW5,4; W102 OW5,5 0 → OW5,6;
H'0212' → OW5,7
< VALIDATION OF COUNTER, FAULT ACKNOWLEDGMENT
!
SET 05,0; SET O5,7
< VALIDATION OF IT
!
SET OW5,0,4; DMASKINT (I5); START CRL1
___________________________________________________________________________
59
___________________________________________________________________________
Programming of the Post-processing module in the Master task
Acquisition of operator commands and fault processing.
I0,0 I0,1 B0
B0 O1,0
I0,2
IW5,1,3
IW5,1,2
IW5,1,1
O5,3
O5,4
O5,7
Programming of the Interrupt task
Counting of the parts
< RECOGNITION OF THE MODULE AND THE ORIGIN OF THE IT
!
READINT (I5;B5)
!
IF B5 THEN READREG (I5;W0)
ELSE JUMP L10
!
!
!
IF NOT W1,C THEN JUMP L5
< COUNTING OF GOOD/BAD PARTS
IF W1,4 + W1,6 THEN INC W121
IF W1,5 THEN INC W120
! L5 ACKINT (I5)
! L10
___________________________________________________________________________
60
Programming 5
___________________________________________________________________________
5.2-2 Example of Using the Electronic Cam Function ●
Description of the application
The operation of a stamping press requires the control of various actuators (tool safety, greasing, evacuation, ejection, etc.) at precise moments in the cycle of the machine.
cam
2
0 cam 3 cam
1 ponds to that of a cam shaft; each cam being associated with an actuator.
The period of activation of a cam is defined by an angle of starting and an angle of ending.
This operation corres-
Operation of a stamping press requiring the activation of 12 actuators on each cycle, according to the following diagram: cam 6 cam 7 cam 8 cam 9 cam 10 cam 11 cam 12
Range limits cam 1 cam 2 cam 3 cam 4 cam 5
0 30 60 90 120 150 180 210 240 270 300 330 360
Choice of encoder
A suitable encoder would be one with 4096 points per turn, which corresponds to a resolution of 0.1 degree (assuming a reduction ratio of 1).
___________________________________________________________________________
61
___________________________________________________________________________
Analysis
As there are 12 actuators, the function can be implemented either:
• By using 3 TSX CCM 100 modules connected in parallel to the encoder,
• Or by adopting an architecture in which the TSX CCM 100 module acquires the measurement, compares it to the different threshold values and directly controls the first four actuators; the other 8 actuators being controlled by the processor on receipt of a command from the module (it is this second solution that is adopted in the example).
In order to obtain a fast reaction time, the Interrupt task is used. This task is activated by the module each time that the measurement crosses a starting value or an ending value. The measurement is preset to 0 before the start of normal operation.
Functional diagram
IT task
TSX CCM 100
O.0
O.1
O.2
O.3
In0
In1
In3
➤
➤
➤
➤
➤
➤
➤
A
Incremental encoder
B
Preset cam
Actuator 1
2
Actuator
3
4
Out0
1
2
6
Out7
3
4
5
TSX DST 1682
➤
➤
➤
➤
➤
➤
➤
➤
Actuator
8
9
10
11
Actuator 12
5
6
7
___________________________________________________________________________
62
Programming 5
___________________________________________________________________________
PLC configuration
S
U
P
6
5
P
4
7
3
0
1
0
0
C
C
M
6
1
2
D
E
T
1
6
8
2
D
S
T
1
I2,0 : Start press command
I2,1 : Speed reached
O7,0 to 07,7 : Control of actuators
O7,8 : Start press
Configuration of the module
• 1 st part : operating mode
H’0105'
H’0005'
SL format, frequency 40 KHz, electronic cam mode validation acquisition/capture by input In or CPU / preset by In and CPU
H’1100'
H’0001' modulo, outputs validated by CPU / In3 active on rising edge
H’0000'
0
IT if threshold crossed not used not used
0
4096 not used modulo (range of the measurement)
• 2 nd part : threshold values
H’0B1F’ state of outputs between 0 and 30 degrees, 12 thresholds
341
H’3000'
683
H’F000'
1024
H’A000'
1365
H’8000'
1707
H’8000'
2048
H’8000'
2389
H’8000'
2731
H'8000'
3072
H’8000'
3413
H’1000'
3756
H’0000' value of 1st threshold : 30 degrees state of outputs between 30 and 60 degrees value of 2nd threshold : 60 degrees state of outputs between 60 and 90 degrees value of 3rd threshold : 90 degrees state of outputs between 90 and 120 degrees value of 4th threshold : 120 degrees state of outputs between 120 and 150 degrees value of 5th threshold : 150 degrees state of outputs between 150 and 180 degrees value of 6th threshold : 180 degrees state of outputs between 180 and 210 degrees value of 7th threshold : 210 degrees state of outputs between 210 and 240 degrees value of 8th threshold : 240 degrees state of outputs between 240 and 270 degrees value of 9th threshold : 270 degrees state of outputs between 270 and 300 degrees value of 10th threshold : 300 degrees state of outputs between 300 and 330 degrees value of 11th threshold : 330 degrees state of outputs between 330 and 0 degrees
___________________________________________________________________________
63
___________________________________________________________________________
Note : The threshold 0 is implicit.
Preparatory phase
• Configuration of the I/O of the application:
Rack 1
Rack 0
Module 0
730
1
56
2 3 4 5 6
53
7
• Configuration of the Text block assigned to exchanges with the module:
TXT0 CPL DIR BUF.ADR:W0 LENGTH:4
• Entry of the configuration of the module in the Constant mode:
CW100
CW101
CW102
CW103
CW104
CW105
CW106
CW107
CW108
CW109
CW110
CW111
CW112
CW113
CW114
CW115
: H’0105'
: H’0005'
: H'1100'
: 1
: 0
: 0
: 0
: 4096
: H’0B1F’
: 341
: H’3000'
: 683
: H’F000'
: 1024
: H’A000'
: 1365
CW116 : H’8000'
CW117 : 1707
CW118 : H’8000'
CW119 : 2048
CW120 : H’8000'
CW121 : 2389
CW122 : H’8000'
CW123 : 2731
CW124 : H’8000'
CW125 : 3072
CW126 : H’8000'
CW127 : 3413
CW128 : H’1000'
CW129 : 3756
CW130 : H’0000'
• Entry of the states of the outputs controlled by the CPU:
CW49:H’0080' state of outputs 5 to 12 between 0 and 30 degrees
CW50:H’0000' state of outputs 5 to 12 between 30 and 60 degrees
CW51:H’0000' state of outputs 5 to 12 between 60 and 90 degrees
CW52:H’0001' state of outputs 5 to 12 between 90 and 120 degrees
CW53:H’0001 ' state of outputs 5 to 12 between 120 and 150 degrees
CW54:H’0007' state of outputs 5 to 12 between 150 and 180 degrees
CW55:H’0004' state of outputs 5 to 12 between 180 and 210 degrees
CW56:H’001C ' state of outputs 5 to 12 between 210 and 240 degrees
CW57:H’0038' state of outputs 5 to 12 between 240 and 270 degrees
CW58:H’0030' state of outputs 5 to 12 between 270 and 300 degrees
CW59:H’0070' state of outputs 5 to 12 between 300 and 330 degrees
CW60:H’00C0' state of outputs 5 to 12 between 330 and 360 degrees
___________________________________________________________________________
64
Programming 5
___________________________________________________________________________
Coding used
Not used
State of actuator 12 ➤
State of actuator 6
State of actuator 5
➤
➤
Programming of the CPU
• The initialization sequence of the module is programmed in the Master task.
• The configuration of the module is systematically reloaded after each power break
(irrespective of its length) and when the module is plugged in. The event that is common to both these situations is the setting to 1 of the module ready bit (IW1,0,3) at the end of the self-tests.
• The rest of the operations, corresponding to the normal operation phase, are programmed in the Interrupt task
Interrupt task (IT)
=========================== ORIGIN OF IT
!
!
READINT(I1;B40)
IF NOT B40 THEN JUMP L10
==========================
<---------------
!
MANAGEMENT OF IT ON THRESHOLDS
READREG(I1;W10)
!
!
!
—---------------
IF W11,D.X6 THEN SET B 41 ; RESET 01,1 ;
01,0[8]
→
B42[8] ; WRITEBIT (B42 ; I1) ; JUMP L5
IF NOT X7 THEN JUMP L5
SHR 4(W11) AND H’F’ -> W11
<-------------- CONTROL OF OUTPUTS MANAGED BY CPU --------
!
CW49(W11) -> B20[8]
!
!
B20[8] -> O7,0[8]
WRITEBIT(B20;I7)
---------------------------<---------------
! L5:
ACKOWLEDGMENT OF IT
ACKINT(I1)
! L10:
! EOP
Master task - Pre-processing module
================= INITIALIZATION OF GRAFCET; DEMASKING OF IT======
!
IW1,0,3 -> B8
!
IF SY1+RE(B8) THEN SET SY21; START CTRL1
------------------ DEMASKING OF IT DURING COLD RESTART ----------
!
IF NOT B0 THEN START CTRL1; SET B0
! EOP
___________________________________________________________________________
65
___________________________________________________________________________
# 0 RTZ FAULTS; MASK IT
MODULE AVAILABLE
1 STOP MODULE
MODULE STOPPED
2 SEND MODULE CONF
CONF OK
3 RUN MODULE
MODULE RUNNING
4 VAL ACQUIRED; DMASK IT
6 MEASUREMENT PRESET
7 NORMAL OPERATION
Note :
RTZ = Reset to zero
ACK = Acknowledgement
5 ACK FAULTS
ABSENCE OF FAULTS
Master task - Chart module
========================================================================
TRANSITION : 1 from 0 to 1
===================================
IW1,0,3
TRANSITION : 2 from 1 to 2
===================================
NOT IW1,0,C
TRANSITION : 3 from 2 to 3
===================================
[TXT0,V=254].NOT IW1,0,B
TRANSITION : 4 from 3 to 4
===================================
IW1,0,C
TRANSITION : 6 from 5 to 6
===================================
NOT IW1,0,4.NOT IW1,1,1.NOT IW1,1,2.NOT IW1,1,3.I2,0
TRANSITION : 7 from 6 to 7
===================================
B41•RE(I2,1)
___________________________________________________________________________
66
Programming 5
___________________________________________________________________________
===================================================================
STEP 0 ACTION ON ACTIVATION
==========================================
----------------- MASKING OF IT -------------------------------------
!
SET OW1,0,0; RESET OW1,0,4
----------------- RESET I/O ----------------------------------------
!
0 -> O1,0[8]
! EOP
STEP 1 ACTION ON ACTIVATION
==========================================
-----------------STOP MODULE ---------------------------------------
!
! EOP
RESET OW1,0,C
STEP 2 ACTION ON ACTIVATION
==========================================
-----------------CONFIGURATION OF MODULE ---------------------------
!
CW100[31] -> W2[31]
!
H’40' -> TXT0,C; H’0163' -> TXT0,M; 62 -> TXT0,L;
EXCHG TXT0
! EOP
STEP 3 ACTION ON ACTIVATION
==========================================
----------------- RUN MODULE ---------------------------------------
! SET OW1,0,C
! EOP
STEP 4 ACTION ON ACTIVATION
==========================================
-----------------VALIDATION OF ACQUISITION
!
SET O1,0
---------------------
----------------- DEMASKING AND VALIDATION OF IT ------------------
!
RESET OW1,0,0; SET OW1,0,4; DMASKINT(I1)
! EOP
STEP 5 ACTION ON ACTIVATION
==========================================
----------------ACK OF MODULE FAULTS
!
-----------—----------------
H’47' -> TXT0,C; H’0163' -> TXT0,M; 0 -> TXT0,L;
EXCHG TXT0
-----------------ACK OF APPLI FAULTS
! SET O1,7
! EOP
-----------------------------
STEP 6 ACTION ON ACTIVATION
==========================================
-----------------MEASUREMENT PRESET
!
0
OW1,1 ; SET O1,1 ; RESET B41 ;
SET O7,8
---------------------
! EOP
STEP 7 ACTION ON ACTIVATION
===================================================================
------------------- ACTIVATION OF THE FUNCTION ------------
!
SET O1,3
___________________________________________________________________________
67
___________________________________________________________________________
5.3
Complementary Programming Information
5.3-1 Interrupt Processing
Purpose
The use of interrupts enables the user program to receive information from the module immediately without waiting for the end of the scan cycle, so that the CPU can react immediately to events signalled by the module (see Section 2.4-9).
Principle
An interrupt generated by the module has the effect of interrupting the ongoing task of the CPU and of jumping the program scan to the interrupt task (on condition that it is validated and not masked).
IT task
➤
➤
Master task
The interrupt task must then ensure: :
• The recognition of the module that generated the IT (READINT (Ixy ; Bi)),
• The processing associated with this IT,
• The acknowledgment of the IT (ACKINT (Ixy)).
The return to the task that was interrupted is effected automatically.
Note
Interrupts cannot be processed by the TSX 47-20.
Use of the interrupt bits
The user program has several ways of enabling or masking interrupts generated by the module and of receiving interrupt information.
At module level :
• OWxy,0,0 : at state 1, the interrupts are masked without being acknowledged, at state 0, the interrupts are transmitted on the I/O bus,
• OWxy,0,4 : at state 1, enables the interrupt system, at state 0, inhibits the interrupt system and acknowledges the ongoing IT requests (but does not memorize subsequent requests)
At CPU level :
• The instruction DMASKINT (Ixy) enables the processing of interrupts from the module with the address xy,
• The instruction MASKING (Ixy) prevents the processing of the interrupts, but which remain memorized
___________________________________________________________________________
68
Programming 5
___________________________________________________________________________
Remark
MASKINT and DMASKINT are selective instructions that can be addressed to only one module at a time.
• The instruction START CTRL1 activates the interrupt task.
• The instruction RESET CTRL1 deactivates the interrupt task. No interrupts from any module can be processed until the interrupt task has been activated.
Information available to the user program:
• IWxy,0,0 : at state 1 when an IT is generated by the module but not yet acknowledged by the CPU, goes to state 0 when the instruction ACKINT (Ixy) is executed.
• IWxy,1,9 : overflow of IT requests; at state 1 when a new IT request arrives before the previous one has been acknowledged.
___________________________________________________________________________
69
___________________________________________________________________________
Functional diagram
MODULE CPU
Origin of IT
Th0
Th1
Capture
Preset
Valid.
Tachometer period
OWxy,0,4 Application
IT request
OWxy,0,0 Bus
IT request
DMASKINT
MASKINT
Start
Reset
CTLR1
CPU processing
Other modules
The IT is processed if :
- it is validated
- it is not masked
- the demasking command has been given
- the IT task is activated
Notes
If an IT request is received while the IT is masked, the request is maintained until is it acknowledged by the instruction ACKINT (Ixy) from the CPU.
Each interrupt must be processed and acknowledged by the CPU.
If an IT request occurs before the previous one has been acknowledged, it is memorized and then transmitted to the CPU after the previous IT has been acknowledged.
I/O exchanges in the IT task
The I/O image tables are updated on each scan cycle of the task in which the module is configured.
In order to operate in real-time, the exchanges between the module and the IT task must be executed by the following explicit exchange instructions:
• READBIT (Ixy;Bz)
• WRITEBIT (Bz;Ixy)
• READREG (Ixy;Wz)
• WRITEREG (Wz;Ixy)
: Reading of 8 discrete bits Ixy,i,
: Writing of 8 discrete bits Oxy,i,
: Reading of 8 register words IWxy,i,
: Writing of 8 register words OWxy,i.
These explicit exchanges do not update the I/O image tables of the periodic tasks.
There is therefore a risk of inconsistency between the values given to a bit or word in the
I/O image tables and the values given to them by the explicit exchanges. It is therefore essential to record the exchanges effected in the IT task in the I/O image tables.
Example of IT task
Refer to the example in Section 5.2.
___________________________________________________________________________
70
Programming 5
___________________________________________________________________________
5.3-2 Fault Processing
Diagnostic table
This table enables the operator to quickly determine the status of the module by reading the states of the following bits, bits extracted from words and indicator lights.
The bits can be accessed by a terminal in the Data or Debug modes, and on the TSX
T407 terminal in the Adjust mode.
I/O bits
Register words Lights (1)
IWxy,1,
Ixy,S bit 6 bit 8 bit A bit 9 bit 3 FAIL
0 / / / / / 0
OK
1
1
1
1
/
1
1
1
/
0
/
0
1 /
/
/
/
/
/ 1
0
0
Diagnostic Action
0
Module OK /
Change the module
0 Module Read the fault fault bits
0
Module failed
Terminal block Close the open block
0 / 0 0 1 / 0 0
0 / 0 0 0 1 0 1
Too many
IT requests
Counting overrun
/
Acknowledge the fault
(1) 0 = indicator light out, 1 = indicator light on.
Reading the fault bits
In order to know the type of fault and acknowledge it, the fault bits must be read when
IWxy,0,6 = 1.
The "Read fault bits" request (see Section 5.3-3) is used to access the following reception table:
F E D C B A 9 8 7 6 5 4 3 2 1 0
Wi
Wi+1 1 1 1 1
Terminal block fault
Direction discriminator fault
Output fault(s)
Input fault(s)
The presence of any one of these faults forces the module into the STOP mode.
___________________________________________________________________________
71
___________________________________________________________________________
Overrun fault
Iwxy,1,3 is set to 1 for an overrun fault of:
• The current value in the counter, up/down counter and position measurement functions,
• The elapsed time in the timer function,
• The number of pulses per unit of time in the tachometer function,
• The calculation of thresholds with hysteresis,
• The preset value if a modulo is used.
CPU fault and output safety system
The module can be set to operate in one of the following three modes of operation when the CPU stops or fails:
• Outputs of the module reset to 0 (default mode),
• Outputs of the module set to a predefined state (i.e. application of the default code defined in the configuration),
• Complete autonomy, i.e. the module continues to operate normally.
The required mode of operation is determined by the setting of bit OWxy,0,E during the configuration and the selection or not of the default mode (see Section 3.2).
OWxy,0,E
0
1
With default mode Without default mode
Outputs reset to zero
Application of the default code Normal operation
When bit OWxy,0,E is at 1, the output safety system is switched off.
If the CPU stops or fails, the status word bit IWxy,1,1 is set to 1 by the module and can be reset to zero by the acknowledgment command (rising edge on Oxy,7).
Power failure (PWF)
In the case of a power failure of more than 10ms but less than the autonomy of the power supply (~ 200ms):
The outputs of the module are reset to 0, the application context is saved and the PWF flag bit IWxy,1,2 is set to 1.
The registers are no longer updated, but the inputs remain active.
On power return, the module resumes normal operation. The PWF flag bit IWxy,1,2 must be reset by an acknowledgment command (rising edge on Oxy,7).
In the case of a power failure of more than the autonomy of the power supply:
The physical outputs of the module are reset to 0. On power return, the module is initialized as shown in the operating mode flowchart in Section 2.2.
___________________________________________________________________________
72
Programming 5
___________________________________________________________________________
5.3-3 Complementary Requests
Apart from loading the configuration, the processor of the PLC can also exchange various other types of information with the module by means of CPL type Text function blocks.
List of standard request codes
Request
Write configuration
Read configuration
Read fault bits
Write application name
Read application name
Read module version No.
TXTi,C TXTi,M TXTi,V No. of No. of
(hexa) (hexa) (hexa) bytes bytes written read
40 63 FE/FD 16/18 0
41 63 71/FD 0 16/18
47
49
4A
F
63
63
63
63
77/FD
FE/FD
7A/FD
3F/FD
0
≤
20
0
0
4
0
≤
20
27
Module status
STOP
RUN/
STOP
RUN
RUN/
STOP
RUN/
STOP
RUN/
STOP
Note
For TXTi,V the code FD = exchange error report.
List of specific request codes
Request TXTi,C TXTi,M TXTi,V No. of No. of
(hexa) (hexa) (hexa) bytes bytes written read
01 00 31/FD 0 6 or 10 Read the parameters
before PWF (power
failure)
This table can be composed of single or double length words.
• In single length format : 3 words
Module status
RUN/
STOP
Wi
Wi + 1
Wi + 2
SPACE / TIME
CAPTURED VALUE
CURRENT VALUE
___________________________________________________________________________
73
___________________________________________________________________________
• In double length format : 5 words
Wi
DWi + 1
DWi + 3
SPACE / TIME
CAPTURED VALUE (pf)
CAPTURED VALUE (PF)
CURRENT VALUE (pf)
CURRENT VALUE (PF)
Request TXTi,C TXTi,M TXTi,V No. of No. of
(hexa) (hexa) (hexa) bytes bytes written read
F7 63 F8/FD 4 2 Read configuration
error code
This request identifies errors in the configuration parameters:
The transmission tables must consist of : H'8C99 in Wi + 1
H'0100' in Wi + 2
The reception table consists of :
Error code
Wi =
15 7 and must be reset to 0 before the transmission of the request..
0
Module status
RUN/STOP
___________________________________________________________________________
74
Programming 5
___________________________________________________________________________
List of error codes
18
19
20
21
14
15
16
17
22
23
:
24
37
10
11
12
13
06
07
08
09
Error codes
00
01
00H
01H
02
03
04
05
02H
03H
04H
05H
06H
07H
08H
09H
0AH
0BH
0CH
0DH
25H
0EH
0FH
10H
11H
12H
13H
14H
15H
16H
17H
18H
Parameters
No error
FUNCTION (type of function)
COUNT-IN (counting input mode)
FILTER (type of filter of inputs In0, In1, In2)
SL-DL
LOGIC
(single or double length format)
(Boolean logic of physical inputs and CPU)
TH-DET
PRST-TH
HYSTER
FORCING
EDGE-IN3
VAL-OUT
MODULO
IT-EVENT
(type of threshold detection)
(type of preset on threshold detection)
(operation with or without hysteresis)
(type of forcing of physical outputs)
(type of active edge of In3)
(validation of physical outputs)
(operation with or without modulo)
(selection of events generating interrupts)
DEFMODE (operation with or without default mode)
DEFCODE (definition of default code)
TIME-PER (definition of timer period)
TACH-PER (definition of tachometer period)
HYS-VAL
MOD-VAL
(definition of hysteresis value)
(definition of modulo value)
Reserved
Thresholds/Outputs configuration header
Number of thresholds
Threshold No. 1
Threshold No. 2
Threshold No. 15
___________________________________________________________________________
75
___________________________________________________________________________
___________________________________________________________________________
76
X
6.1
Installation
6.1-1 Possible Locations
6.1-2 General Rules
6.1-3 Module Locating Codes
6.2
Identification
6.3
Wiring
6.3-1 Type of Terminal Block
6.3-2 Wiring Precautions
6.3-3 Sensors Used
Installation and Wiring 6
Section 6
Page
78
78
78
79
79
80
80
80
81
___________________________________________________________________________
77
___________________________________________________________________________
6.1
Installation
6.1-1 Possible Locations
As a general rule, the TSX CCM 100 module can be installed in any rack that is equipped with the complete bus.
Slots 0 to 3. Interrupt outputs not available
Slots 0 to 7.
Basic configuration TSX 47 20..
Basic configuration
(single rack)
V3 PLCs
Basic configuration
(double rack)
V3 PLCs
Basic configuration
(single rack)
TSX 47 300 .
TSX 67 200 .
TSX 87 300 .
TSX 47.40 (1)
TSX 67.40
TSX 87.40
TSX 107.40
Model 40 PLCs
Local extension racks
Remote extension racks
(1) Except processor TSX P47-400.
TSX RCE 860
TSX RCE 860
Slots 0 to 7.
Slots 0 to 7.
Any slot.
Any slot.
_________________________________________________________________________
6.1-2 General Rules
As the TSX CCM 100 has a high pass-band, it should be kept away from all sources of electromagnetic radiation.
It is therefore preferable to keep the module away from all components carrying or switching high voltages.
Caution
The TSX CCM 100 module must never be installed in the upper half of a double rack
(wiring impossible and risk of destruction).
___________________________________________________________________________
78
Installation and Wiring 6
___________________________________________________________________________
6.1-3 Module Locating Codes
The TSX CCM 100 module has two types of locating codes:
The hardware code, which is set at the factory by the positions of the 3 female locating devices on the back of the module.
The software code, which is entered on the terminal during the configuration of the module.
TSX 47-20
730
63
Others
730
730
_______________________________________________________________________
6.2
Identification
Plug-in characters and labels
1 Plug-in characters:
Used to identify the location of the module and the terminal block.
2 Technical label:
Used to identify,
. The type of module,
. The assignment of the indicator lights.
3
User's label:
Used to identify,
. The type of module,
. The I/O by means of mnemonics
4 Wiring label :
Stuck inside the cover of terminal block
TSX BLK 4 and used to identify the terminals.
2
OF
0K
O0
O1
O2
In0
In1
In2
In3
In4
3
1
4
1
___________________________________________________________________________
79
___________________________________________________________________________
6.3
Wiring
6.3-1 Type of Terminal Block
The TSX CCM 100 module uses the TSX BLK 4 terminal block which has 32 screw terminals. The terminal block is wired according to the user's requirements and the type of configuration adopted.
Signals
Input In4
Input In3
Input In2
Input In1
Input In0
Unused
Unused
Output O,0
Output O,1
Output O,2
Output O,3
24Vs
0Vs
Unused
Ground
24V
24V
24V
5V
24V
24V A3
A2
A1
B8
B7
A8
A7
A6
A5
A4
B3
B2
B1
B6
B5
B4
Terminal block
TSX BLK 4
In4
C1
In3
C2
In2
C3
In0
C4
In1
C5
C6
D3
D4
D5
D6
D7
D8
C7
C8
D1
D2
5V
_
_
_
_
_
5V
The terminals marqued must not be used.
Signals
Input In4
Input In3
Input In2
Input In1
Input In0
Unused
Unused
Unused
Unused
Unused
Unused
Unused
Unused
Ground
_________________________________________________________________________
6.3-2 Wiring Precautions
In order to protect the signals from induced noise in the serial and common modes, the following precautions should be observed:
• Type of cables
Use shielded or twisted cables of at least 0,22 mm 2 (AWG 24).
• Shielding
Connect the shielding to the PLC ground through the TSX RAC 20 grounding strip, which must be installed on the rack of the PLC.
___________________________________________________________________________
80
Installation and Wiring 6
___________________________________________________________________________
• Sensors
Use floating sensors (without reference to ground).
• Cable routing
Keep the counting signal wires away from the discrete I/O wires (especially relay output wires) and power cables.
Avoid close parallel runs (the cables should be at least 8 inches apart) and make the crossings at right angles.
_______________________________________________________________________
6.3-3 Sensors Used
For inputs In0, In1, In2, :
• 24 VDC 2-wire or 3-wire proximity detectors to CENELEC standards,
• 5 or 24 VDC incremental encoder.
For inputs In3 and In4, :
• 24 VDC 2-wire or 3-wire proximity detectors to CENELEC standards.
Connection of encoders to In0, In1, In2
The encoders must have open collector outputs or totem-pole outputs.
In its range of rotary encoders, Telemecanique proposes a number of incremental encoders (with NPN or PNP outputs) that are compatible with the TSX CCM 100 module.
Note
Telemecanique does not guarantee the module if it used with encoders with differential outputs.
In+
+VDC
+ VDC
In-
V out
➤
NPN output
0V
➤
V out
0V
PNP output
0V
In+
In-
___________________________________________________________________________
81
___________________________________________________________________________
Connection No. 1 :Wiring with common shielding (case of a NPN encoder)
5V 0V InV
(5V or 24V)
TSX CCM 100 module
VCC
(5V)
A
B
Zero mark
0 V
R R R
In0 / In1 / In2
(5 or 24V)
In0 (-)
In1 (-)
In2 (-)
TSX RAC 20
Encoder XCC HD7R20 or similar
Connection No. 2 : Wiring with shielded pairs (case of a NPN encoder)
5V 0V InV
(5V or 24V)
TSX CCM 100 module
VDC
(5V)
R R R
In0 / In1 / In2
(5 or 24V)
A
B
In0 (-)
In1 (-)
In2 (-)
Zero mark
0 V
TSX RAC 20
Encoder XCC HD7R20 or similar
In both these types of connection, resistors can be inserted on the encoder side to increase the permissible input frequencies (see the graphs on the next page).
Resistor values : R = 1,5 Kohms for InV = 24 V,
R = 330 ohms for InV = 5 V.
___________________________________________________________________________
82
Installation and Wiring 6
___________________________________________________________________________
The graphs below show the maximum permissible length of cable between the module and the encoder (depending on the input supply voltage, the input frequency desired and the type of connection used), with a direction discriminator and for AWG 24 cable with a capacitance of 52 pF per meter.
Open collector encoders
Input voltage = 24V
Frequency (KHz)
Input voltage = 5V
Cable : AWG 24 C = 52 pf / m
With resistors
Without resistors
40 40 ➤
35 35
➤
30
25
30
25
20 20
15
10 ➤ ➤
15
10
5
0
10 20 30 50 100 200
Max. length for
Connection No.1
Max. length for
Connection No.2
➤
5
0
10
Lengths (m)
20
➤
30 50 100 200
Max. length for
Connection No.1
Max. length for
Connection No.2
Note
Encoders with totem-pole outputs can deliver input frequencies of 40 KHz up to a distance of 50 meters with either type of connection (1 or 2).
Connection of proximity detectors to In0 to In4
As these inputs are independent of each other, each sensor can be connected independently.
Connection of a 2-wire polarized or non-polarized detector to In0:
O V 24 VDC
+ BN (Brown)
TSX BLK4
In0
BL (Blue)
A3
C6
___________________________________________________________________________
83
___________________________________________________________________________
Connection of a 3-wire PNP detector to In0
O V 24 VDC
+ BN (Brown)
TSX BLK4
In0
-
BK (Black)
BL (Blue)
A3
C6
___________________________________________________________________________
84
X
Specifications
7.1
Power Consumption
7.2
I/O Characteristics
7.3
Performance Characteristics
7.3-1 Internal Functions
7.3-2 Interrupt Function
Specifications 7
Page
86
86
88
88
88
___________________________________________________________________________
85
___________________________________________________________________________
7.1
Power Consumption
The power for the TSX CCM 100 module is supplied by the PLC.
_____________________________________________________________________________________
Maximum consumption
400 mA
30 mA
150 mA
____________________________________________________________________________________________________
40 days at 25
°
C (20 days at 45
°
C)
40 hours at 45
°
C
________________________________________________________________________________
7.2
I/O Characteristics
_____________________________________________________________________________________________
Counting inputs In0, In1, In2
These inputs are compatible with:
• 5 or 24 VDC incremental encoders with NPN open collector or totem pole outputs,
• Telemecanique 2- or 3-wire 24 VDC proximity detectors.
______________________________________________________________________________
5 VDC 24 VDC
12,5 mA 15 mA
Typical power dissipated
4,75 to 7 V
370 to 430 ohms
> 3,75 V
> 7mA
< 1,5 V
< 2 mA
< 30 ohms
> 30 kohms
62,5 mW
19,2 to 30 V
1,5 to 1,7 kohms
> 11 V
> 6 mA
< 5 V
< 2 mA
< 500 ohms
> 30 kohms
0,36 W
(1) For a voltage drop of 0.3 V at the encoder output.
___________________________________________________________________________
86
Specifications 7
___________________________________________________________________________
5 VDC
- 5 V
- 12 V
10 V
12 V
2 kHz filter
30 to 100
µ s
24 VDC
- 25 V
- 48 V
30 V
48 V
40 kHz filter
1 to 4
µ s
Auxiliary inputs In3, In4
Inputs compatible with proximity detectors to CENELEC standards.
_____________________________________________________________________________
24 VDC
Typical power dissipated
16,5 mA
19,2 to 30 V
1360 to 1560 ohms
> 11 V
> 6 mA
< 5 V
< 2 mA
< 500 ohms
> 30 kohms
50 to 250
µ s
0,43 W
Protection : The same as for the 24 V inputs In0, In1, In2.
Transistor outputs
___________________________________________________________________________________________________________
24 VDC
300 mA
19,2 to 30 V
100
µ s
350
µ s
The transistor outputs are protected against short-circuits.
General characteristics
_________________________________________________________________________________________________________
1500 Veff
500 Veff
___________________________________________________________________________
87
___________________________________________________________________________
7.3
Performance Characteristics
7.3-1 Internal Functions
Event
↑
In2
↑ or
↓
In3
↑
In4
Crossing a threshold
Generation of IT
Associated operation
Counting validation
Preset
Capture
Positioning of outputs
Presence of IT on the bus
Processing time
≤
550
µ s
≤
700
µ s
≤
570
µ s
350 to 1500
µ s
≤
5 ms
___________________________________________________________________________
7.3-2 Interrupt Function
The time required to activate the Interrupt task in the TSX Series 7 PLCs is the sum of two times (tic + tip).
• tic :
Time between the change of state of the interrupt input and the presence of the IT signal on the I/O bus.
This time is equal to or less than 5 ms for the TSX CCM 100 module.
• tip :
Time between the presence of the IT signal on the I/O bus and the activation of the
Interrupt task. This time, which is the same whether the module is located in the basic or an extension rack, depends on whether or not remote extension racks are used, as shown in the table below.
Maximum time
Local I/O (TSX LES) Remote I/O (TSX LFS) tip
TSX 47-30
TSX 67-20
TSX 87-30
TSX 47-40
TSX 67-40
TSX 87-40
TSX 107-40
Basic configuration
1,5 ms
1,5 ms
1,0 ms
1,3 ms
1,3 ms
0,8 ms
0,5 ms
Extensions
-
1,5 ms
1,0 ms
-
1,3 ms
0,8 ms
0,5 ms
Basic configuration
-
2,2 ms
1,7 ms
-
2,0 ms
1,5 ms
1,0 ms
Extensions (1)
-
2,2 ms
1,7 ms
-
2,0 ms
1,5 ms
1,0 ms
(1) Reminder of maximum distances for remote intelligent modules:
• TSX 67-20 : 750 m maximum,
• TSX 87-30 : 1000 m maximum.
___________________________________________________________________________
88
Appendix 8
___________________________________________________________________________
8.1
Internal Operation of the Module
The information given in this section is not essential for the operation of the module, but can be useful in cases where the module is used to the maximum of its possibilities.
_________________________________________________________________________
8.1-1 Principle
The architecture of the module is built around an 8032 microprocessor (
µ
P).
In0
In1
In2
In3
In4
T0
T1
µP 8032
IT
EXT
Precounters
CPT 0
CPT 1
Working registers
Th 0
Th 1
Current value
Preset value
Captured value
The inputs In0 and In1 are connected to the counting inputs T0 and T1 of the
µ
P, each one being associated with an 8-bit register (T0 upcount, T1 downcount).
The inputs In2, In3 and In4 are grouped on the IT EXT input of the
µ
P.
The module works on a current value register of 16/32 bits which is updated from the precounting registers every 833
µ s, or when a capture command is received, according to the following formula:
CURRENT VALUE (N) = CURRENT VALUE (N-1) + CPT0 (N) - CPT1 (N)
On a preset command, the current value register is loaded with the contents of the preset register and the precounters are reset to 0.
On a capture command, the captured value register is loaded with the contents of the current value register after it has been updated.
The comparison of the current value with the thresholds is also synchronized by the 833
µ s clock pulse, i.e. with the updating of the current value register.
___________________________________________________________________________
89
___________________________________________________________________________
8.1-2 Processing Times
Since the validation, capture and preset commands generate the same IT, it is necessary to prioritize them as shown opposite.
Capture
Preset
Validation
+ order of priority
-
In addition, as all the operations are performed by software, they require a certain amount of processing time and are liable to be interrupted by an operation of higher priority.
The table below shows the maximum execution time for each operation, taking into account both these factors.
For operations triggered by external events, the processing time equals the time between the presence of the event on an input and the moment when the associated processing is ended, including the signal propagation time.
Operation
Validation
Preset
Capture
Crossing of a threshold
Activation of outputs
(In2)
(In3)
(In4)
Processing time
≤
550
µ s
≤
700
µ s
≤
570
µ s
≤
1150
µ s
350
µ s
From this table it can be seen that the time required to activiate the outputs when the current value crosses a threshold is betxween 350 and 1500
µ s.
Order of priority of the tasks,
• Precounting overflow,
• External event (In2, In3, In4),
• 833
µ s periodic task (updating of current value, comparison with thresholds, updating of outputs),
• K x 10 ms periodic task (for the tachometer function only, synchronized with the clock period of the tachometer function)
• 5 ms background task (activated when no other task is active) comprising:
- Acquisition of CPU commands via Oxy, i and OWxy,i,
- Updating of information for the CPU via Ixy,i and IWxy,i.
___________________________________________________________________________
90
Appendix 8
___________________________________________________________________________
Diagram of the different levels of information available
TSX CCM 100 module CPU
Hardware Software
Working register
Precounter
833 µs
▲
▲
IT
Current value
Captured value
I/O image table in shared memory
Period
5 ms
I and IW task
I/O image table in CPU memory
Master period
I and IW
Preset
Thresholds
O and OW O and OW
Master task
! IF IWxy,i,j
! W100 OW
Periodic task
833µs
IT task
! WRITE REG.
___________________________________________________________________________
91
___________________________________________________________________________
8.2
Glossaire
Cam ........................................ A raised plate or boss on an axis which actuates a limit switch when a mobile passes over it.
Captured value ..................... Image of the current value at a given moment.
CPU ........................................ Central processing unit (of the PLC).
Current value ........................ The sum of the pulses being counted.
Default code A code (defined during configuration) that determines the states of the outputs.
Default mode ......................... A mode which enables the outputs to be reset according to the
Default code.
Direction discriminator ........ A microprogram which indicates the direction of movement.
Double length ....................... The counting capacity defined by 31 bits + sig, i.e. -2 147 483 648 to +2 147 483 647.
Event ...................................... A change of state of one of the inputs.
Hysteresis ............................. An adjustable delay in activating the outputs after a threshold is crossed.
Incremental encoder ............ A device for measuring movement that generates a pulse for each increment of linear or rotary movement. The direction is defined by two phase-shifted signals.
Interrupt ................................. A signal sent by the module to the CPU (on the detection of an internal or external event) which has the effect of jumping the program scan from the ongoing task to the Interrupt task
Modulo ................................... A positive number which defines the upper limit of the counting range, when this number is reached the count restarts at zero.
Position measurement ......... The counting of pulses. for the purposes of controlling the movement of a mobile.
Preset .................................... The presetting of the current value to a value selected by the user.
Reference point set-up ........ Loading the preset value into the current value on the occurrence of an event.
Safety system ....................... A system which when set to ON (OWxy,0,E=0) resets the outputs to 0 in case of a CPU failure, I/O reset or program stop; and when set to OFF (OWxy,0,E=1) maintains the outputs or resets them according to a Default code.
Single length ......................... The counting capacity defined by 15 bits + sign, i.e. -32768 to
+32767.
Tachometer function ............ The measurement of speed.
Threshold .............................. A preset value that is compared with the current or captured value or number of pulses per unit of time.
Timer function ...................... The counting of units of time.
Validation .............................. action d'autoriser le comptage et le décomptage des impulsions d'entrées.
Zero mark .............................. A pulse delivered by the encoder on each complete turn of the shaft.
___________________________________________________________________________
92
Appendix 8
___________________________________________________________________________
8.3
Index
C Cam ......................................................................................
Capture .................................................................................
Comparisons .........................................................................
Configuration .........................................................................
Counter function ....................................................................
Counting overrun ...................................................................
Counting range ......................................................................
Current value .........................................................................
D Default code ..........................................................................
Default mode .........................................................................
Discrete I/O bits .....................................................................
E Electronic cam ● ...................................................................
Exchanges with the PLC .......................................................
F Fault processing ....................................................................
I Interrupts ...............................................................................
Inputs/outputs ........................................................................
M Module locating codes ...........................................................
Modulo ..................................................................................
O Operating modes ...................................................................
Output matrix .........................................................................
Outputs .................................................................................
P Position measurement ...........................................................
Preset ....................................................................................
R Reference point set-up ..........................................................
Requests ...............................................................................
Run module ...........................................................................
S Safety system ........................................................................
Stop module ..........................................................................
T Tachometer function .............................................................
Thresholds ............................................................................
Timer function .......................................................................
U Up/Down counter function .....................................................
V Validation ..............................................................................
Z Zero mark ...............................................................................
10
___________________________________________________________________________
93
___________________________________________________________________________
8.4
Discrete I/O Modules and Registers
Discrete I/O
Input : read by CPU
Output : written by CPU
I or Q x y,i
Addressing
Register words
IW or OW x y,i
Bit number
Slot number
Rack number
Input : read by CPU
Output : written by CPU
Bit number
Slot number
Rack number
Discrete I/O bits
F E D C B A 9 8 7 6 5 4 3 2 1 0
Ixy,8 1 = if voltage on input In2
Ixy,9 1 = if voltage on input In3
Ixy,A 1 = if voltage on input In4
Ixy,B Reserved
Ixy,C 1 = if voltage on input O.0
Ixy,D 1 = if voltage on input O.1
Ixy,E 1 = if voltage on input O.2
Ixy,F 1 = if voltage on input O.3
8 input word registers
(words read by CPU)
Standard status word IWxy,0
F
IWxy,1
F
IWxy,2
Complementary status word
Reserved
O
O
Number of pulses per period IWxy,3
IWxy,4
IWxy,5
Captured value (LSB)
Captured value (MSB) (*)
Oxy,0 1 = counting validation command
Oxy,1 1 = current value preset command (*)
Oxy,2 1 = capture of current value command (*)
Oxy,3 1 = physical output validation command
Oxy,4 1 = physical output forcing command
Oxy,5 Reserved
Oxy,6
Oxy,7
Reserved
↑
= fault acknowledgement command
(*) Bits activated by a state or an edge,
depending on the choice made during
configuration (LOGIC and EDGE-IN3
nibbles).
8 output word registers
(words written by CPU)
OWxy,0
OWxy,1
F
Standard command word
Preset (LSB)
O
OWxy,2 Preset (MSB) (**)
OWxy,3
OWxy,4
Threshold 0 (LSB)
Threshold 0 (MSB) (*)
OWxy,5 Threshold 1 (LSB)
IWxy,6 Current value (LSB) OWxy,6 Threshold 1 (MSB) (*)
IWxy,7 Current value (MSB) (*) OWxy,7
F
Complementary command word
O
(**) Not significant in single length
___________________________________________________________________________
94
Appendix 8
___________________________________________________________________________
IWxy,0 Standard status IWxy,1 Complementary status word
F E D C B A 9 8 7 6 5 4 3 2 1 0 F E D C B A 9 8 7 6 5 4 3 2 1 0
0 1 = IT CCM
→
CPU , reset to 0 on ACK
1 Reserved
2 1 = R.T.Z. of message system (text block)
3 1 = Module available
4 1 = General fault or memorization of fault
5 Reserved
6 1 = Specific non-blocking fault
7 Reserved
8 1 = Module inoperative
9 1 = Self-tests in progress
A 1 = Terminal block not locked
B
1 = Awaiting configuration
0 = Module configured
C
1 = Module running
0 = Module stopped
D Reserved
E 1 = Default mode
F 1 = Output states not validated
Note:
RTZ = Reset to zero
ACK = Acknowledgement
0
Counting direction 1 : Incrementing
0 : Decrementing
1
1 = CPU fault (RTZ by ACK or when
module stops)
2
1 = Power break (RTZ by ACK or when
module goes to NCONF)
3 1 = Internal counting overflow (RTZ by ACK)
4 1 = Current value < both thresholds
5
6
1 = Current value between the thresholds
1 = Current value
≥
Th1 and ≥ Th0
Reserved 7
8
9
Reserved
1 = IT waiting in the module
A
1 = IT generated by the crossing of Th0
(RTZ by ACK of IT)
B
1 = IT generated by the crossing of Th1
(RTZ by ACK of IT)
C
1 = IT generated by capture input
(RTZ by ACK of IT)
D
1 = IT generated by preset input
(RTZ by ACK of IT)
E
1 = IT generated by validation input
(RTZ by ACK of IT)
F
1 = IT generated by tachometer clock
(RTZ by ACK of IT)
IWxy,2 Complementary status word
F E D C B A 9 8 7 6 5 4 3 2 1 0
(*) In the electronic cam mode, the nibble
formed by these 4 bits gives the number
of the threshold immediately below the
current value.
(**) Or by crossing any threshold in the
electronic cam mode.
0000 : code 0 = counter mode
0001 : code 1 = up/down counter mode
0010 : code 2 = timer mode
0011 : code 3 = position measurement mode
0100 : code 4 = tachometer mode
0101 : code 5 = electronic cam mode (thresholds/outputs not configured)
1101 : code 13 = electronic cam mode (thresholds/outputs configured).
___________________________________________________________________________
95
___________________________________________________________________________
0Wxy,0 Standard command word 0Wxy, 7 Complementary command word
OUTPUT MATRIX
F E D C B A 9 8 7 6 5 4 3 2 1 0 F E D C B A 9 8 7 6 5 4 3 2 1 0
0
2
1 = Masking of the interrupt
↑
= RTZ of message system (text block)
4 1 = Overall validation of the sources of
interrupts
C 1 = Module switched from to STOP to RUN
0 = Module switched from to RUN to STOP
E 1 = Module operating in the Default mode
F 1 = Forcing of the outputs to zero
0
1
State of the transistor outputs when : current value
≥
Th1 and
≥
Th0
3 2 1 0
Outputs
2
3
O.0
O.1
O.2
O.3
4
5
State of the transistor outputs when : current value is beetween the thresholds
7 6 5 4
Outputs
6
7
O.0
O.1
O.2
O.3
8
9
State of the transistor outputs when : current value < both thresholds
B A 9 8
Outputs
A
B
O.0
O.1
O.2
O.3
C Reserved
D Reserved
E Reserved
F Reserved
___________________________________________________________________________
96
TSX CCM 100 connections
Signals
Input In4
24V
Input In3
24V
24V
Input In2
5V
Input In1
Input In0
Unused
Unused
Output O0
24V
24V
Output O1
Output O2
Output O3
24Vs
0Vs
Unused
A8
A7
A6
A5
A4
A3
A2
A1
B8
B7
B6
B5
B4
B3
B2
Ground
B1
TSX BLK 4
D1
D2
D3
D4
D5
D6
D7
D8
In4
C1
In3
C2
In2
C3
C4
In1
C5
In0
C6
C7
C8
-
-
-
-
5V
-
5V
Signals
Input In4
Input In3
Input In2
Input In1
Input In0
Unused
Unused
Unused
Unused
Unused
Unused
Unused
Unused
Ground
Indicator lights
TSX CCM 100
F
OK
R0
R1
R2
In0
In1
In2
In3
In4
Red = Module failed
Green = Module powered-up and operating correctly
Red = Outputs activated (4th output not displayed)
Red = Inputs supplied or at state 1.
2
General characteristics
• Installation : TSX 47-30/67/87 :in racks with the complete bus,
TSX 47-20 : in the first 4 slots of basic configration rack.
• Module hardware code : 730 • Module software code : 63 for TSX 47-20
730 for other types of processor
• Response to power break (PWF) :
- PWF > 10ms and < the autonomy of PLC power supply unit :
. The bit IWxy,1,2 is set to 1 (reset to 0 by a rising edge on Oxy,7),
. The physical outputs are reset to 0.
- PWF > the autonomy of PLC power supply unit :
. The bit IWxy,1,2 is set to 1,
. The physical outputs are reset to 0.
. On power return, the module is automatically initialized.
In all cases, the software configuration is saved by the internal battery of the module.
TSX CCM 100 module
Zero mark or validation
Preset
Capture
In 0
In 1
In 2
In 3
T
S
I
N
P
U
In 4
Contactors
O.0
O.1
O.2
O.3
U
T
S
T
P
O
U
➡ ➡
Selected preprogrammed function
Configuration
➡ ➡
Ixy,8 to F Ixy,0 to 7
8 output register words
OWxy,0 to OWxy,7
8 intput register words:
IWxy,0 to IWxy,7
Request interpreter
IT
Interface
TOR
PLC processor
User program
OW
Register interface
..
→ OWxy,z
IWxy,z
..
→
IW
Message interface
TXT
CPL
Message interface : Standard requests
Request
Write configuration
Read configuration
Read fault bits (BDEF)
Write application name
Read application name
Read module version
TXTi,C Ch. No. TXTi,V No. of
(hexa) (hexa) (hexa) bytes written
40
41
63
63
FE(FD)
71(FD)
16/18(*)
0
No. of bytes read
0
Module status
STOP
16/18(*) RUN/STOP
47
49
4A
F
63
63
63
63
77(FD)
FE(FD)
7A(FD)
3F(FD)
≤
0
20
0
0
4
0
≤
20
27
RUN
RUN/STOP
RUN/STOP
RUN/STOP
(*) 16 in single length. 18 in double length.
Message interface : Transfer characteristics
• CPL type text block in transmission/reception mode.
• TXTi,M = H’xy..’ with x = rack number, y = slot number, .. = channel number 00 ou 63.
• TXTi,C = request code.
• TXTi,V = Report sent back by the module, FD = transfer incorrect.
• TXTi,S = Number of bytes received (if transfer OK).
3
Wi or
CWi
Wi + 1 or
CWi + 1
Wi + 2 or
CWi + 2
Wi + 3 or
CWi + 3
Wi + 4 or
CWi + 4
Nibble 3
SL DL : Single or double length format
0 : single length format
1 : double length format
HYSTER : Hysteresis function
0 : without hysteresis
1 : with hysteresis
MODULO : Modulo function
0 : counting without modulo
1 : counting with modulo
DEFMOD : Default mode
X X X X output O.0
output O.1
output O.2
output O.3
X = 0 : OFF x = 1: ON
0
0 : Max. frequency = 2Khz
1 : Max. frequency = 40Khz
PRST-TH : Preset on threshold detection
0 : no preset on Th detection
1 : preset on Th0
2 : preset on Th1
VAL-OUT : Validation of physical outputs by CPU
0 : without validation by CPU
1 : with validation by CPU
0 : without default code
1 : with default code
0
Configuration
(Table of parameters)
Nibble 2
FILTER : Filtering of inputs
In0, In1 and In2
DEFCOD : Default code
Nibble 1
COUNT-IN : Counting input mode
0 : counting with direction
discriminator
1 : In0 : upcounting
In1 :downcounting
2 : In0 : up/downcounting
In1 : direction
TH-DET : threshold detection
Nibble 0
FUNCTION : Selection of the function
0 : counting
1 : up/downcounting
2 : timing
3 : position measurement
4 : tachometer
LOGIC : Logic of physical inputs and CPU commands
0 : on current value
1 : on captured value
X X X enable/disable preset capture
X = 0 : AND logic X = 1 : OR logic
EDGE IN3 : Active edge of
IN3
0 : active on a rising edge
1 : active on a falling edge
FORCING : Forcing of outputs
X X X X
Output O.0
Output O.1
Output O.2
Output O.3
X = 0 : OFF X = 1 : ON
IT EVENT : Selection of events generating interrupts
X X X X X X
Code
Hexa.
Code
Hexa.
Code
Hexa.
0 crossing of Th0 crossing of Th1 capture input pulse preset input pulse validation input pulse tachometer clock
X = 0 without IT
X = 1 with IT
TIM-PER : Timer function period
0 : 10ms
1 : 100ms
2 : 1s
3 : 10s
Code
Hexa.
Code
Hexa.
(*) Or of any threshold in the electronic cam mode.
Wi + 5 or
CWi + 5
Wi + 6 or
CWi + 6
Wi + 7 or
CWi + 7
DWi + 7 or
CDWi + 7
Configuration (Con’t)
(Table of parameters)
TACH-PER : Tachometer function period, from 1 x 10 ms to 32767 x 10 ms
HYS-VAL : Value of “H” (Hysteresis/2), from 0 to 32767 regardless of the counting format
MOD-VAL : Modulo value, from 200 to 32767 in single length; this value must be a multiple of 200
MOD-VAL : Modulo value, from 200 to 2 147 483 600 in double length, this value must be a multiple of 200
Decimal
Value
Decimal
Value
Decimal
Value
Decimal
Value
Parameters of the different functions
FUNCTION
Parameters ignored
COUNTING
COUNT-IN
TIME-PER
TACH-PER
UP/DOWN
COUNTING
TIME-PER
TACH-PER
TIMING
COUNT-IN
SL-DL
HYSTER
TACH-PER
HYS-VAL
POSITION
MEASUREMENT
EDGE-IN3
TIME-PER
TACH-PER
TACHOMETER
TH-DET
PRST-TH
TIME-PER
ELECTRONIC CAM
HYSTER
PRST-TH
HYS-VAL
Discrete I/O bits
Input : read by CPU
Output : written by CPU
I or Q x y,i
Addressing
Bit number
Slot number
Rack number
Register words
IW or OW x y,i
Input : read by CPU
Output : written by CPU
Bit number
Slot number
Rack number
Discrete I/O bits
F E D C B A 9 8 7 6 5 4 3 2 1 0
Ixy,8 1 = if voltage on input In2
Ixy,9 1 = if voltage on input In3
Ixy,A 1 = if voltage on input In4
Ixy,B Reserved
Ixy,C 1 = if voltage on input O.0
Ixy,D 1 = if voltage on input O.1
Ixy,E 1 = if voltage on input O.2
Ixy,F 1 = if voltage on input O.3
8 input word registers
(words read by CPU)
Standard status word IWxy,0
IWxy,1
F
IWxy,2
F
Complementary status word
Reserved
O
O
IWxy,3 Number of pulses per period
IWxy,4 Captured value (LSB)
Captured value (MSB) (*) IWxy,5
IWxy,6
IWxy,7
Current value (LSB)
Current value (MSB) (*)
Oxy,0 1 = counting validation command
Oxy,1 1 = current value preset command (*)
Oxy,2 1 = capture of current value command (*)
Oxy,3 1 = physical output validation command
Oxy,4 1 = physical output forcing command
Oxy,5 Reserved
Oxy,6
Oxy,7
Reserved
↑
= fault acknowledgement command
(*) Bits activated by a state or an edge,
depending on the choice made during
configuration (LOGIC and EDGE-IN3
nibbles).
8 output word registers
(words written by CPU)
Standard command word OWxy,0
OWxy,1
F
Preset (LSB)
OWxy,2 Preset (MSB) (**)
O
OWxy,3 Threshold 0 (LSB)
OWxy,4 Threshold 0 (MSB) (*)
OWxy,5 Threshold 1 (LSB)
OWxy,6 Threshold 1 (MSB) (*)
OWxy,7
F
Complementary command word
O
(**) Not significant in single length
6
IWxy,0 Standard status word
F E D C B A 9 8 7 6 5 4 3 2 1 0
IWxy,1 Complementary status word
F E D C B A 9 8 7 6 5 4 3 2 1 0
0 1 = IT CCM
→
CPU , reset to 0 on ACK
1 Reserved
2 1 = R.T.Z. of message system (text block)
3 1 = Module available
4 1 = General fault or memorization of fault
5 Reserved
6 1 = Specific non-blocking fault
7 Reserved
8 1 = Module inoperative
9 1 = Self-tests in progress
A 1 = Terminal block not locked
B
1 = Awaiting configuration
0 = Module configured
C
1 = Module running
0 = Module stopped
D Reserved
E 1 = Default mode
F 1 = Output states not validated
Note:
RTZ = Reset to zero
ACK = Acknowledgement
0
Counting direction 1 : Incrementing
0 : Decrementing
1
1 = CPU fault (RTZ by ACK or when
module stops)
2
1 = Power break (RTZ by ACK or when
module goes to NCONF)
3 1 = Internal counting overflow (RTZ by ACK)
4 1 = Current value < both thresholds
5
6
7
1 = Current value between the thresholds
1 = Current value
≥
Th1 and ≥ Th0
Reserved
8 Reserved
9 1 = IT waiting in the module
A
1 = IT generated by the crossing of Th0
(RTZ by ACK of IT)
B
1 = IT generated by the crossing of Th1
(RTZ by ACK of IT)
C
1 = IT generated by capture input
(RTZ by ACK of IT)
D
1 = IT generated by preset input
(RTZ by ACK of IT)
E
1 = IT generated by validation input
(RTZ by ACK of IT)
F
1 = IT generated by tachometer clock
(RTZ by ACK of IT)
IWxy,2 Complementary status word
F E D C B A 9 8 7 6 5 4 3 2 1 0
(*) In the electronic cam mode, the nibble
formed by these 4 bits gives the number
of the threshold immediately below the
current value.
(**) Or by crossing any threshold in the
0000 : code 0 = counter mode
0001 : code 1 = up/down counter mode
electronic cam mode.
0010 : code 2 = timer mode
0011 : code 3 = position measurement mode
0100 : code 4 = tachometer mode
0101 : code 5 = electronic cam mode (thresholds/outputs not configured)
1101 : code 13 = electronic cam mode (thresholds/outputs configured).
7
OWxy,0 Standard command word OWxy, 7 Complementary command
OUTPUT MATRIX
F E D C B A 9 8 7 6 5 4 3 2 1 0 F E D C B A 9 8 7 6 5 4 3 2 1 0
0
2
1 = Masking of the interrupt
↑
= RTZ of message system (text block)
4 1 = Overall validation of the sources of
interrupts
C 1 = Module switched from to STOP to RUN
0 = Module switched from to RUN to STOP
E 1 = Module operating in the Default mode
F 1 = Forcing of the outputs to zero
0
1
State of the transistor outputs when : current value
≥
Th1 and
≥
Th0
3 2 1 0
Outputs
2
3
O.0
O.1
O.2
O.3
4
State of the transistor outputs when : current value is beetween the thresholds
7 6 5 4
5
Outputs
6
7
O.0
O.1
O.2
O.3
8
State of the transistor outputs when : current value < both thresholds
B A 9 8
9
Outputs
A
B
O.0
O.1
O.2
O.3
C Reserved
D Reserved
E Reserved
F Reserved
8
Descarcă
Publicitate