Y_WriteParameters
This Function Block writes servo parameters in the controller to the drive. This functionality is useful in case of drive replacement on a machine.
Parameters
| * | Parameter | Data Type | Description | Default |
|---|---|---|---|---|
| VAR_IN_OUT | ||||
| B | Axis | AXIS_REF | Logical axis reference. This value can be located on the Configuration tab in the hardware configuration (logical axis number). | |
| VAR_INPUT | ||||
| B | Execute | BOOL | Upon the rising edge, all other function block inputs are read and the function is initiated. To modify an input, change the value and re-trigger the execute input. | FALSE |
| V | File | STRING | Optional, but if specified it is relative to /opt/plcnext/projects/PCWE/Plc/DriveParam/ on the controller. | AXIS#DrivePn.xml |
| VAR_OUTPUT | ||||
| B | Done | BOOL | Set high when the commanded action has completed successfully. If another block takes control before the action is completed, the Done output will not be set. This output is reset when Execute goes low. | |
| B | Busy | BOOL | Set high upon the rising edge of the Execute input, and reset when Done, CommandAborted, or Error is true. In the case of a function block with an Enable input, a Busy output indicates the function is operating, but not ready to provide Valid information. (No Error) | |
| B | Error | BOOL | Set high if an error has occurred during the execution of the function block. This output is cleared when 'Execute' or 'Enable' goes low. | |
| E | ErrorID | UINT | If Error is true, this output provides the Error ID. This output is reset when 'Execute' or 'Enable' goes low. | |
Notes
- This function block is useful if a device is replaced in the field, as the application program can configure a drive for use without additional software.
- Parameter settings written by this function block are saved to the EEPROM (permanent memory of the servoapck) automatically. If for any reason, the save to EEPROM cannot be accomplished, a save can be initiated by a specific write value to CoE object 1010h "Store Parameters". This writes all parameters to the EEPROM. Y_EC_COE_SdoWrite can be used to write CoE object 1010 to trigger a permanent write to EEPROM. See example below.
- Some drive parameter changes do not take effect until after the drive is rebooted. ErrorID 4916 is reported if a servo reboot is required.
-
The function block will report errorID 4915 if the EEPROM-save operation isn't supported, or if the operation fails for any reason (including being servo-on).
Related Function Blocks
Y_VerifyParameters : compares the current parameters in the drive with the parameter file stored in the controller.
Error Description
See the Function Block ErrorID List .
Example
If a permanent write to the EEPROM of the servo was not possible, one could try to use the method shown below to write parameters to the servo EEPROM.