Support for more custom parameters like maximal current
Major update to allow reading and writing of more paramters, using the "custom parameter" range from PILS.
Split the parameter handling for an 5010 device into different function blocks, refactoring duplicated code into one place.
Add a definition to allow other functionality to be used: Coe can be used to read parameters from an EtherCAT terminal, and/or to write them. This is used to implement parameter for "move" and "idle" current. Note that there is no easy way to find out, which (stepper) terminal is connected to which axis, so some configuration data needs to be filled in by the application.
Paramaters for NC can be read and writen using ADS, and here there is an easier connection beetwen the NC axis and the PLC axis by using the AxisId.
Add a way to read the name of custom parameters, by (mis)using info type 40..71 This is not covered by the original spec (but useful)
Add handling for custom parameters 216 and 217, "position lag filter time" (or so) "in target position time" (or so) and enable them by default.
An application may choose to use those parameters for other purposes, if needed. Note that we have more than 20 unused custom paramters to be filled with live, before running out of numbers.
And now an example, how to use the custom parameters. In the file solution/tc_project_app/tc_pils_app_specific/POUs/PILS_DEVICES.TcPOU
add code like this:
IF NOT PILSv2.bPILSV2isInitialized THEN GVL_PILS.astDevices[fbMotorM1.nPILSDeviceNumber].stCustomParameterInfo195.something := something END_IF
In a shortened version, you get the point, still inside the IF NOT PILSv2.bPILSV2isInitialized THEN // Time compensation mode for an axis with encoder, via ADS to NC xxx...195.eCustomParameterHandler := E_CustomParameterHandler.eCustomParameterHandlerNC; xxx...195.ePermission := E_Permission.eWrite; xxx...195.eCustomParameterDataType := E_CustomParameterDataType.eCustomParameterDataTypeUINT32; xxx...195.nIndexGroup := 16#5000; xxx...195.nIndexOffset := 16#20; xxx...195.sName := 'CfgTimeCompensationModeEncoder';
// Time compensation value for an axis with encoder, via ADS to NC xxx...196.eCustomParameterHandler := E_CustomParameterHandler.eCustomParameterHandlerNC; xxx...196.ePermission := E_Permission.eWrite; xxx...196.eCustomParameterDataType := E_CustomParameterDataType.eCustomParameterDataTypeUINT32; xxx...196.nIndexGroup := 16#5000; xxx...196.nIndexOffset := 16#22; xxx...196.sName := 'CfgAdditionalEncoderDelay';
// Idle (=reduced) current for a stepper terminal via Coe xxx...62.eCustomParameterHandler := E_CustomParameterHandler.eCustomParameterHandlerStdLibCoeDrive; xxx...62.ePermission := E_Permission.eWrite; xxx...62.eCustomParameterDataType := E_CustomParameterDataType.eCustomParameterDataTypeUINT16; xxx...62.sNetId := GVL_APP.sNetIdDevices; xxx...62.nSLaveAddr := GVL_APP.nSlaveAddrEL7073_1; xxx...62.nIndexGroup := 16#8010; xxx...62.nIndexOffset := 16#2; xxx...62.sName := 'CfgIdleCurrent';
// Move (=maximal) current for a stepper terminal via Coe xxx...64.eCustomParameterHandler := E_CustomParameterHandler.eCustomParameterHandlerStdLibCoeDrive; xxx...64.ePermission := E_Permission.eWrite; xxx...64.eCustomParameterDataType := E_CustomParameterDataType.eCustomParameterDataTypeUINT16; xxx...64.sNetId := GVL_APP.sNetIdDevices; xxx...64.nSLaveAddr := GVL_APP.nSlaveAddrEL7073_1; xxx...64.nIndexGroup := 16#8010; xxx...64.nIndexOffset := 16#1;
Changes to be committed: new file: DUTs/E_CustomParameterDataType.TcDUT new file: DUTs/E_CustomParameterHandler.TcDUT modified: DUTs/ST_AxisParameters.TcDUT new file: DUTs/ST_CustomParameterInfo.TcDUT modified: DUTs/ST_DeviceInfo.TcDUT modified: POUs/INDEXER_COMM.TcPOU modified: POUs/PILS_device_types/FB_5010_Axis.TcPOU new file: POUs/PILS_device_types/FB_5010_NC_Coe_Param.TcPOU new file: POUs/PILS_device_types/FB_5010_stdlibPLCopenParam.TcPOU