Siemens SIMOTION Function Manual page 56

Motion control basic functions for modular machines
Hide thumbs Also See for SIMOTION:
Table of Contents

Advertisement

Setting the communication addresses via the user program
4.4 Setting the IP address (on Ethernet)
Example with _getIpConfig and _setIpConfig (up to V4.3)
address 0. *)
END_VAR
// Read the current data of the Ethernet interfaces
ipRead[1] := _getIpConfig (
ipRead[2] := _getIpConfig (
// Change of the Ethernet interface IE_01.
// Check whether a change is necessary.
IF ( ip_conf_id <> ipRead[1].ipAddress[3] ) THEN
subnet masks have been changed: *)
END_IF;
56
(* IP address of the configuration will be read from the input with
ip_conf_id AT %IB0 : USINT;
ethernetInterface:= IE_01
ethernetInterface:= IE_02
// Make the data to be changed available
setIpAddress := ipRead[1].ipAddress;
setIpAddress[3] := ip_conf_id;
setIpSubnet := ipRead[1].subnetMask;
setIpGateway := ipRead[1].gatewayAddress;
(* Check whether the two Ethernet interfaces are different after the
IF ( ipRead[2].subnetMask <> setIpSubnet ) THEN
// Set the data of the Ethernet interface IE_01
retUdint := _setIpConfig (
ethernetInterface := IE_01,
ipAddress := setIpAddress,
subnetMask := setIpSubnet,
gatewayAddress := setIpGateway
);
ELSE
; // No change, error response.
// Also change interface IE_02, if necessary.
END_IF;
);
);
Basic Functions for Modular Machines
Function Manual, 04/2014

Advertisement

Table of Contents
loading

Table of Contents