Siemens SIMOTION Function Manual page 49

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

Advertisement

Example with _getPnPortNeighbour, _getPnNameOfStation, _setPnNameOfStation (as of V4.4,
asynchronous call)
END_INTERFACE
IMPLEMENTATION
X150_INTERFACE_LOG_ADDRESS;
bgrNamePortNeighbour.logAddressPort,
Basic Functions for Modular Machines
Function Manual, 04/2014
4.3 Setting the device name (NameOfStation) of an IO device on PROFINET IO
END_STRUCT;
bgrNameStruct
ioId
logAddressPort
nameOfStation
storePermanent
commandId
nextCommand
startAgain
retNameOfStation
ret
END_STRUCT;
END_TYPE
VAR_GLOBAL
bgrStart
bgrNameState
bgrNamePortNeighbour
bgrNameOfStation
END_VAR
PROGRAM bgrName;
PROGRAM bgrName
CASE bgrNameState OF
0:
IF bgrStart THEN
bgrNameState := 1000;
bgrStart := FALSE;
END_IF;
1000:
// Initialization for _getPnPortNeighbour
bgrNamePortNeighbour.ioId
bgrNamePortNeighbour.logAddressPort :=
bgrNamePortNeighbour.commandId
bgrNamePortNeighbour.nextCommand
bgrNamePortNeighbour.retPortNeighbour.functionResult := 0;
bgrNameState := 1001;
1001:
// Call of _getPnPortNeighbour
bgrNamePortNeighbour.retPortNeighbour := _getPnPortNeighbour (
nextCommand
commandId
CASE bgrNamePortNeighbour.retPortNeighbour.functionResult OF
16#0000:
16#7001:
16#7002:
Setting the communication addresses via the user program
: STRUCT
: EnumIoIdType;
: DINT;
: STRING;
: EnumYesNo;
: commandIdType;
: enumNextCommandMode;
: BOOL;
: StructRetDeviceNameOfStation;
: DINT;
: BOOL := FALSE;
: DINT := 0;
: bgrPortNeighbourStruct;
: bgrNameStruct;
ioId
logicalAddressOfPnPort :=
// Function terminated successfully
bgrNameState := 2000;
; // Function started
; // Function active
:= INPUT;
:= _getCommandId ();
:= IMMEDIATELY;
:= bgrNamePortNeighbour.ioId,
:= bgrNamePortNeighbour.nextCommand,
:= bgrNamePortNeighbour.commandId);
49

Advertisement

Table of Contents
loading

Table of Contents