When data is exchanged between the PLC memory and the module, the module may require several task cycles to acknowledge this information. IODDTs use two words to manage exchanges:
NOTE:
Depending on the localization of the module, the management of the explicit exchanges (%MW0.0.MOD.0.0 for example) will not be detected by the application:
-
For in-rack modules, explicit exchanges are done immediately on the local PLC Bus and are finished before the end of the execution task. So, the READ_STS, for example, is finished when the %MW0.0.mod.0.0 bit is checked by the application.
-
For remote bus (Fipio for example), explicit exchanges are not synchronous with the execution task, so the detection is possible by the application.
The illustration below shows the different significant bits for managing exchanges:
Description of Significant Bits
Each bit of the words EXCH_STS (%MWr.m.c.0) and EXCH_RPT (%MWr.m.c.1) is associated with a type of parameter:
-
Rank 0 bits are associated with the status parameters:
-
The STS_IN_PROGR bit (%MWr.m.c.0.0) indicates whether a read request for the status words is in progress.
-
The STS_ERR bit (%MWr.m.c.1.0) specifies whether a read request for the status words is accepted by the module channel.
-
Rank 1 bits are associated with the command parameters:
-
The CMD_IN_PROGR bit (%MWr.m.c.0.1) indicates whether command parameters are being sent to the module channel.
-
The CMD_ERR bit (%MWr.m.c.1.1) specifies whether the command parameters are accepted by the module channel.
-
Rank 2 bits are associated with the adjustment parameters:
-
The ADJ_IN_PROGR bit (%MWr.m.c.0.2) indicates whether the adjustment parameters are being exchanged with the module channel (via WRITE_PARAM, READ_PARAM, SAVE_PARAM, RESTORE_PARAM).
-
The ADJ_ERR bit (%MWr.m.c.1.2) specifies whether the adjustment parameters are accepted by the module. If the exchange is correctly executed, the bit is set to 0.
-
Rank 15 bits indicate a reconfiguration on channel c of the module from the console (modification of the configuration parameters + cold start-up of the channel).
-
The r, m and c bits indicates the following elements:
-
the r bit represents the rack number.
-
The m bit represents the position of the module in the rack.
-
The c bit represents the channel number in the module.
NOTE: r represents the rack number, m the position of the module in the rack, while c represents the channel number in the module.
NOTE: Exchange and report words also exist at module level EXCH_STS (%MWr.m.MOD) and EXCH_RPT (%MWr.m.MOD.1) as per IODDT type T_GEN_MOD.
Phase 1: Sending data by using the WRITE_PARAM instruction
When the instruction is scanned by the PLC, the Exchange in progress bit is set to 1 in %MWr.m.c.
Phase 2: Analysis of the data by the I/O module and report.
When the data is exchanged between the PLC memory and the module, acknowledgement by the module is managed by the ADJ_ERR bit (%MWr.m.c.1.2).
This bit makes the following reports:
-
0: correct exchange
-
1: incorrect exchange)
NOTE: There is no adjustment parameter at module level.
Execution Indicators for an Explicit Exchange: EXCH_STS
The table below shows the control bits of the explicit exchanges: EXCH_STS (%MWr.m.c.0)
Standard Symbol
|
Type
|
Access
|
Meaning
|
Address
|
STS_IN_PROGR
|
BOOL
|
R
|
Reading of channel status words in progress
|
%MWr.m.c.0.0
|
CMD_IN_PROGR
|
BOOL
|
R
|
Command parameters exchange in progress
|
%MWr.m.c.0.1
|
ADJ_IN_PROGR
|
BOOL
|
R
|
Adjust parameters exchange in progress
|
%MWr.m.c.0.2
|
RECONF_IN_PROGR
|
BOOL
|
R
|
Reconfiguration of the module in progress
|
%MWr.m.c.0.15
|
NOTE: If the module is not present or is disconnected, explicit exchange objects (READ_STS for example) are not sent to the module (STS_IN_PROG (%MWr.m.c.0.0) = 0), but the words are refreshed.
Explicit Exchange Report: EXCH_RPT
The table below shows the report bits: EXCH_RPT (%MWr.m.c.1)
Standard Symbol
|
Type
|
Access
|
Meaning
|
Address
|
STS_ERR
|
BOOL
|
R
|
Error detected while reading channel status words
(1 = detected error)
|
%MWr.m.c.1.0
|
CMD_ERR
|
BOOL
|
R
|
Error detected during a command parameter exchange
(1 = detected error)
|
%MWr.m.c.1.1
|
ADJ_ERR
|
BOOL
|
R
|
Error dectected during an adjust parameter exchange
(1 = detected error)
|
%MWr.m.c.1.2
|
RECONF_ERR
|
BOOL
|
R
|
Error detected during reconfiguration of the channel
(1 = detected error)
|
%MWr.m.c.1.15
|
The following table describes the steps realized between a couting module and the system after a power-on.
Step
|
Action
|
1
|
Power on.
|
2
|
The system sends the configuration parameters.
|
3
|
The system sends the adjust parameters by WRITE_PARAM method.
Note: When the operation is finished, the bit %MWr.m.c.0.2 switches to 0.
|
If, in the begining of your application, you use a WRITE_PARAM command, wait until the bit %MWr.m.c.0.2 switches to 0.