To be able to carry out adjustment operations, you need access the module’s own data.
Access is gained using the following instructions.
Sending Adjustment Parameters to the Module
Parameters are sent from the module channel using the WRITE_PARAM instruction, with the following syntax:
WRITE_PARAM (%CH r.m.0)
This instruction sends the contents of the parameters to the module and waits for its acknowledgement. This may necessitate several task cycles.
Monitoring Parameter Recognition
As the module can take several task cycles to acknowledge values, two memory words are used to monitor the exchanges: %MWr.m.0.0 and %MWr.m.0.1
-
The first word %MWr.m.0.0 shows that there is an exchange in progress.
-
The second word %MWr.m.0.1 gives the exchange report.
-
Rank 2 bits are associated with the adjustment parameters:
Writing the module’s parameters in slot 2 of rack 0:
WRITE_PARAM (%CH2.0) involves:
-
Sending the adjustment parameters.
-
Setting the %MW2.0.0.2 bit to 1, showing that the adjustment parameters are being sent. This bit remains at 1 until the module sends a report. The bit then goes back to 0. The exchange report bit is then relevant,
-
The %MW2.0.1.2 exchange report bit is set at 1 if an error is detected during the exchange. The 0 value shows that the data has been accepted by the module.
Reading the Adjustment Parameters
The READ_PARAM instruction is used to read the module's adjustment parameters and to update the PLC's memory. It is particularly useful after a WRITE_PARAM that the module has not accepted. Reading the adjustment parameters can take several task cycles.
The adjustment parameters are read from the module’s channel using the READ_PARAM instruction, with the following syntax:
READ_PARAM (%CH r.m.0)
Saving the Adjustment Parameters
The SAVE_PARAM Instruction allows you to copy the current values of the module's adjustment parameters in the backup zone defined in the processor memory. The backup zone is not accessible from the language.
This instruction can take several task cycles to be executed. The module’s adjustment parameters are saved using the SAVE_PARAM instruction, with the following syntax:
SAVE_PARAM (%CH r.m.0)
Restoring the Saved Adjustment Parameters
The RESTORE_PARAM instruction supports restoring of the saved adjustment parameter values in the processor’s memory and in the module.
The adjustment parameters are restored from the module using the RESTORE_PARAM instruction, with the following syntax:
RESTORE_PARAM (%CH r.m.0)