IoDrvModbusTCP_Diag.GetSpecificDeviceState (METH) ¶ METHOD GetSpecificDeviceState : DED.ERROR Returns the fieldbus specific device state; interpretation is fieldbus dependent InOut: Scope Name Type Comment Return GetSpecificDeviceState DED.ERROR Input pData CAA.PVOID Pointer to memory szSize CAA.SIZE Size of memory in bytes where pData is pointing to Output szCount CAA.SIZE Number of Bytes written to pData
IoDrvModbusTCP_Diag.SetCommunicationState (METH) ¶ METHOD SetCommunicationState : DED.ERROR Starts, stops or resets a device InOut: Scope Name Type Return SetCommunicationState DED.ERROR Input eRequestedState DED.DEVICE_TRANSITION_STATE
INode ¶ ChildNodeCount (Property) Enable (Property) FirstChildNode (Property) IsRootNode (Property) NextSiblingNode (Property) ParentNode (Property) SiblingNodeCount (Property)
ConfigError (ENUM) ¶ TYPE ConfigError : Attributes: qualified_only InOut: Name Initial Comment OK 0 Success INVALID_ID 1 The provided ID is not valid INVALID_STATE 2 The current device status does not allow update of the value INVALID_DEVICE_TYPE 3 Operation not possible for this type of device INDEX_NOT_FOUND 4 INVALID_DATA_LEN 5 NOT_IMPLEMENTED 16#FF This driver does not implement the config update
ControllerConfigUtil (FB) ¶ FUNCTION_BLOCK ControllerConfigUtil This function block can be used to adapt some parameters of the initially downloaded profinet controller config-structure (device tree). For example this way the IP-adresses of the slaves that are configured for this controller can be adapted at runtime. The FB is typically used with the Reconfigure-feature (see DED.Reconfigure function block). Example: Reconfigure a single slave PROGRAM PLC_PRG VAR ip : ProfinetCommon.IPParameterValue := ( IPAddress := [192, 168, 0, 2] , Subnetmask := [255, 255, 255, 0] ); i : DINT ; enable : BOOL := FALSE ; moduleDevice : DED.IDevice ; reconf : DED.Reconfigure ; configUtil : IoDrvProfinetBase.ControllerConfigUtil ; updateIP : IoDrvProfinetBase.ConfigError ; END_VAR //note: pn_device is some (initially disabled) profinet slave in the device-tree of the application IF ( enable AND NOT pn_device.Enable ) THEN updateIP := configUtil.UpdateIPSettings ( pn_device , ip ); // change configured ip-address //enable device and modules pn_device.Enable := enable ; FOR i := 0 TO TO_DINT ( pn_device.ChildNodeCount ) - 1 DO moduleDevice := INode_To_IDevice ( pn_device.GetChild ( TO_UDINT ( i ))); configUtil.UpdateSlotNumber ( moduleDevice , TO_UINT ( i + 1 )); // change configured slot number moduleDevice.Enable := enable ; END_FOR reconf.xExecute := TRUE ; END_IF reconf ( itfNode := pn_device ); //start reconfigure Methods: GetDataRecord GetDeviceInfo GetSubmoduleInfo UpdateDataRecord UpdateIPSettings UpdateSlotNumber UpdateStationName UpdateSubslotNumber Structure: GetDataRecord (Method) GetDeviceInfo (Method) GetSubmoduleInfo (Method) UpdateDataRecord (Method) UpdateIPSettings (Method) UpdateSlotNumber (Method) UpdateStationName (Method) UpdateSubslotNumber (Method)
ControllerConfigUtil.GetDataRecord (METH) ¶ METHOD GetDataRecord : ConfigError Get a data record of a submodule. By using this method together with UpdateDataRecord(), the settings / parameters of a module or device can be updated at runtime. InOut: Scope Name Type Comment Return GetDataRecord ConfigError Input ID DWORD ID of the submodule that is owner of the data record INDEX UINT Index of the data record MLEN UDINT Maximum length to be read RECORD POINTER TO BYTE Data record Output LEN UDINT Length of the data record
ControllerConfigUtil.GetDeviceInfo (METH) ¶ METHOD GetDeviceInfo : BOOL Get the detailed Profinet DeviceInfo data from a Profinet Slave node that is attached below a controller node. InOut: Scope Name Type Comment Return GetDeviceInfo BOOL Input pnDevice DED.IDevice The Profinet Slave device Output device ProfinetCommon.DeviceInfo The data of the current device. (Valid if return value is TRUE)
ControllerConfigUtil.GetSubmoduleInfo (METH) ¶ METHOD GetSubmoduleInfo : BOOL Get the detailed Profinet SubmoduleInfo data from a Profinet Slave- / Module- / Submodule- node that is attached somewhere below a controller node. Some Profinet config nodes may contain more than a single submodule, like for example the slave-node itself which contains at least one interface- and serveral port-submodules. InOut: Scope Name Type Comment Return GetSubmoduleInfo BOOL Input pnDevice DED.IDevice A Profinet Config node that contains submodule-data. submoduleIndex DINT The index of the submodule within the device node (starting with 0) Output submodule ProfinetCommon.SubmoduleInfo The data of the current submodule. (Valid if return value is TRUE)
ControllerConfigUtil.UpdateDataRecord (METH) ¶ METHOD UpdateDataRecord : ConfigError Update the value of a data record parameter of a submodule. By using this method together with GetDataRecord(), the settings / parameters of a module or device can be updated at the runtime of an application. The device first has to be deactivated (DED.Reconfigure function block), then update the setting and re-activate it again. The updated parameters will be used, when the new connection is established. Example: Reconfigure a single slave PROGRAM PLC_PRG VAR util : IoDrvProfinetBase.ControllerConfigUtil ; moduleID : UDINT ; error : IoDrvProfinetBase.ConfigError ; byteData : ProfinetCommon.ProfinetByteData ; buffer : ARRAY [0..15] OF BYTE ; recordLen : UDINT ; anyValue : UDINT ; reconf : DED.Reconfigure ; enabled : BOOL ; END_VAR //read a data item of type Unsigned32 from one of the submodule's record data parameters (each has an unique INDEX): moduleID := IoDrvProfinetBase.GetID ( Module_with_Parameters ); // here we access the module directly by the device object's name error := util.GetDataRecord ( ID := moduleID , INDEX := 10 , MLEN := SIZEOF ( buffer ), RECORD := ADR ( buffer ), LEN => recordLen ); // read the complete data record //read a specific value item from the data record paramter; byteData.InitData ( ADR ( buffer ), SIZEOF ( buffer )); anyValue := byteData.GetUnsigned32 ( 2 ); //within the data record, the value is at offset 2. //update the value - only possible while device is disabled (see below) byteData.PutUnsigned32 ( 2 , 2000 ); error := util.UpdateDataRecord ( ID := moduleID , INDEX := 10 , LEN := recordLen , RECORD := ADR ( buffer )); //enable / disable device which is parent of this module pn_device.Enable := enabled ; reconf ( itfNode := pn_device ); //start reconfigure (set xExecute := TRUE) to enable / disable PROFINET device that owns this module InOut: Scope Name Type Comment Return UpdateDataRecord ConfigError Input ID DWORD ID of the submodule that is owner of the data record INDEX UINT Index of the data record LEN UDINT Length to write RECORD POINTER TO BYTE Data record
ControllerConfigUtil.UpdateIPSettings (METH) ¶ METHOD UpdateIPSettings : ConfigError Change the configured IP settings of the slave configuration. Only possible if the connection to the slave is not active. InOut: Scope Name Type Comment Return UpdateIPSettings ConfigError Input pnDevice DED.IDevice A Profinet Controllers’s Slave-Config node IPSettings ProfinetCommon.IPParameterValue IP-Suite