Event processing installation. Schneider Electric Software PLC Application-Specific Functions, Counting, Junior/Pro, 4.5
விளம்பரம்
விளம்பரம்
Software implementation
8.2
Event processing installation
At a Glance
Subject of this section
What's in this
Section?
This section describes how to install event processing associated with a counting module.
This section contains the following topics:
Topic
Introduction to event processing
How to program event processing
Page
154
35015371 00 May 2007
Software implementation
Introduction to event processing
At a Glance
Event processing principle
Event processing is used to minimize the reaction time when installing counting modules by: z z programming reflex actions, extending (physical) reflex output time performances Q0 and Q1 to other outputs on the PLC output modules.
One event (task) process can be associated with each counting channel. The appearance of an event in the application-specific counting function re-routes the application program to the event task associated with the channel.
The priority of the task is linked to its number. There are two priority levels determined by the process number: EVT0 has priority over all other EVTi's (i: from
1 to 31 or 63, depending on processor type). You must therefore assign EVT0 to the most important channel of the application, which will not necessarily be a counting channel.
The Multi-task application structure section in the Premium - TSX 57 PLCs
(TSX DM 57 xx E) installation manual provides details on how to integrate event tasks into the application.
Event processing is enabled when: z z z bit %S38 which enables PL7 event processing is set to 1, the UNMASKEVT is carried out in MAST and FAST tasks, the counting channel events involved are unmasked.
The objects indicating: z z the source of the event (event status word %IWxy.i.3), and the captured value, are updated implicitly before the event process is carried out. The other counting objects are not updated.
Event processing must first of all identify the source of the event by testing the event status word bits set to 1.
35015371 00 May 2007 155
Software implementation
Illustration The figure below illustrates the event processing principle
Unmask EVT
Up counting on
CTY 2A/4A or
CTY 2C
Enable
Preset
Capture
Crossing threshold etc.
UNMASKEVT
%S38
EVT testing and processing
Reflex action
Reflex action
Reflex action
Reflex action
156
35015371 00 May 2007
Software implementation
How to program event processing
Procedure The table below summarizes the essential steps for programming event processing.
Step
1
2
3
Action
Configuration phase
In offline mode, in the configuration editor, select Event processing and the event number for the counting channel.
Unmasking phase
In particular, the MAST or FAST calling task must: z enable processing of events at system level: set bit %S38 to 1 (default z value), unmask events in MAST and FAST tasks with the UNMASKEVT instruction
(active by default), z unmask events concerned at channel level by setting implicit event unmasking language objects (See Unmask event commands, word
%QWxy.i.1, p. 168 ). By default, the events are masked,
z check that the stack of events at system level is not saturated (bit %S39 must be at 0).
Event program creation phase
On the Events tab, select Edit
→
Create and create the event program. In particular, this program must: z Determine the source of the event(s) from the event status word (See z
Status of events and switches, word %IWx.i.3, p. 166
) in implicit exchange.
Carry out the reflex tasks associated with the event. This process must be as short as possible.
z Explicitly update the reflex outputs concerned.
Note : the event status word is automatically reset to zero.
35015371 00 May 2007 157
Software implementation
Illustration of event unmasking
This figure shows event unmasking in the MAST task.
LD: MAST - MAIN
(*Unmasking events*)
OPERATE
UNMASKEVT()
(*If unmasking from cold THEN authorize events*)
%S1
(*If starting from cold THEN unmask threshold 0 crossing event: %QW1.1.0:X5*)
%S1
%S38
S
%QW1.0.1:X5
(*If starting from cold THEN unmask crossing threshold 1 event: QW1.1.0:X6*)
%S1 %QW1.0.1:X6
F2 F3
P
F4
N
F5 F6 F7
X
F8 F9 F10 F11
S
F12
R
S.F1
S.F2
OPER
S.F3
COHP
H
S.F4
COHP
S.F5
S.F6
FB
S.F7
F (...)
S.F8
Illustration of the contents of an event task
This figure shows the possible contents of an event task (testing event and action bit).
LD: EVT - EVT0
(*If threshold 0 crossing event THEN set physical output %Q2.0 to 1*)
%IW1.0.3:X5 %Q2.0
S
(*If crossing threshold 1 event THEN set physical output %Q2.0 to 0*)
%IW1.0.3:X6
%Q2.0
R
F2 F3
P
F4
N
F5 F6 F7
X
F8 F9 F10 F11
S
F12
R
S.F1
S.F2
OPER
S.F3
COHP
H
S.F4
COHP
V
S.F5
S.F6
FB
S.F7
F (...)
S.F8
158
35015371 00 May 2007
The counting task’s language objects
9
At a glance
Subject of this chapter
What's in this
Chapter?
This chapter describes the language objects associated to the counting tasks as well as the different ways of using them.
This chapter contains the following topics:
Topic
Introducing language objects for application-specific counting
Implicit exchange language objects associated with the application-specific counting function
Details of implicit exchange objects
Explicit exchange language objects associated with the application-specific counting function
Breakdown of objects for user defined exchange
Explicit object exchange and report management
Page
159 35015371 00 May 2007
Language objects
Introducing language objects for application-specific counting
General Counting modules configured in a given position automatically generate a group of language objects enabling them to be programmed, and measurement results and diagnostics to be read.
There are two main types of language object: z z implicit exchange objects which are automatically exchanged on each cycle revolution of the task associated with the module, explicit exchange objects, which are exchanged at the request of the application using explicit exchange instructions.
The former (implicit exchanges) involve input/output module maps: measurement results, software information and commands necessary for the operation.
The latter (explicit exchanges) are used to set module parameters and bring in additional arguments (parameters, commands and information) for advanced programming. They are not necessary for normal programming.
160
35015371 00 May 2007
Language objects
Implicit exchange language objects associated with the application-specific counting function
At a Glance
Reminders
Illustration
These objects are used to access inputs and software information for the application-specific counting function.
The addressing system for words and bits is given in the Common applicationspecific functions (See : PL7 Junior, Pro ; Application-specific functions volume 1) section.
Module input maps (%I and %IW) are updated in the processor at the beginning of the task cycle in RUN or STOP mode.
Output commands (%Q and %QW) are updated in the module at the end of the task cycle, only when in RUN mode.
xy represents the position of the module, i represents the channel number (counted from 0) in the module.
The chart below illustrates the operation cycle relating to a PLC task (cyclic running).
Internal processing
Acquisition of inputs
RUN STOP
Program processing
Updating outputs
35015371 00 May 2007 161
Language objects
List of implicit exchange objects
The table below summarizes the implicit exchange objects in the application-specific counting function.
Object
%QWxy.i.1
Content
%Ixy.i.ERR
%Ixy.MOD.ERR
%IDxy.i.0
%IDxy.i.4
%IDxy.i.6
Counting channel error bit. When set to 1 it shows that channel i of the module in position xy has a fault. The causes of the fault are listed in the explicit exchange words %MWxy.i.2 (see Channel
standard fault, %MWxy.i.2, p. 173
) and %MWxy.i.3 (see Specific
channel faults, %MWxy.i.3, p. 173 ).
Module error bit. When set to 1 it shows that the module in position xy has a fault. The causes of the fault are listed in the explicit exchange module status word %MWxy.MOD.2 (see Module error
Current counter value (24 active bits).
Captured counter value (24 active bits).
Reserved for special functions (CTY2C), this is the time elapsed
(event task) between capture and last pulse (special function number 1).
%IDxy.i.8
%IDxy.i.10
%IDxy.i.11
%Ixy.i.0
to %Ixy.i.23
Speed (number of pulses per second, 24 active bits, CTY2C).
Multiplexed address of the absolute encoder with parallel outputs
(CTY2C).
Reserved for special functions (CTY2C), this is the time elapsed
(Mast or Fast task) between capture made and last pulse detected
(special function number 1).
Software information bits. (see Software information: %Ixy.i.r bits,
)
%IWxy.i.2
%IWxy.i.3
Software information word showing the status of the physical counting inputs (see Status of physical inputs/outputs, word
Information word showing the source of the events and the state of the software output switches (see Status of events and switches,
%Qxy.i.0
to %Qxy.i.23
Software commands (see Software commands, %Qxy.i.r bits,
).
%QWxy.i.0
Stored information reset commands, software direction commands
(see
Reset and output commands, word %QWxy.i.0, p. 168
).
Unmask event (see Unmask event commands, word %QWxy.i.1,
) commands.
162
35015371 00 May 2007
Language objects
Details of implicit exchange objects
At a Glance This section describes the group of implicit exchange bits. The columns in the tables give the following information: z z z its address, its symbol generated by the PL7 during Pre-symbolization, the description of its function.
35015371 00 May 2007 163
Language objects
Software information:
%Ixy.i.r bits
The table below shows the meanings of the %Ixy.i.r status bits.
%Ixy.i.0
%Ixy.i.1
%Ixy.i.2
%Ixy.i.4
%Ixy.i.5
%Ixy.i.6
%Ixy.i.7
%Ixy.i.8
%Ixy.i.9
%Ixy.i.10
%Ixy.i.11
%Ixy.i.12
%Ixy.i.13
%Ixy.i.16
%Ixy.i.17
ENAB_ACTIV
Meaning:
Counter enable active
PRES_DONE Preset done (hardware, except special function
CTY2C)
CAPT_DONE Capture done (hardware, except special function
CTY2C)
OVERSPEED_WRN Overspeed fault (CTY2C)
CUR_MEAS_THR0 Current value more than or equal to threshold 0 (<or less than 0 when down counting, CTY2A/4A)
CUR_MEAS_THR1 Current value more than or equal to threshold 1
CUR_MEAS_HISP Current value more than or equal to the high setpoint
(CTY2A/4A)
CUR_MEAS_LOSP Current value more than or equal to the low setpoint
(CTY2A/4A)
COUNT_DIR
CAPT_THR0
CAPT_THR1
Counting direction
0: direction - (down counting), 1: direction + (up counting)
Captured value more than or equal to threshold 0
CAPT_HISP
INC_MOD_DONE
CAPT_LOSP
DEC_MOD_DONE z z
Captured value more than or equal to threshold 1 z Captured value more than or equal to the high setpoint (CTY2A/4A)
Modulo crossing in + direction (CTY2C) z
Captured value more than or equal to the low setpoint (CTY2A/4A)
Rollover moving in - direction (CTY2C)
Reserved for special functions (CTY2C):
%Ixy.i.16: Correct speed,
Reserved for special functions (CTY2C):
%Ixy.i.17: moving part stationary.
164
35015371 00 May 2007
Language objects
Status of physical inputs/ outputs, word
%IWxy.i.2
The table below shows the meanings of %IWxy.i.2 status word bits.
%IWxy.i.2:X0
%IWxy.i.2:X1
%IWxy.i.2:X2
%IWxy.i.2:X3
%IWxy.i.2:X4
%IWxy.i.2:X6
%IWxy.i.2:X7
%IWxy.i.2:X8
%IWxy.i.2:X9
ST_IA
ST_IB
ST_IVAL
ST_PRES
ST_CAPT
ST_IZ
INVALID_MEAS
ST1_SSI_FRAME
ST2_SSI_FRAME
%IWxy.i.2:X10 ST3_SSI_FRAME
%IWxy.i.2:X11 ST4_SSI_FRAME
%IWxy.i.2:X12 ST_Q2
%IWxy.i.2:X13 ST_Q3
%IWxy.i.2:X14 ST_Q0
%IWxy.i.2:X15 ST_Q1
Meaning
Status of physical counting input IA
Status of physical counting input IB
Status of physical enable input IEna
State of the IPres or IReset physical preset input
State of physical capture input ICapt
Status of physical counting input IZ
Invalid measurement z z z
Rank 1 status bit from the SSI frame, or odd parity bit (SSI absolute encoder with odd parity, not checked by the module), or least significant part of the address (absolute encoder with multiplexed parallel outputs and adaptation base unit).
z z
Rank 2 status bit from the SSI frame, or most significant part of the address (absolute encoder with multiplexed parallel outputs and adaptation base unit).
z z
Rank 3 status bit from the SSI frame, or specific fault bit on absolute encoder with parallel outputs.
Rank 4 status bit 4 from the SSI frame
Q2 output status (CTY2C)
Q3 output status (CTY2C)
Q0 output status
Q1 output status
35015371 00 May 2007 165
Language objects
Status of events and switches, word %IWx.i.3
The table below shows the meanings of %IWxy.i.3 status word bits.
%IWxy.i.3:X0
%IWxy.i.3:X1
%IWxy.i.3:X2
%IWxy.i.3:X3
%IWxy.i.3:X5
%IWxy.i.3:X6
%IWxy.i.3:X7
%IWxy.i.3:X8
%IWxy.i.3:X9
ENAB_EVT
PRES_EVT
CAPT_EVT
CAPT_EDGE
THR0_EVT
THR1_EVT
HISP_EVT
LOSP_EVT
ST_COUNT_DIR
%IWxy.i.3:X10 ST_LATCH0
%IWxy.i.3:X11 ST_LATCH1
%IWxy.i.3:X12 INC_MOD_EVT
%IWxy.i.3:X13 DEC_MOD_EVT
%IWxy.i.3:X15 OVERRUN_EVT
Meaning
Enabling event
Event preset or reset
Capture event
Capture edge direction (TSX CTY2C)
0: rising edge, 1: falling edge.
Threshold 0 crossing event (or zero value when down counting with TSX CTY2A/4A) z z z z
Threshold 1 crossing event
Crossing high setpoint event (CTY2A/4A)
Reserved for special functions (CTY2C)
Crossing low setpoint event (CTY2A/4A)
Reserved for special functions (CTY2C)
Direction when crossing threshold or setpoint
(CTY2A/4A)
0: direction - (down counting), 1: direction + (up counting)
State of switch 0
State of switch 1
Rollover moving event in + direction (CTY2C)
Rollover moving event in - direction (CTY2C)
Overrun events (channel level).
166
35015371 00 May 2007
Software commands,
%Qxy.i.r bits
Language objects
The table below shows the meanings of the %Qxy.i.r command bits.
Address
%Qxy.i.0
%Qxy.i.1
%Qxy.i.2
%Qxy.i.3
%Qxy.i.5
%Qxy.i.6
%Qxy.i.7
%Qxy.i.9
%Qxy.i.10
%Qxy.i.11
%Qxy.i.12
%Qxy.i.13
%Qxy.i.14
%Qxy.i.15
%Qxy.i.16 to
%Qxy.i.19
%Qxy.i.20
%Qxy.i.21
Standard symbol
DIRENAB
DIRPRES
DIRCAPT
FLT_ACK
ENAB_IENAB
ENAB_IPRES
ENAB_ICAPT
ENAB_Q3_AUTO
SET_LATCH0
SET_LATCH1
RESET_LATCH0
RESET_LATCH1
ENAB_Q0_AUTO
ENAB_Q1_AUTO
MANU_CMD_Q2
MANU_CMD_Q3
Meaning
Direct enabling by the software
Direct preset by the software
Direct capture by the software
Fault acknowledgement (CTY2C)
Enabling the physical input IEna
Enabling the IPres or IReset physical output
Enabling the physical input ICapt
Enabling the Q3 output in automatic mode
(CTY2C)
Switch 0 set to 1
Switch 1 set to 1
Switch 0 set to 0
Switch 1 set to 0
Enabling the Q0 output in automatic mode
Enabling the Q1 output in automatic mode
Reserved for special functions (CTY2C)
Q2 output manual command (CTY2C)
Q3 output manual command (CTY2C)
35015371 00 May 2007 167
Language objects
Reset and output commands, word
%QWxy.i.0
The table below shows the meanings of the %QWxy.i.0 command word bits.
%QWxy.i.0:X1
%QWxy.i.0:X2
%QWxy.i.0:X4
CAPT_RESET
MOD_RESET
%QWxy.i.0:X9 COUNT_DIR_CHG Counting direction
0: direction - (down counting), 1: direction + (up counting)
%QWxy.i.0:X10 REACTIV_Q Reactivation of outputs Q0 , Q1 , and outputs Q2 ,
Q3 (CTY2C)
%QWxy.i.0:X11 AUTO_MOD_Q3
Hardware reset capture done
Rollover moving reset done (CTY2C)
%QWxy.i.0:X12 AUTO_MOD_Q0
Manual/automatic output mode Q3 (frequency,
CTY2C)
0: manual, 1: automatic (programmable frequency)
Manual/automatic output mode Q0
0: manual, 1: automatic
%QWxy.i.0:X13 AUTO_MOD_Q1
%QWxy.i.0:X14
%QWxy.i.0:X15
PRES_RESET
MANU_CMD_Q0
MANU_CMD_Q1
Meaning
Reset of hardware preset done
Manual/automatic output mode Q1
0: manual, 1: automatic
Output status manual command Q0
Output status manual command Q1
Unmask event commands, word
%QWxy.i.1
The table below shows the meanings of word bits %QWx.i.1.
Address
%QWxy.i.1:X0
%QWxy.i.1:X1
%QWxy.i.1:X2
%QWxy.i.1:X5
%QWxy.i.1:X6
Standard symbol
ENAB_UNMSK
PRES_UNMSK
CAPT_UNMSK
THR0_UNMSK
THR1_UNMSK
Meaning
Enable event unmasking
Unmask preset or reset event
Unmask capture event
Unmask threshold 0 event
Unmask threshold 0 event
%QWxy.i.1:X7
%QWxy.i.1:X8
HISP_UNMSK
LOSP_UNMSK
Unmask high setpoint event (CTY2A/4A)
Unmask low setpoint event (CTY2A/4A)
%QWxy.i.1:X12 INC_MOD_UNMSK Unmasking rollover moving event in + direction
(CTY2C)
%QWxy.i.1:X13 DEC_MOD_UNMSK Unmask rollover moving event in - direction
(CTY2C)
168
35015371 00 May 2007
Language objects
Explicit exchange language objects associated with the application-specific counting function
At a Glance Explicit exchanges are exchanges carried out on request from the program user using the following instructions: z z z z z z
READ_STS (See : PL7 Junior, Pro ; Application-specific functions volume 1)
(read status words),
WRITE_CMD (See : PL7 Junior, Pro ; Application-specific functions volume 1)
(write command words),
WRITE_PARAM (See : PL7 Junior, Pro ; Application-specific functions volume 1)
(write adjustment parameters),
READ_PARAM (See : PL7 Junior, Pro ; Application-specific functions volume 1)
(read adjustment parameters),
SAVE_PARAM (See : PL7 Junior, Pro ; Application-specific functions volume 1)
(save adjustment parameters),
RESTORE_PARAM (See : PL7 Junior, Pro ; Application-specific functions volume 1) (restore adjustment parameters).
These exchanges apply to all %MW objects that are of the same type (status, commands or parameters) on the same channel.
Note: These objects bring information (e.g.: Type of channel fault…), commands
(e.g.: switch commands) and additional operating modes (saving and restoring adjustment parameters while the application is in progress) to carry out more precise operation programming of the function.
35015371 00 May 2007 169
Language objects
General principle for the use of explicit instructions
The diagram below shows the different types of explicit exchange that are possible between the PLC processor and the module (or the built-in interface).
PLC processor Task or interface module built-in task
Objects %MWxy.i.r
or
%MWxy.MOD.r (1)
Status parameters
READ_STS
Status parameters
Command parameters
WRITE_CMD
Command parameters
Adjustment parameters: actual
WRITE_PARAM
READ_PARAM
SAVE_PARAM
Adjustment parameters: current
Initial adjustment parameters
RESTORE_PARAM
(1) Only with READ_STS and WRITE_CMD instructions.
Managing exchanges
During an explicit exchange, it may be interesting to monitor the progress that this makes, in order to, for example, only take into account the data read when the exchange has actually been carried out.
For this, two kinds of information are available: z z detecting an exchange in progress (see Explicit Exchange Execution Indicators:
an end of exchange report (see
Explicit exchange report: %MWxy.i.1, p. 181
).
The diagram below describes the principle for managing an exchange.
Carrying out an: explicit exchange
Detecting an exchange in progress
Report for end of exchange
170
35015371 00 May 2007
List of explicit exchange objects
Language objects
The table below summarizes the explicit exchange objects in the application-specific counting function.
Object
%MWxy.i.MOD.2
%MDxy.i.4
Content
Module fault status word (updated by the
READ_STS%CHxy.MOD instruction)
Preset value
Type
State
Parameter
%MDxy.i.6
%MDxy.i.8
%MDxy.i.10
%MDxy.i.12
%MDxy.i.22
%MDxy.i.24
Value of threshold 0
Value of threshold 1 z z z z
High setpoint value (CTY2A/4A)
Absolute encoder offset value (CTY2C)
Low setpoint value (CTY2A/4A)
Overspeed threshold (CTY2C)
Frequency output period Q3 (CTY2C)
Target speed (special function number 3,
CTY2C)
Parameter
Parameter
Parameter
Parameter
Parameter
Parameter
%MWxy.i.2
and 3 Counting channel fault diagnostics i of the module in position xy (see Channel standard
State
%MWxy.i.14
and 15 Switch 0 SET conditions (see 0 counter output
SET commands, %MWxy.i.14, p. 174
)
Parameter
%MWxy.i.16
and 17 Switch 0 RESET conditions (see 0 counter output RESET commands, %MWxy.i.16,
Parameter
%MWxy.i.18
and 19 Switch 1 SET conditions (see 1 counter output
SET commands, %MWxy.i.18, p. 176
)
Parameter
Parameter %MWxy.i.20
and 21 Switch 1 RESET conditions (see 1 counter output RESET commands, %MWxy.i.20,
%MWxy.i.26
Stopping speed (special function number 3,
CTY2C)
Parameter
%MWxy.i.27
%MWxy.i.28
Speed measurement period (CTY2C)
Reserved for special functions (CTY2C)
Parameter
Parameter
35015371 00 May 2007 171
Language objects
Breakdown of objects for user defined exchange
At a glance
Observations
This part collates the word type objects for user defined exchange, whose bits have a particular meaning. This objects are introduced in detail below, bit by bit. z z
A bit’s meaning extends to State 1 . The non Boolean bits (neither true nor false) are detailed to avoid any ambiguity.
None of the bits are used.
Summary
Module error flags:
%MWxy.MOD.2
z z xy shows the module’s position.
i shows the channel number (from 0) in the module.
The table below introduces the meanings of the module state word’s bits. These bits do not have standard symbols and are read by a READ_STS %CHxy.MOD.
Address Meaning
%MWxy.MOD.2:X0
%MWxy.MOD.2:X1
Broken down module
Faulty channel(s)
%MWxy.MOD.2:X5
%MWxy.MOD.2:X6
Different hardware and software configurations
Module is absent or switched off
172
35015371 00 May 2007
Channel standard fault,
%MWxy.i.2
Language objects
The table below introduces the meanings of the CH_FLT status word bits. Reading can be done via a READ_STS %CHxy.i.
%MWxy.i.2:X0
%MWxy.i.2:X1
%MWxy.i.2:X3
%MWxy.i.2:X4
%MWxy.i.2:X5
%MWxy.i.2:X6
%MWxy.i.2:X7
%MWxy.i.2:X8 and
%MWxy.i.2:X9
%MWxy.i.2:X11
%MWxy.i.2:X12
%MWxy.i.2:X13
%MWxy.i.2:X14
%MWxy.i.2:X15
COUNT_INP_FLT
Meaning
Counting input error
COUNT_APP_FLT Counting application fault
AUX_IO_FLT
INTERNAL_FLT
Auxiliary I/O
Internal error or channel self-testing
CONF_FLT
COMMUNIC_FLT
APPLI_FLT
CH_LED0,1
Different hardware and software configurations
Communication error with the PLC
Application fault
Green indicator’s command bits CHx (channel state)
00 = off, 01 = blinking, 11 = lit
AUX_SUPPL_FLT Auxiliary I/O supply fault
SHORT_CIRC_FLT Output short-circuit error
ENC_SUPPLY_FLT Supply, encoder or potential difference error
LINE_BRK_FLT Encoder line break or short-circuit error
SSI_TRAME_FLT Transmission of SSI absolute encoder frame
(CTY 2C) error
Specific channel faults,
%MWxy.i.3
The table below introduces the meanings of the %MWxy.i.3 channel status word bits. Reading can be done via a READ_STS %CHxy.i.
%MWxy.i.3:X0
%MWxy.i.3:X1
%MWxy.i.3:X2
%MWxy.i.3:X3
CH_CONF_FLT
Meaning
Channel configuration error
XERFLOW_FLT Measurement overrun error
ABS_ERROR_FLT Specific absolute encoder error
OVERSPEED_FLT Overspeed error
35015371 00 May 2007 173
Language objects
0 counter output
SET commands,
%MWxy.i.14
The table below introduces the meanings of the %MWxy.i.14 command word bits.
The requests used are those associated to the (READ_PARAM, WRITE_PARAM...) parameters.
Address
%MWxy.i.14:X0
%MWxy.i.14:X1
%MWxy.i.14:X2
%MWxy.i.14:X4
%MWxy.i.14:X5
Standard symbol
S0_ENAB
S0_PRES
S0_CAPT
S0_MOD_INC
S0_MOD_DEC
Meaning: Setting the 0 counter output to 1 on confirmation on preset on capture on +direction modulo overshoot on -direction modulo overshoot
0 counter output
SET commands,
%MWxy.i.15
The table below introduces the meanings of the %MWxy.i.15 command word bits.
The requests used are those associated to the (READ_PARAM, WRITE_PARAM...) parameters.
Address
%MWxy.i.15:X0
%MWxy.i.15:X1
%MWxy.i.15:X2
%MWxy.i.15:X3
%MWxy.i.15:X4
%MWxy.i.15:X5
%MWxy.i.15:X6
Standard symbol
S0_TH0_INC
S0_TH0_DEC
S0_C_SUP_TH0
S0_C_INF_TH0
S0_TH1_INC
S0_TH1_DEC
S0_C_SUP_TH1
%MWxy.i.15:X7
%MWxy.i.15:X8
S0_C_INF_TH1
S0_HISP_INC
%MWxy.i.15:X9 S0_HISP_DEC
%MWxy.i.15:X10 S0_C_SUP_HISP
%MWxy.i.15:X12 S0_LOSP_INC
%MWxy.i.15:X13 S0_LOSP_DEC
%MWxy.i.15:X15 S0_C_INF_LOSP
Meaning: Setting the 0 counter output to 1 on +direction 0 threshold overshoot on -direction 0 threshold overshoot if the captured value is more than or equal to 0 if the captured value is less than the 0 threshold on +direction 1 threshold overshoot on -direction 1 threshold overshoot if the captured value is more than or equal to 1 if the captured value is less than the 1 threshold on high setpoint crossing on high setpoint crossing if the captured value is more than or equal to the high setpoint on +direction low crossing setpoint on -direction low crossing setpoint if the captured value is less than the low setpoint
174
35015371 00 May 2007
Language objects
0 counter output
RESET commands,
%MWxy.i.16
The table below introduces the meanings of the %MWxy.i.16 command word bits.
The requests used are those associated to the (READ_PARAM, WRITE_PARAM...) parameters.
Address
%MWxy.i.16:X0
%MWxy.i.16:X1
%MWxy.i.16:X2
%MWxy.i.16:X4
%MWxy.i.16:X5
Standard symbol
R0_ENAB
R0_PRES
R0_CAPT
R0_MOD_INC
R0_MOD_DEC
Meaning: Setting the 0 counter output to 0 on confirmation on preset on capture on +direction modulo overshoot on -direction modulo overshoot
0 counter output
RESET commands,
%MWxy.i.17
The table below introduces the meanings of the %MWxy.i.17 command word bits.
The requests used are those associated to the (READ_PARAM, WRITE_PARAM...) parameters.
Address
%MWxy.i.17:X0
%MWxy.i.17:X1
%MWxy.i.17:X2
%MWxy.i.17:X3
%MWxy.i.14:X4
%MWxy.i.17:X5
%MWxy.i.17:X6
Standard symbol
R0_TH0_INC
R0_TH0_DEC
R0_C_SUP_TH0
R0_C_INF_TH0
R0_TH1_INC
R0_TH1_DEC
R0_C_SUP_TH1
%MWxy.i.17:X7
%MWxy.i.17:X8
R0_C_INF_TH1
R0_HISP_INC
%MWxy.i.17:X9 R0_HISP_DEC
%MWxy.i.17:X10 R0_C_SUP_HISP
%MWxy.i.17:X12 R0_LOSP_INC
%MWxy.i.17:X13 R0_LOSP_DEC
%MWxy.i.17:X15 R0_C_INF_LOSP
Meaning: Setting the 0 counter output to 0… on +direction 0 threshold overshoot on -direction 0 threshold overshoot if the captured value is more than or equal to the
0 threshold if the captured value is less than the 0 threshold on +direction 1 threshold overshoot on -direction 1 threshold overshoot if the captured value is more than or equal to the
1 threshold if the captured value is less than the 1 threshold on high setpoint crossing on high setpoint crossing if the captured value is more than or equal to the high setpoint on +direction low crossing setpoint on -direction low crossing setpoint if the captured value is less than the low setpoint
35015371 00 May 2007 175
Language objects
1 counter output
SET commands,
%MWxy.i.18
The table below introduces the meanings of the %MWxy.i.18 command word bits.
The requests used are those associated to the (READ_PARAM, WRITE_PARAM...) parameters.
Address
%MWxy.i.18:X0
%MWxy.i.18:X1
%MWxy.i.18:X2
%MWxy.i.18:X4
%MWxy.i.18:X5
Standard symbol
S1_ENAB
S1_PRES
S1_CAPT
S1_MOD_INC
S1_MOD_DEC
Meaning: Setting the 1 counter output to 1… on confirmation on preset on capture on +direction modulo overshoot on -direction modulo overshoot
1 counter output
SET commands,
%MWxy.i.19
The table below introduces the meanings of the %MWxy.i.19 command word bits.
The requests used are those associated to the (READ_PARAM, WRITE_PARAM...) parameters.
Address
%MWxy.i.19:X0
%MWxy.i.19:X1
%MWxy.i.19:X2
%MWxy.i.19:X3
%MWxy.i.19:X4
%MWxy.i.19:X5
%MWxy.i.19:X6
Standard symbol
S1_TH0_INC
S1_TH0_DEC
S1_C_SUP_TH0
S1_C_INF_TH0
S1_TH1_INC
S1_TH1_DEC
S1_C_SUP_TH1
%MWxy.i.19:X7 S1_C_INF_TH1
%MWxy.i.19:X8
%MWxy.i.19:X9
S1_HISP_INC
S1_HISP_DEC
%MWxy.i.19:X10 S1_C_SUP_HISP
%MWxy.i.19:X12 S1_LOSP_INC
%MWxy.i.19:X13 S1_LOSP_DEC
%MWxy.i.19:X15 S1_C_INF_LOSP
Meaning of setting the 1 counter output to 1… on +direction 0 threshold overshoot on -direction 0 threshold overshoot if the captured value is more than or equal to the
0 threshold if the captured value is less than the 0 threshold on +direction 1 threshold overshoot on -direction 1 threshold overshoot if the captured value is more than or equal to the
1 threshold if the captured value is less than the 1 threshold on high setpoint crossing on high setpoint crossing if the captured value is more than or equal to the high setpoint on +direction low crossing setpoint on -direction low crossing setpoint if the captured value is less than the low setpoint
176
35015371 00 May 2007
Language objects
1 counter output
RESET commands,
%MWxy.i.20
The table below introduces the meanings of the %MWxy.i.20 command word bits.
The requests used are those associated to the (READ_PARAM, WRITE_PARAM...) parameters.
Address
%MWxy.i.20:X0
%MWxy.i.20:X1
%MWxy.i.20:X2
%MWxy.i.20:X4
%MWxy.i.20:X5
Standard symbol
R1_ENAB
R1_PRES
R1_CAPT
R1_MOD_INC
R1_MOD_DEC
Meaning: Setting the 1 counter output to 0… on confirmation on preset on capture on +direction modulo overshoot on -direction modulo overshoot
1 counter output
RESET commands,
%MWxy.i.21
The table below introduces the meanings of the %MWxy.i.21 command word bits.
The requests used are those associated to the (READ_PARAM, WRITE_PARAM...) parameters.
Address
%MWxy.i.21:X0
%MWxy.i.21:X1
%MWxy.i.21:X2
%MWxy.i.21:X3
%MWxy.i.21:X4
%MWxy.i.21:X5
%MWxy.i.21:X6
Standard symbol
R1_TH0_INC
R1_TH0_DEC
R1_C_SUP_TH0
R1_C_INF_TH0
R1_TH1_INC
R1_TH1_DEC
R1_C_SUP_TH1
%MWxy.i.21:X7 R1_C_INF_TH1
%MWxy.i.21:X8
%MWxy.i.21:X9
R1_HISP_INC
R1_HISP_DEC
%MWxy.i.21:X10 R1_C_SUP_HISP
%MWxy.i.21:X12 R1_LOSP_INC
%MWxy.i.21:X13 R1_LOSP_DEC
%MWxy.i.21:X15 R1_C_INF_LOSP
Meaning: Setting the 1 counter output to 0… on +direction 0 threshold overshoot on -direction 0 threshold overshoot if the captured value is more than or equal to the
0 threshold if the captured value is less than the 0 threshold on +direction 1 threshold overshoot on -direction 1 threshold overshoot if the captured value is more than or equal to the
1 threshold if the captured value is less than the 1 threshold on high setpoint crossing on high setpoint crossing if the captured value is more than or equal to the high setpoint on +direction low crossing setpoint on -direction low crossing setpoint if the captured value is less than the low setpoint
35015371 00 May 2007 177
Language objects
Explicit object exchange and report management
Presentation
Illustration
When data is exchanged between the PLC memory and the module, it may take several task cycles for the module to take this into account. Two words are used to handle exchanges: z z
%MWxy.i : Exchange in progress,
%MWxy.i.1 : Report.
The illustration below shows the different significant bits for managing exchanges.
Reconfiguration (X15)
Adjustment (X2)
Command (X1)
Status (X0)
Status parameters
Command parameters
Adjustment parameters
READ_STS
WRITE_CMD
WRITE_PARAM
READ_PARAM
SAVE_PARAM
RESTORE_PARAM
178
35015371 00 May 2007
Description of significant bits
Language objects
Each bit of the words %MWxy.i and %MWxy.i.1 is associated with a parameter type: z z z z
Bits from rank 0 are associated with status parameters: z The bit %MWxy.i.0:X0 indicates if a status word read request is in progress,
Bits from rank 1 are associated with command parameters: z z
The bit %MWxy.i.0:X1 indicates if command parameters are sent to the channel i of the module,
The bit %MWxy.i.1:X1 indicates if command parameters are accepted by the channel i of the module, bits from rank 2 are associated with adjustment parameters: z The bit %MWxy.i.0:X2 indicates if adjustment parameters are exchanged with the channel i of the module (by WRITE_PARAM, READ_PARAM,
SAVE_PARAM, RESTORE_PARAM), z the bit %MWxy.i.1:X2 indicates if adjustment parameters are accepted by the module. If the exchange was successful, this bit is set to 0,
Bits of rank 15 indicate a reconfiguration on the channel i of the module from the terminal (modification of configuration parameters + cold start of the channel).
Note: Exchange and report words also exist at the module level (%MWxy.MOD et
%MWxy.MOD.1).
35015371 00 May 2007 179
Language objects
Example Phase 1: Sending data using the instruction WRITE_PARAM
PLC memory
Status parameters
Command parameters
Adjustment parameters
1
0
I/O module memory or integrated applicationspecific function
Status parameters
Command parameters
Adjustment parameters
When the instruction is scanned by the PLC processor, the Exchange in progress bit is set to 1 in %MWxy.
Phase 2: Data analysis by the I/O module and report
PLC memory
Status parameters
Command parameters
Adjustment parameters
0
1
I/O module memory or integrated applicationspecific function
Status parameters
Command parameters
Adjustment parameters
When data is exchanged between the PLC memory and the module, acknowledgment by the module is managed by the bit %MWxy.i.1:X2: Report(0 = exchange successful, 1=exchange unsuccessful).
Note: There are no module level adjustment parameters.
180
35015371 00 May 2007
Explicit
Exchange
Execution
Indicators:
%MWxy.i.0
Language objects
0
1
2
The table below lists the meanings of the EXCH_STS channel exchange control bits.
15
STS_IN_PROGR
Meaning
Exchange of channel status words in progress
COMMAND_IN_PROGR Exchange of command words in progress
ADJUST_IN_PROGR
RECONF_IN_PROGR
Exchange of adjustment words (parameters) in progress
Channel reconfiguration in progress
Explicit exchange report:
%MWxy.i.1
The table below lists the meanings of the EXCH_ERR report bits.
0
1
2
15
STS_READ_ERR
COMMAND_ERR
ADJUST_ERR
RECONF_ERR
Meaning
Channel status read error
Command word send error
Adjustment word send error
Channel reconfiguration error
Using a Premium
Counting Module
The following table describes the steps carried out between a Premium counting module and the PLC after start up.
2
3
Step
1
Action
Startup
The processor sends the configuration parameters.
The processor sends the configuration parameters using the WRITE_PARAM method.
Note: When the operation is completed, the bit %MWr.m.c.0.2 is set to 0.
If you use the command WRITE_PARAM at the beginning of your application, you must wait until the bit %MWr.m.c.0.2 is set to 0.
35015371 00 May 2007 181
Language objects
182
35015371 00 May 2007
Example of the counting application
10
At a glance
Subject of this chapter
What's in this
Chapter?
This chapter introduces an example of the counting application, from the configuration of the modules to the application’s development in the PLC.
This chapter contains the following sections:
Section
10.1
10.2
Topic
Introducing and configuring the example
Programming details for the example
Page
35015371 00 May 2007 183
பதிவிறக்கு
விளம்பரம்