Explicit exchanges. Schneider Electric PL7 Junior/Pro - Premium PLC Applications - Standard applications
Annonce
Annonce
Objects associated with specific applications
2.3
Explicit exchanges
Presentation
Subject of this section
What's in this
Section?
This section presents the principle of explicit exchanges as well as the different instructions which allow them to be carried out.
This Section contains the following Maps:
Topic
Explicit exchanges: General
READ_STS: Reading status words
WRITE_CMD: Writing command words
READ_PARAM: Reading adjustment parameters
WRITE_PARAM: Writing adjustment parameters
SAVE_PARAM: Saving adjustment parameters
RESTORE_PARAM: Restoring adjustment parameters
Exchange and report management
Page
TLX DS 57 PL7 xx
39
Objects associated with specific applications
Explicit exchanges: General
Introduction Explicit exchanges are exchanges performed at the request of the user program using the following instructions: l l l l l
READ_STS (reading status words),
WRITE_CMD (writing command words)
WRITE_PARAM (writing adjustment parameters),
READ_PARAM (reading adjustment parameters),
SAVE_PARAM (saving adjustment parameters), l RESTORE_PARAM (restoring adjustment parameters),
These exchanges apply to a set of %MW objects of the same type (status, commands or parameters) on the same channel.
Note: These objects are not necessary for the programming of an applicationspecific function, but they provide additional information (e.g.: terminal block fault, module absent etc.) and additional commands for advanced programming of application-specific functions (for more information on Explicit exchange objects relating to a specific application, refer to the corresponding section).
General principle of use for explicit instructions
The diagram below shows the different types of explicit exchange possible between the PLC processor and the module (or the built-in interface).
PLC processor E/S Module or interface built-in task
%MWxy.i.r objects
or
%MWxy.MOD.r (1)
Status words READ_STS
Status words
Command words
WRITE_CMD
Command words
Adjustment parameters current
WRITE_PARAM
READ_PARAM
SAVE_PARAM
Adjustment parameters current
Adjustment parameters initial
RESTORE_PARAM
Only with the READ_RTS and WRITE_CMD instructions.
40
TLX DS 57 PL7 xx
Exchange management
Objects associated with specific applications
During an explicit exchange, it may prove advantageous to check on its progress, in order, for example, to ensure that the data read is only acknowledged once the exchange has been completed.
To do this, two types of information are available: l l detection of an exchange in progress, the end of exchange report.
The summary below explains the principle for management of an exchange
Execution of an explicit exchange
Detection of an exchange in progress
Report of the end of the exchange
Logical channel
%CHxy.i
The channel %CHxy.i is a general syntax used to update, via the explicit instructions, the set of objects of the same type associated with this channel or a group of channels.
Example: READ_STS%CH102.3
Note: In the case of a channel group, the address used must be that of the first channel of the group of channels managed by the module.
Limit concerning the FIPIO bus
The number of explicit exchange functions activated simultaneously is limited to 24 on the FIPIO bus.
Several cycles of the master task may be required to send an exchange request to the FIPIO bus, and it is also necessary that the exchange management parameter words are managed for all explicit variable exchanges (see ).
TLX DS 57 PL7 xx
41
Objects associated with specific applications
READ_STS: Reading status words
Introduction Status words contain information about the functioning state of the module or the channel.
The READ_STS instruction allows reading in the module (or in the built-in interface) of these kind of words. This reading updates the %MW status words .
These words can be used to carry out diagnostics by program.
Note: The status words are specific to each task. However, 2 words are used by l l all of the modules in the TSX Premium range:
%MWxy.MOD.2 (module level fault),
%MWxy.i.2 (channel i level fault).
Illustration Writing instruction
Processor PLC
Objects %MWxy.ir or
%MWxy.MOD.2
Status words READ_STS
E/S Module or interface built-in task
Status words
Syntax The READ_STS instruction is defined in the following way :
READ_STS%CHxy.i
The table below describes the different elements that are part of the instruction.
i y
Element
READ_STS
%CH x
Description
Name of the instruction
Channel-type object
Rack address.
Module position.
Channel or MOD number.
42
TLX DS 57 PL7 xx
Examples
Objects associated with specific applications
The example below presents some examples of explicit exchanges using the
READ_STS instruction.
Object
READ_STS%CH302.1
Description
Reading the status words of channel 1, which is on the module situated in position 2 in rack number 3.
READ_STS%CH401.MOD
Reading the status words of the module situated in position 1 in rack 4.
TLX DS 57 PL7 xx
43
Objects associated with specific applications
WRITE_CMD: Writing command words
Introduction The command words act on the module or the channel (e.g.: reactivation of discrete outputs).
The WRITE_CMD instruction enables the %MW command words to be written to the module (or the built-in interface).
Note: The command words are specific to each application.
Illustration Write instruction
Processor PLC
Objects %MWxy.ir or
%MWxy.MOD.2
Command words
WRITE_CMD
E/S Module or interface built-in task
Command words
Syntax
Examples
The WRITE_CMD instruction is defined as follows:
WRITE_CMD%CHxy.i
The table below describes the different elements which constitute the instruction.
i y
Element Description
WRITE_CMD Name of instruction.
%CH x
Channel-type object.
Rack address.
Module position.
Channel number.
The table below gives an example of an explicit exchange using the WRITE_CMD instruction.
Object
WRITE_CMD%CH3.0
Description
Writing the command information of channel 0 of the module located in position 3 of rack 0.
44
TLX DS 57 PL7 xx
READ_PARAM: Reading adjustment parameters
Objects associated with specific applications
Introduction
Illustration
The READ_PARAM instruction enables the adjustment parameters of the module
(or built-in interface) to be read.
Reading updates the status words associated with the adjustment parameters
%MWxy.i.r .
Read instruction
Processor PLC
%MWxy.i.r objects
Current adjustment parameters
READ_PARAM
E/S Module or interface built-in task
Current adjustment parameters
Syntax
Examples
The READ_PARAM instruction is defined as follows:
READ_PARAM%CHxy.i
The table below describes the different elements which constitute the instruction.
i y
Element Description
READ_PARAM Name of instruction.
%CH x
Channel-type object.
Rack address.
Module position.
Channel number.
The table below gives an example of an explicit exchange using the READ_PARAM instruction.
Object
READ_PARAM%CH3.1
Description
Reading the adjustment parameters of channel 1 of the module located in position 3 of rack 0.
TLX DS 57 PL7 xx
45
Objects associated with specific applications
WRITE_PARAM: Writing adjustment parameters
Introduction
Illustration
The WRITE_PARAM instruction enables the adjustment parameters to be written to the module (or the built-in interface).
This instruction enables the adjustment values defined in the configuration
contained in the %MWxy.i.r words to be modified by the program.
Write instruction
Processor PLC
E/S Module or interface built-in task
%MWxy.i.r objects
WRITE_PARAM
Adjustment parameters current
Adjustment parameters current
Syntax
Examples
The WRITE_PARAM instruction is defined as follows:
WRITE_PARAM%CHxy.i
The table below describes the different elements which constitute the instruction.
i y
Element
WRITE_PARAM
%CH x
Description
Name of instruction.
Channel-type object.
Rack address.
Module position.
Channel number.
The table below gives an example of an explicit exchange using the
WRITE_PARAM instruction.
Object Description
WRITE_PARAM%CH302.1 Writing the adjust parameters of channel 1 of the module located in position 3 of rack 3.
46
TLX DS 57 PL7 xx
Objects associated with specific applications
SAVE_PARAM: Saving adjustment parameters
Introduction When modifying the module’s (or built-in interfaces’) adjustment parameters, the
SAVE_PARAM instruction allows you to save these new parameters and substitute them for the initial parameters.
These parameters replace the initial defined values with the help of the configuration editor (or of the last save ).
The SAVE_PARAM instruction is the equivalent to the order Services → Save parameters
Note: During a cold start, the current parameters (not saved) are replaced by the initial parameters.
Illustration Writing instruction
Processor PLC
%MWxy.i.r objects
Adjustment parameters current
Adjustment parameters initial
SAVE_PARAM
E/S Module or interface built-in task
Adjustment parameters current
Syntax The SAVE_PARAM instruction is defined in the following way:
SAVE_PARAM%CHxy.i
The table below describes the different elements that are part of the instruction.
i y
Element
SAVE_PARAM
%CH x
Description
Name of the instruction.
Channel-type object.
Rack address.
Module position.
Channel number.
TLX DS 57 PL7 xx
47
Objects associated with specific applications
Examples The table below presents an example of explicit exchange using the instruction
SAVE_PARAM.
Object
SAVE_PARAM%CH5.2
Description
Reading then saving the adjustment parameters of channel 2, which is part of the module situated in position 5 in rack number
0.
48
TLX DS 57 PL7 xx
Objects associated with specific applications
RESTORE_PARAM: Restoring adjustment parameters
Introduction
Illustration
The RESTORE_PARAM instruction allows you to restore the initial adjustment parameters (written during configuration or during the last save).
The RESTORE_PARAM instruction is the equivalent to the order Services
→
Save
parameters
Writing instruction
Processor PLC
%MWxy.i.r objects
Adjustment parameters current
RESTORE_PARAM
E/S Module or interface built-in task
Adjustment parameters current
Adjustment parameters initial
Syntax
Examples
The RESTORE_PARAM instruction is defined in the following way:
RESTORE_PARAM%CHxy.i
The table below describes the different elements that are part of the instruction.
i y
Element Description
RESTORE_PARAM Name of the instruction
%CH x
Channel-type object.
Rack address.
Module position.
Channel number.
The table below presents an example of explicit exchange using the instruction
RESTORE_PARAM.
Object Description
RESTORE_PARAM%CH1.0
Writing the adjustment parameters of channel 0, which is part of the module situated in position 1 in rack 0.
TLX DS 57 PL7 xx
49
Objects associated with specific applications
Exchange and report management
Introduction When data is exchanged between the PLC memory and the module, several task cycles may be required for the exchange to be acknowledged by the interface card.
2 words are used to manage the exchanges: l l
%MWxy.i: Exchange in progress,
%MWxy.i.1: Report
Note: These words are described in detail in each part on specific applications.
Illustration The illustration below shows the various bits which are significant for exchange management.
Reconfiguration (X15)
Adjust (X2)
Command (X1)
State (X0)
%MWxy.i.0
%MWxy.i.1
Status words READ_STS
Command words
Adjustment parameters
WRITE_CMD
WRITE_PARAM
READ_PARAM
SAVE_PARAM
RESTORE_PARAM
Description of significant bits
50
Each of the bits of the words %MWxy.i and %MWxy.i.1 is associated with a type of parameter: l position 0 bits are associated with status parameters: l the bit %MWxy.i.0:X0 indicates whether a status word read request is in progress, l position 1 bits are associated with command parameters: l the bit %MWxy.i.0:X1 indicates whether the control parameters have been sent to channel i of the module, l the bit %MWxy.i.1:X1 specifies whether the control parameters have been accepted by channel i of the module,
TLX DS 57 PL7 xx
Example
TLX DS 57 PL7 xx
Objects associated with specific applications l l position 2 bits are associated with adjustment parameters: l the bit %MWxy.i.0:X2 indicates whether the adjustment parameters have been exchanged with channel i of the module (by WRITE_PARAM, READ_PARAM,
SAVE_PARAM, RESTORE_PARAM), l the bit %MWxy.i.1:X2 specifies whether the adjustment parameters have been accepted by the module. If the exchange has been made successfully the bit is set to 0, the position 15 bits indicate that channel i of the module has been reconfigured from the terminal (modification of the configuration parameters + cold start of the channel).
Note: The exchange and report words also exist at module level (%MWxy.MOD and %MWxy.MOD.1).
Phase 1: Transmission of data using the WRITE_PARAM instruction
PLC memory
1
0
Status words
Command words
Current adjustment parameters
E/S module memory or built-in application specific function
Status words
Command words
Current adjustment parameters
When the instruction is scanned by the PLC processor, the Exchange in progress bit is set to 1 in %MWxy.
Phase 2: Analysis of data by the I/O module and report
PLC memory E/S module memory or built-in application specific function
0
1
Status words
Command words
Current adjustment parameters
Status words
Command words
Current adjustment parameters
When data is exchanged between the PLC memory and the module, acknowledgment by the interface card is managed by the %MWxy.i.1:X2 bit: Report
(0 = exchange successful, 1=exchange unsuccessful).
Note: There are no adjustment parameters at module level.
51
Download
Annonce