Subsection: Parameter
The section Parameter
with the subsections SetParameter
and AddParameter
serves to add or modify parameters of devices. This allows to generate specific settings of devices (example: cycle time).
SEC DeviceGenerator //optional: yes, modifier: [UPDATE] SEC Parameters : <parameter name> //optional: yes, modifier: [UPDATE] SEC SetParameter : <parameter name> //optional: yes, modifier: [UPDATE] ParameterID := <parameterID name>; //optional: no, type: literal/string ElemPath := <elempath name>; //optional: no, type: literal/string ConnectorID := <connector ID>; //optional: yes, type: literal/string Value := <value name>; //optional: no, type: literal/string ChildIndex := <device ID>; Download := <boolean value> // opional: yes, type: boolean END_SEC SEC AddParameter : <parameter name> //optional: yes, modifier: [UPDATE] ParameterID := <parameterID name>; //optional: no, type: literal/string ParameterName := <parameter name>; //optional: no, type: literal/string ParameterType := <parameter type>; //optional: no, type: literal/string ChannelType := <channel type>; //optional: yes, type: enum ConnectorID := <connector ID>; //optional: yes, type: literal/string ChildIndex := <device ID>; END_SEC END_SEC END_SEC
The
Parameters
section has a target, with which theDeviceID
of the target device is defined, whose parameter should be edited. The target device will be searched first in the devices of the module and then in their parent history. Wildcard devices or other devices are also possible. It is assumed that this devices have the corresponding parameter or that the corresponding parameter can be added. If the scan cannot find the target device a warning will be displayed.The targets of the sections
SetParameter
andAddParameter
define the Id of the respective section but have no further use.
SetParameter
:ParameterID
defines theParameterID
of the parameter of the device which will be modified.ElemPath
specifies the exact element of the parameter which will be changed.The parameter
ConnectorID
optionally defines the connector of the device, whose HostParemeterSet contains the parameter Id. If noConnectorID
is specified, theParameterID
is searched for under the DeviceParameterSet.Value
defines the value which will be assigned to the element of the specified parameter. This value must be compatible to the element type. The value can be an expression for example[paramID] + 2*MODULE_SLOT_INDEX
There[paramID]
defines a target ID of a parameter, so that[paramID]
will be replaced by the parameter value. TheMODULE_SLOT_INDEX
keyword is replaced by the slot index that a module instance of the defined module type would have after insertion.If the parameter cannot be found in the target device, the generator check will create warnings.
ChildIndex
defines the subordinate device, under which the parameter is added or set. If this subordinate device with the specific index does not exist, then a warning is generated during the generation.Download
: Optional entry. If this entry has the valueFALSE
, then the parameter will not be downloaded to the device. This makes sense to use, for example, to disableCheckVendorId
for CAN devices, for example.
AddParameter
:ParameterID
defines the new ID of the parameter to be added. This must be unique among the other ParameterIDs of the target device.The parameter
ConnectorID
optionally defines the connector of the device, whose HostParemeterSet contains the parameter Id to be added. If no connector ID is defined the Parameter ID will be added in DeviceParameterSet.ParameterName
defines the name of the parameter added to the target device.ParameterType
defines the type of the parameter added to the target device. This type is named according to IEC type notation with type prefix. Therefore example:std:bool
will create a boolean parameter.If the parameter cannot be added, the generator check will create warnings.
ChannelType
defines the type of the channel. Possible values areNONE
,INPUT
,OUTPUT
, andOUTPUTREADONLY
.ChildIndex
defines the subordinate device, under which the parameter is added or set. If this subordinate device with the specific index does not exist, then a warning is generated during the generation.
Both sections AddParameter
and SetParameter
can be used together to add a parameter to a device and to assign a value to it at the same time.
SEC Parameters : Buskoppler1 SEC AddParameter : ExpertSettings ParameterID := '805306368'; ConnectorID := '1'; ParameterName := 'ExpertSettings'; ParameterType := 'std:int'; ChannelType := OUTPUT; END_SEC SEC SetParameter : ExpertSettings ParameterID := '805306368'; ElemPath := ''; ConnectorID := '1'; Value := dwParameterOffset + 2 * MODULE_SLOT_INDEX; END_SEC END_SEC