PDMC V1.1/V4.1.0.0 Configuration
Configuration Resources
GSDML
GSDML-V2.35-HILSCHER-NETX 90-RE PNS_Profifrive-20200402.xml
Configuration
Configuration Sequence
To configure the PROFINET stack the following procedure must be followed(From: Protocol API PROFINET IO-Device V5.3.0)
Set Configuration Request Description
Set Configuration Packet
Variable | Type | Value/Range | Notes |
---|---|---|---|
ulSystemFlags | uint32_t | PNS_IF_SYSTEM_START_AUTO_START | PNS_IF_SYSTEM_ARDY_WOUT_APPL_REG_ENABLED; | |
ulWdgTimer | uint32_t | 1000 | |
ulVendorId | uint32_t | 0x011E | |
ulDeviceId | uint32_t | 0x1003 | Has to be 0x0130 |
ulScrId | uint32_t | 0 | |
ulLen | uint32_t | 8 | |
ulId | uint32_t | 0 | |
ulNameOfStationLen | uint32_t | sizeof("netxV5repns") - 1 | |
abNameOfStation[240] | uint8_t[] | "netxV5repns" | |
ulTypeOfStationLen | uint32_t | sizeof("NETX PROFIDrive AC1") - 1 | has to be zero according to PNS API manual |
abTypeOfStation | uint8_t[] | "NETX PROFIDrive AC1" | has to be zero according to PNS API manual |
abDeviceType | uint8_t[] | "NETX PROFIDrive AC1" | Has to mach the GSDML |
abOrderId | uint8_t[] | 0 | |
ulIpAddr | uint8_t | 0 | |
ulNetMask | uint8_t | 0 | |
ulGateway | uint8_t | 0 | |
usHwRevision | uint16_t | 0 | |
usSwRevision1 | uint16_t | 5 | |
usSwRevision2 | uint16_t | 3 | |
usSwRevision2 | uint16_t | 0 | |
bSwRevisionPrefix | uint8_t | "V" | |
bReserved | uint8_t | 0 | |
usMaxDiagRecords | uint16_t | 16 | |
usInstanceId | uint16_t | 1 | |
usReverved | uint16_t | 0 |
Set Configuration Parameters Source
long SetConfigParams( void* pvPck, uint16_t usDeviceClass ) { uint8_t ab_IpAddrGatewayNeMask[12] = { 0 }; uint8_t ab_DeviceNameWithLegnth[241] = { 0 }; memcpy( IM0.abManufacturerSpecific , "0", sizeof( "0" ) ); memcpy( IM0.abOrderId , " ", sizeof( " " ) ); memcpy( IM0.abOrderId , "1234.567", sizeof( "1234.567" )-1 ); //From FDL and GSDML memcpy( IM0.abSerialNumber , "20000", sizeof( "20000" ) ); //From FDL IM0.tSoftwareRevision.bPrefix ='V'; IM0.tSoftwareRevision.bX = 5; IM0.tSoftwareRevision.bY = 3; IM0.tSoftwareRevision.bZ = 0; IM0.usHardwareRevision = 3; //From FDL and GSDML IM0.usIMSupported = 0x000E; // IM1, IM2 and IM3 IM0.usIMVersion = 0x101; IM0.usManufacturerId = 0x011E; // VendorID From FDL and GSDML IM0.usProfileId = 0x00; // Manufacturer specific IM0.usProfileSpecificType = 5; // Generic Device PNS_IF_DEVICE_PARAMETER_T *ptSetConfig = pvPck; /* First set arrays to zero */ memset( ptSetConfig->abNameOfStation, 0x00, 240 ); /* The NameOfStation as ASCII char-array */ memset( ptSetConfig->abTypeOfStation, 0x00, 240); /* The TypeOfStation as ASCII char-array */ memset( ptSetConfig->abDeviceType, 0x00, 28); /* The DeviceType as ASCII char-array */ memset( ptSetConfig->abOrderId, 0x00, 20); /* The OrderId as ASCII char-array */ ptSetConfig->ulSystemFlags = PNS_IF_SYSTEM_START_AUTO_START | //PNS_IF_SYSTEM_STACK_HANDLE_I_M_ENABLED | PNS_IF_SYSTEM_ARDY_WOUT_APPL_REG_ENABLED; //PNS_IF_SYSTEM_NAME_IP_HANDLING_BY_STACK_ENABLED; /* Flags to use are defined in this file */ ptSetConfig->ulWdgTime = 1000; /* Watchdog time (in milliseconds) */ ptSetConfig->ulVendorId = IM0.usManufacturerId; /* Vendor ID */ ptSetConfig->ulMaxAr = 0; /* Currently not used */ ptSetConfig->ulCompleteInputSize = 0; /* Maximum amount of allowed input data */ ptSetConfig->ulCompleteOutputSize = 0; /* Maximum amount of allowed output data */ ptSetConfig->ulDeviceId = 0x0130; /* Device ID */ printf("DeviceID: %u\r\n", (unsigned int)ptSetConfig->ulDeviceId); /*Set Device Name with configuration packet works only if Flag: PNS_IF_SYSTEM_NAME_IP_HANDLING_BY_STACK_ENABLED is disabled. */ //HOSTAL_Read_Sektor(1,ab_DeviceNameWithLegnth); for (int i = 0 ; i<=240 ; i++) { if (ab_DeviceNameWithLegnth[i]!= 0xff) { memcpy( ptSetConfig->abNameOfStation, &ab_DeviceNameWithLegnth[1] , ab_DeviceNameWithLegnth[0] ); /* The NameOfStation as ASCII char-array */ ptSetConfig->ulNameOfStationLen = ab_DeviceNameWithLegnth[0]; /* Length of NameOfStation */ break; } else {} } memcpy( ptSetConfig->abTypeOfStation, "NETX V5 RE/PNS", sizeof( "NETX V5 RE/PNS" ) ); /* The TypeOfStation as ASCII char-array */ ptSetConfig->ulTypeOfStationLen = sizeof( "NETX V5 RE/PNS" ) - 1; /* Length of TypeOfStation */ memcpy( ptSetConfig->abDeviceType, "NETX V5 RE/PNS", sizeof( "NETX V5 RE/PNS" ) - 1 ); /* The DeviceType as ASCII char-array */ /*Set IP with configuration packet works only if Flag: PNS_IF_SYSTEM_NAME_IP_HANDLING_BY_STACK_ENABLED is disabled. */ //HOSTAL_Read_Sektor(2,ab_IpAddrGatewayNeMask); for (int i = 0 ; i<=12 ; i++) { if (ab_IpAddrGatewayNeMask[i]!= 0xff) { ptSetConfig->ulIpAddr = (((uint32_t) ab_IpAddrGatewayNeMask[0])) | (((uint32_t) ab_IpAddrGatewayNeMask[1])<<8) | (((uint32_t) ab_IpAddrGatewayNeMask[2])<<16) | (((uint32_t) ab_IpAddrGatewayNeMask[3])<<24); ptSetConfig->ulGateway = (((uint32_t) ab_IpAddrGatewayNeMask[4])) | (((uint32_t) ab_IpAddrGatewayNeMask[5])<<8) | (((uint32_t) ab_IpAddrGatewayNeMask[6])<<16) | (((uint32_t) ab_IpAddrGatewayNeMask[7])<<24); ptSetConfig->ulNetMask = (((uint32_t) ab_IpAddrGatewayNeMask[8])) | (((uint32_t) ab_IpAddrGatewayNeMask[9])<<8) | (((uint32_t) ab_IpAddrGatewayNeMask[10])<<16) | (((uint32_t) ab_IpAddrGatewayNeMask[11])<<24); break; } else { ptSetConfig->ulIpAddr = 0; /* IP address, default: 0.0.0.0 */ ptSetConfig->ulNetMask = 0; /* Network mask, default: 0.0.0.0 */ ptSetConfig->ulGateway = 0; } } ptSetConfig->usSwRevision1 = IM0.tSoftwareRevision.bX; /* Software Revision 1, default: 0 */ ptSetConfig->usSwRevision2 = IM0.tSoftwareRevision.bY; /* Software Revision 2, default: 0 */ ptSetConfig->usSwRevision3 = IM0.tSoftwareRevision.bZ; /* Software Revision 3, default: 0 */ ptSetConfig->bSwRevisionPrefix = IM0.tSoftwareRevision.bPrefix; /* Software Revision Prefix, default: 0 */ ptSetConfig->bReserved = 0; /* Reserved, set to zero */ ptSetConfig->usMaxDiagRecords = 16; /* The number of diagnosis records, default: 256 */ ptSetConfig->usInstanceId = 1; /* Instance ID, GSDML ObjectUUID_LocalIndex, default: 1 */ ptSetConfig->usReserved = 0; /* Reserved for future use, set to zero */ return sizeof( *ptSetConfig ); } /* SetConfigParams */
Module Configuration Description
tConfiguration.tSubmodules consists of the following modules:
DAP V3.5
Variable | Type | Value/Range |
---|---|---|
usSlot | uint16_t | 0x0000 |
usSubslot | uint16_t | 0x0001 |
ulModuleId | uint32_t | 0x00003093 |
ulSubmoduleId | uint32_t | 0x00003092 |
ulProvDataLen | uint32_t | 0 |
ulConsDataLen | uint32_t | 0 |
ulDPMOffsetIn | uint32_t | 0 |
ulDPMOffsetOut | uint32_t | 0 |
usOffsetOPSProvider | uint16_t | 0 |
usOffsetOPSConsumer | uint16_t | 0 |
usOffsetOCSProvider | uint16_t | 0 |
usOffsetOCSConsumer | uint16_t | 0 |
ulReserved | uint32_t | 0 |
PDEV PN-IO
Variable | Type | Value/Range |
---|---|---|
usSlot | uint16_t | 0 |
usSubslot | uint16_t | 0x8000 |
ulModuleId | uint32_t | 0x00003093 |
ulSubmoduleId | uint32_t | 0x00003093 |
ulProvDataLen | uint32_t | 0 |
ulConsDataLen | uint32_t | 0 |
ulDPMOffsetIn | uint32_t | 0 |
ulDPMOffsetOut | uint32_t | 0 |
usOffsetOPSProvider | uint16_t | 0 |
usOffsetOPSConsumer | uint16_t | 0 |
usOffsetOCSProvider | uint16_t | 0 |
usOffsetOCSConsumer | uint16_t | 0 |
ulReserved | uint32_t | 0 |
PDEV Port 1
Variable | Type | Value/Range |
---|---|---|
usSlot | uint16_t | 0 |
usSubslot | uint16_t | 0x8001 |
ulModuleId | uint32_t | 0x00003093 |
ulSubmoduleId | uint32_t | 0x00003094 |
ulProvDataLen | uint32_t | 0 |
ulConsDataLen | uint32_t | 0 |
ulDPMOffsetIn | uint32_t | 0 |
ulDPMOffsetOut | uint32_t | 0 |
usOffsetOPSProvider | uint16_t | 0 |
usOffsetOPSConsumer | uint16_t | 0 |
usOffsetOCSProvider | uint16_t | 0 |
usOffsetOCSConsumer | uint16_t | 0 |
ulReserved | uint32_t | 0 |
PDEV Port 2
Variable | Type | Value/Range |
---|---|---|
usSlot | uint16_t | 0 |
usSubslot | uint16_t | 0x8002 |
ulModuleId | uint32_t | 0x00003093 |
ulSubmoduleId | uint32_t | 0x00003094 |
ulProvDataLen | uint32_t | 0 |
ulConsDataLen | uint32_t | 0 |
ulDPMOffsetIn | uint32_t | 0 |
ulDPMOffsetOut | uint32_t | 0 |
usOffsetOPSProvider | uint16_t | 0 |
usOffsetOPSConsumer | uint16_t | 0 |
usOffsetOCSProvider | uint16_t | 0 |
usOffsetOCSConsumer | uint16_t | 0 |
ulReserved | uint32_t | 0 |
tConfiguration.tAPI_PDRV values:
Variable | Type | Value/Range |
---|---|---|
ulApi | uint32_t | 14848 |
ulNumSubmoduleItems | uint32_t | 2 |
Configuration.tSubmodules consists of the following modules:
PROFIDrive Device(P-device) Slot 1, subslot 1. MAP */
Variable | Type | Value/Range |
---|---|---|
usSlot | uint16_t | 0x0001 |
usSubslot | uint16_t | 0x0001 |
ulModuleId | uint32_t | 0x00004101 |
ulSubmoduleId | uint32_t | 0x0000FFFF |
ulProvDataLen | uint32_t | 0 |
ulConsDataLen | uint32_t | 0 |
ulDPMOffsetIn | uint32_t | 0 |
ulDPMOffsetOut | uint32_t | 0 |
usOffsetOPSProvider | uint16_t | 0 |
usOffsetOPSConsumer | uint16_t | 0 |
usOffsetOCSProvider | uint16_t | 0 |
usOffsetOCSConsumer | uint16_t | 0 |
ulReserved | uint32_t | 0 |
PROFIDrive Device(P-device) Slot 1, subslot 2. Standard Telegram */
Variable | Type | Value/Range |
---|---|---|
usSlot | uint16_t | 1 |
usSubslot | uint16_t | 2 |
ulModuleId | uint32_t | 0x00004101 |
ulSubmoduleId | uint32_t | 0x00000001 |
ulProvDataLen | uint32_t | 4 |
ulConsDataLen | uint32_t | 4 |
ulDPMOffsetIn | uint32_t | 0 |
ulDPMOffsetOut | uint32_t | 0 |
usOffsetOPSProvider | uint16_t | 0 |
usOffsetOPSConsumer | uint16_t | 0 |
usOffsetOCSProvider | uint16_t | 0 |
usOffsetOCSConsumer | uint16_t | 0 |
ulReserved | uint32_t | 0 |
Set Module Configuration Source
long SetModulConfig( void* pvPck ) { PNS_IF_MODULE_CFG_REQ_DATA_T *ptModule=pvPck; PNS_IF_API_STRUCT_T *ptApi = NULL; PNS_IF_SUBMODULE_STRUCT_T *ptSubmod = NULL; ptModule->ulNumApi = 0x02; /* Number of API elements to follow */ ptApi = ( PNS_IF_API_STRUCT_T * ) ( ptModule + 1 ); /* Pointer to Module configuration */ ptApi->ulApi = 0; /* Number of the API profile to be configured */ ptApi->ulNumSubmodItems = 0x04; /* Number of submodule-items this API contains */ ptSubmod = ( PNS_IF_SUBMODULE_STRUCT_T * ) ( ptApi + 1 ); /* Pointer to Submodule configuration */ /* Configure the DAP V3.5 */ ptSubmod->usSlot = 0x0000; /* Slot this submodule belongs to */ ptSubmod->usSubslot = 0x0001; /* Subslot of this submodule */ ptSubmod->ulModuleId = 0x00003093; /* Module ID to which this submodule belongs */ ptSubmod->ulSubmodId = 0x00003092; /* Submodule ID */ ptSubmod->ulProvDataLen = 0x00000000; /* Length of provider data (sent by IO-Device, received by IO-Controller) */ ptSubmod->ulConsDataLen = 0x00000000; /* Length of consumer data (sent by IO-Controller, received by IO-Device) */ ptSubmod->ulDPMOffsetOut = 0x00000000; /* Offset in DPM OutputArea or in Output-image, where provided data of the*/ /* submodule shall be taken from */ ptSubmod->ulDPMOffsetIn = 0x00000000; /* Offset in DPM InputArea or in Input-image, where consumed data for the */ /* submodule shall be copied to */ ptSubmod->usOffsetIOPSProvider = 0x0000; /* Offset where the stack shall take the IOPS provider state for this */ /* submodule relative to beginning of IOPS block in DPM output area from */ ptSubmod->usOffsetIOPSConsumer = 0x0000; /* Offset where the stack shall put the IOPS consumer state of this */ /* submodule relative to beginning of IOPS block in DPM input area to */ ptSubmod->usOffsetIOCSProvider = 0x0000; /* Offset where the stack shall take the IOCS provider state for this */ /* submodule relative to beginning of IOCS block in DPM output area from */ ptSubmod->usOffsetIOCSConsumer = 0x0000; /* Offset where the stack shall put the IOCS consumer state for this */ /* submodule relative to beginning of IOCS block in DPM input area to */ ptSubmod->ulReserved = 0x00000000; /* Reserved for future usage */ ptSubmod++; /* Increment submodule */ /* Configure PDEV PN-IO */ ptSubmod->usSlot = 0x0000; /* Slot this submodule belongs to */ ptSubmod->usSubslot = 0x8000; /* Subslot of this submodule */ ptSubmod->ulModuleId = 0x00003093; /* Module ID to which this submodule belongs */ ptSubmod->ulSubmodId = 0x00003093; /* Submodule ID */ ptSubmod->ulProvDataLen = 0x00000000; /* Length of provider data (sent by IO-Device, received by IO-Controller) */ ptSubmod->ulConsDataLen = 0x00000000; /* Length of consumer data (sent by IO-Controller, received by IO-Device) */ ptSubmod->ulDPMOffsetOut = 0x00000000; /* Offset in DPM OutputArea or in Output-image, where provided data of the*/ /* submodule shall be taken from */ ptSubmod->ulDPMOffsetIn = 0x00000000; /* Offset in DPM InputArea or in Input-image, where consumed data for the */ /* submodule shall be copied to */ ptSubmod->usOffsetIOPSProvider = 0x0000; /* Offset where the stack shall take the IOPS provider state for this */ /* submodule relative to beginning of IOPS block in DPM output area from */ ptSubmod->usOffsetIOPSConsumer = 0x0000; /* Offset where the stack shall put the IOPS consumer state of this */ /* submodule relative to beginning of IOPS block in DPM input area to */ ptSubmod->usOffsetIOCSProvider = 0x0000; /* Offset where the stack shall take the IOCS provider state for this */ /* submodule relative to beginning of IOCS block in DPM output area from */ ptSubmod->usOffsetIOCSConsumer = 0x0000; /* Offset where the stack shall put the IOCS consumer state for this */ /* submodule relative to beginning of IOCS block in DPM input area to */ ptSubmod->ulReserved = 0x00000000; /* Reserved for future usage */ ptSubmod++; /* Increment submodule */ /* Configure PDEV Port 1 */ ptSubmod->usSlot = 0x0000; /* Slot this submodule belongs to */ ptSubmod->usSubslot = 0x8001; /* Subslot of this submodule */ ptSubmod->ulModuleId = 0x00003093; /* Module ID to which this submodule belongs */ ptSubmod->ulSubmodId = 0x00003094; /* Submodule ID */ ptSubmod->ulProvDataLen = 0x00000000; /* Length of provider data (sent by IO-Device, received by IO-Controller) */ ptSubmod->ulConsDataLen = 0x00000000; /* Length of consumer data (sent by IO-Controller, received by IO-Device) */ ptSubmod->ulDPMOffsetOut = 0x00000000; /* Offset in DPM OutputArea or in Output-image, where provided data of the*/ /* submodule shall be taken from */ ptSubmod->ulDPMOffsetIn = 0x00000000; /* Offset in DPM InputArea or in Input-image, where consumed data for the */ /* submodule shall be copied to */ ptSubmod->usOffsetIOPSProvider = 0x0000; /* Offset where the stack shall take the IOPS provider state for this */ /* submodule relative to beginning of IOPS block in DPM output area from */ ptSubmod->usOffsetIOPSConsumer = 0x0000; /* Offset where the stack shall put the IOPS consumer state of this */ /* submodule relative to beginning of IOPS block in DPM input area to */ ptSubmod->usOffsetIOCSProvider = 0x0000; /* Offset where the stack shall take the IOCS provider state for this */ /* submodule relative to beginning of IOCS block in DPM output area from */ ptSubmod->usOffsetIOCSConsumer = 0x0000; /* Offset where the stack shall put the IOCS consumer state for this */ /* submodule relative to beginning of IOCS block in DPM input area to */ ptSubmod->ulReserved = 0x00000000; /* Reserved for future usage */ ptSubmod++; /* Increment submodule */ /* Configure PDEV Port 2 */ ptSubmod->usSlot = 0x0000; /* Slot this submodule belongs to */ ptSubmod->usSubslot = 0x8002; /* Subslot of this submodule */ ptSubmod->ulModuleId = 0x00003093; /* Module ID to which this submodule belongs */ ptSubmod->ulSubmodId = 0x00003094; /* Submodule ID */ ptSubmod->ulProvDataLen = 0x00000000; /* Length of provider data (sent by IO-Device, received by IO-Controller) */ ptSubmod->ulConsDataLen = 0x00000000; /* Length of consumer data (sent by IO-Controller, received by IO-Device) */ ptSubmod->ulDPMOffsetOut = 0x00000000; /* Offset in DPM OutputArea or in Output-image, where provided data of the*/ /* submodule shall be taken from */ ptSubmod->ulDPMOffsetIn = 0x00000000; /* Offset in DPM InputArea or in Input-image, where consumed data for the */ /* submodule shall be copied to */ ptSubmod->usOffsetIOPSProvider = 0x0000; /* Offset where the stack shall take the IOPS provider state for this */ /* submodule relative to beginning of IOPS block in DPM output area from */ ptSubmod->usOffsetIOPSConsumer = 0x0000; /* Offset where the stack shall put the IOPS consumer state of this */ /* submodule relative to beginning of IOPS block in DPM input area to */ ptSubmod->usOffsetIOCSProvider = 0x0000; /* Offset where the stack shall take the IOCS provider state for this */ /* submodule relative to beginning of IOCS block in DPM output area from */ ptSubmod->usOffsetIOCSConsumer = 0x0000; /* Offset where the stack shall put the IOCS consumer state for this */ /* submodule relative to beginning of IOCS block in DPM input area to */ ptSubmod->ulReserved = 0x00000000; /* Reserved for future usage */ ptSubmod++; ptApi = ( PNS_IF_API_STRUCT_T * ) ( ptSubmod ); /* Pointer to Module configuration */ ptApi->ulApi = 14848; /* Number of the API profile to be configured */ ptApi->ulNumSubmodItems = 0x02; /* Number of submodule-items this API contains */ ptSubmod = ( PNS_IF_SUBMODULE_STRUCT_T * ) ( ptApi + 1 ); /* Configure PROFIDrive Device(P-device) Slot 1, subslot 1. MAP */ ptSubmod->usSlot = 0x0001; /* Slot this submodule belongs to */ ptSubmod->usSubslot = 0x0001; /* Subslot of this submodule */ /* PNS SET CONFIG Dirk */ ptSubmod->ulModuleId = 0x00004101; /* Module ID to which this submodule belongs */ ptSubmod->ulSubmodId = 0x0000FFFF; /* Submodule ID */ ptSubmod->ulProvDataLen = 0x000000; /* Length of provider data (sent by IO-Device, received by IO-Controller) */ ptSubmod->ulConsDataLen = 0x0000000; /* Length of consumer data (sent by IO-Controller, received by IO-Device) */ ptSubmod->ulDPMOffsetOut = 0x00000000; /* Offset in DPM OutputArea or in Output-image, where provided data of the*/ /* submodule shall be taken from */ ptSubmod->ulDPMOffsetIn = 0x00000000; /* Offset in DPM InputArea or in Input-image, where consumed data for the */ /* submodule shall be copied to */ ptSubmod->usOffsetIOPSProvider = 0x0000; /* Offset where the stack shall take the IOPS provider state for this */ /* submodule relative to beginning of IOPS block in DPM output area from */ ptSubmod->usOffsetIOPSConsumer = 0x0000; /* Offset where the stack shall put the IOPS consumer state of this */ /* submodule relative to beginning of IOPS block in DPM input area to */ ptSubmod->usOffsetIOCSProvider = 0x0000; /* Offset where the stack shall take the IOCS provider state for this */ /* submodule relative to beginning of IOCS block in DPM output area from */ ptSubmod->usOffsetIOCSConsumer = 0x0000; /* Offset where the stack shall put the IOCS consumer state for this */ /* submodule relative to beginning of IOCS block in DPM input area to */ ptSubmod->ulReserved = 0x00000000; /* Reserved for future usage */ ptSubmod++; /* Increment submodule */ /* Configure PROFIDrive Device(P-device) Slot 1, subslot 2. Standard Telegram */ ptSubmod->usSlot = 0x0001; /* Slot this submodule belongs to */ ptSubmod->usSubslot = 0x0002; /* Subslot of this submodule */ /* PNS SET CONFIG Dirk */ ptSubmod->ulModuleId = 0x00004101; /* Module ID to which this submodule belongs */ ptSubmod->ulSubmodId = 0x00000001; /* Submodule ID */ ptSubmod->ulProvDataLen = 4; /* Length of provider data (sent by IO-Device, received by IO-Controller) */ ptSubmod->ulConsDataLen = 4; /* Length of consumer data (sent by IO-Controller, received by IO-Device) */ ptSubmod->ulDPMOffsetOut = 0x00000000; /* Offset in DPM OutputArea or in Output-image, where provided data of the*/ /* submodule shall be taken from */ ptSubmod->ulDPMOffsetIn = 0x00000000; /* Offset in DPM InputArea or in Input-image, where consumed data for the */ /* submodule shall be copied to */ ptSubmod->usOffsetIOPSProvider = 0x0000; /* Offset where the stack shall take the IOPS provider state for this */ /* submodule relative to beginning of IOPS block in DPM output area from */ ptSubmod->usOffsetIOPSConsumer = 0x0000; /* Offset where the stack shall put the IOPS consumer state of this */ /* submodule relative to beginning of IOPS block in DPM input area to */ ptSubmod->usOffsetIOCSProvider = 0x0000; /* Offset where the stack shall take the IOCS provider state for this */ /* submodule relative to beginning of IOCS block in DPM output area from */ ptSubmod->usOffsetIOCSConsumer = 0x0000; /* Offset where the stack shall put the IOCS consumer state for this */ /* submodule relative to beginning of IOCS block in DPM input area to */ ptSubmod->ulReserved = 0x00000000; /* Reserved for future usage */ ptSubmod++; /* Increment submodule */ return ( long ) ptSubmod - ( long ) ptModule; } /* SetModulConfig */
Acyclic Data
Sending acyclic requests from a CIFX RE/PNM V3 master to a slave configured as shown above.
The problem is that the Profinet master is addressing a request for submodule 1, to slot 0, subslot 1, whereas it is configured by the device to be on slot 1, subslot 0, as illustrated above.
Sending PNM_AP_READ_RECORD_SUBM_REQ_T from the PN IO Controller
The Protocol API PROFINET IO Controller V3.3.0 is used to send a Read Submodule Record service to the CIFX RE/PNM V3 master via the CifXTest application.
Profinet IO Controller Read Submodule Record service:
Request:
PNM_AP_READ_RECORD_SUBM_REQ_T structure:
PNM_AP_READ_RECORD_SUBM_REQ_T values:
Header:
Variable | Type | Value |
---|---|---|
ulDest | uint32_t | 0x20 |
ulScr | uint32_t | 0 |
ulDestId | uint32_t | 0 |
ulScrId | uint32_t | 0 |
ulLen | uint32_t | 8 |
ulId | uint32_t | 0 |
ulSta | uint32_t | 0 |
ulCmd | uint32_t | 0x9422 |
ulExt | uint32_t | 0 |
ulRoute | uint32_t | 0 |
Data:
Variable | Type | Value |
---|---|---|
usSubmoduleHandle | uint16_t | 1 |
usIndex | uint16_t | 2 |
ulMaxReadLen | uint16_t | 4 |
Receiving PNS_IF_READ_RECORD_IND to the PN IO Device Host application
Receiving PNM_AP_READ_RECORD_SUBM_CNF_T to the PN IO Controller
PNM_AP_READ_RECORD_SUBM_CNF_T structure
Confirmation values:
Header:
Variable | Type | Value |
---|---|---|
ulDest | uint32_t | 0x20 |
ulScr | uint32_t | 0 |
ulDestId | uint32_t | 0 |
ulScrId | uint32_t | 0 |
ulLen | uint32_t | 16 |
ulId | uint32_t | 0 |
ulSta | uint32_t | 0 |
ulCmd | uint32_t | 0x9422 |
ulExt | uint32_t | 0 |
ulRoute | uint32_t | 0 |
Data:
Variable | Type | Value |
---|---|---|
usSubmoduleHandle | uint16_t | 1 |
usIndex | uint16_t | 2 |
ulMaxReadLen | uint16_t | 4 |
ulPnio | uint32_t | 0 |
usAddVal1 | uint16_t | 0 |
usAddVal2 | uint16_t | 0 |
abRecordData[] | uint8_t[] | B0 80 DE 00 |
Wireshark Trace
extendedExampleNetworkCapture.pcapng
Here's a Wireshark sniff, that shows the Profinet packet: