Siemens SIMOTION Function Manual page 50

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.3 Setting the device name (NameOfStation) of an IO device on PROFINET IO
Example with _getPnPortNeighbour, _getPnNameOfStation, _setPnNameOfStation (as of V4.4,
asynchronous call)
bgrNameOfStation.logAddressPort,
3001;
bgrNameOfStation.logAddressPort,
bgrNameOfStation.nameOfStation,
bgrNameOfStation.storePermanent,
50
16#7003:
ELSE
END_CASE;
2000:
// Initialization for _getPnNameofStation
bgrNameOfStation.ioId
bgrNameOfStation.logAddressPort := X150_INTERFACE_LOG_ADDRESS;
bgrNameOfStation.commandId
bgrNameOfStation.nextCommand
bgrNameOfStation.retNameOfStation.functionResult := 0;
bgrNameState := 2001;
2001:
// Call of _getPnNameofStation
bgrNameOfStation.retNameOfStation := _getPnNameOfStation (
ioId
logicalAddressPnInterface :=
nextCommand
commandId
CASE bgrNameOfStation.retNameOfStation.functionResult OF
16#0000:
16#7001:
16#7002:
16#7003:
ELSE
END_CASE;
3000:
// Initialization for _setPnNameofStation
bgrNameOfStation.ioId
bgrNameOfStation.logAddressPort := X150_INTERFACE_LOG_ADDRESS;
bgrNameOfStation.nameOfStation
bgrNameOfStation.storePermanent := NO;
bgrNameOfStation.commandId
bgrNameOfStation.nextCommand
bgrNameOfStation.ret
3001:
// Call of _setPnNameofStation
bgrNameOfStation.ret := _setPnNameOfStation(
ioId
logicalAddressPnInterface
NameOfStation
storeNameOfStationPermanent :=
nextCommand
commandId
CASE bgrNameOfStation.ret OF
16#0000:
16#7001:
; // Function aborted
// Error
bgrNameState := 10009;
// Function terminated successfully
bgrNameState := 3000;
; // Function started
; // Function active
; // Function aborted
// Error
bgrNameState := 20009;
// Function terminated successfully
bgrNameState := 0;
; // Function started
:= INPUT;
:= _getCommandId ( );
:= IMMEDIATELY;
:= bgrNameOfStation.ioId,
:= bgrNameOfStation.nextCommand,
:= bgrNameOfStation.commandId);
:= INPUT;
:= 'blaalb';
:= _getCommandId ( );
:= IMMEDIATELY;
:= 0;
bgrNameState :=
:= bgrNameOfStation.ioId,
:=
:=
:= bgrNameOfStation.nextCommand,
:= bgrNameOfStation.commandId);
Basic Functions for Modular Machines
Function Manual, 04/2014

Advertisement

Table of Contents
loading

Table of Contents