Siemens SIMOTION Function Manual page 55

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

Advertisement

Example with _getPnIpConfig and _setPnIpConfig (as of V4.4, asynchronous call)
16378;
END_IMPLEMENTATION
Example with _getIpConfig and _setIpConfig (up to V4.3)
// Variable declaration
VAR
Basic Functions for Modular Machines
Function Manual, 04/2014
bgrPnIpConfig.ioId
bgrPnIpConfig.logAddress
bgrPnIpConfig.ip [0]
bgrPnIpConfig.ip [1]
bgrPnIpConfig.ip [2]
bgrPnIpConfig.ip [3]
bgrPnIpConfig.mask [0]
bgrPnIpConfig.mask [1]
bgrPnIpConfig.mask [2]
bgrPnIpConfig.mask [3]
bgrPnIpConfig.gate [0]
bgrPnIpConfig.gate [1]
bgrPnIpConfig.gate [2]
bgrPnIpConfig.gate [3]
bgrPnIpConfig.storePermanent
bgrPnIpConfig.commandId
bgrPnIpConfig.nextCommand
bgrPnIpConfig.result_setIpConfig := 0;
bgrState := 2001;
2001:
// Call of _setPnIpConfig
bgrPnIpConfig.result_setIpConfig := _setPnIpConfig (
logicalAddressPnInterface
storeIpConfigPermanent
nextCommand
commandId
CASE bgrPnIpConfig.result_setIpConfig OF
16#0000:
16#7001:
16#7002:
16#7003:
ELSE
END_CASE;
ELSE
; // Error handling
END_CASE;
END_PROGRAM
ipRead : ARRAY [1..2] OF StructRetIpConfig;
setIpAddress : ARRAY [0..5] OF USINT;
setIpSubnet
: ARRAY [0..5] OF USINT;
setIpGateway : ARRAY [0..5] OF USINT;
retUdint : UDINT;
Setting the communication addresses via the user program
ioId
ipAddress
subnetMask
gatewayAddress
// Function terminated successfully
bgrState := 0;
; // Function started
; // Function active
; // Function aborted
// Error
bgrState := 20009;
4.4 Setting the IP address (on Ethernet)
:= INPUT;
:= X150_PORT_1_LOG_ADDRESS; //
:= 169;
:= 250;
:= 11;
:= 169;
:= 255;
:= 255;
:= 0;
:= 0;
:= 169;
:= 250;
:= 11;
:= 1;
:= NO;
:= _getCommandId ();
:= IMMEDIATELY;
:= bgrPnIpConfig.ioId,
:= bgrPnIpConfig.logAddress,
:= bgrPnIpConfig.ip,
:= bgrPnIpConfig.mask,
:= bgrPnIpConfig.gate,
:= bgrPnIpConfig.storePermanent,
:= bgrPnIpConfig.nextCommand,
:= bgrPnIpConfig.commandId );
55

Advertisement

Table of Contents
loading

Table of Contents