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)


 Configuration Sequence



Set Configuration Request Description

 Set Config Description

PNS_IF_SET_CONFIGURATION_REQ packet structure:

Configuration Request contents:

VariableTypeValue/Range
ulDestuint32_tHIL_PACKET_DEST_DEFAULT_CHANNEL (0)
ulLenuint32_tsizeof(tConfiguration)
ulCmduint32_t PNS_IF_SET_CONFIGURATION_REQ   (0x00001FE2)
ulExtuint32_t0 - fragmentation not needed
ulTotalConfigPckLenuint32_tsizeof(tConfiguration)
tDeviceParametersPNS_IF_DEVICE_PARAMETER_TtConfiguration.tSetConfigReq.tDeviceParameters (described below)
tModuleConfigPNS_IF_MODULE_CFG_REQUEST_DATA_TtConfiguration.tSetConfigReq.tModuleConfig (described below)
tAPIPNS_IF_API_STRUCT_TtConfiguration.tAPI (described below)
API 0 submodule arrayPNS_IF_SUBMODULE_STRUCT_TtConfiguration.tSubmodules[ulSubmoduleCount]; ulSubmoduleCount = 3 (described below)
tAPI_PDRVPNS_IF_API_STRUCT_TtConfiguration.tAPI_PDRV (described below)
API 14848 submodule arrayPNS_IF_SUBMODULE_STRUCT_TtConfiguration.tSubmodules_PDRV[ulSubmoduleCount_PDRV]; ulSubmoduleCount_PDRV = 2 (described below)

tDeviceParameters structure:


Set Configuration Packet

VariableTypeValue/RangeNotes
ulSystemFlagsuint32_t

PNS_IF_SYSTEM_START_AUTO_START | PNS_IF_SYSTEM_ARDY_WOUT_APPL_REG_ENABLED;


ulWdgTimeruint32_t1000
ulVendorIduint32_t0x011E
ulDeviceIduint32_t0x1003Has to be 0x0130
ulScrIduint32_t0
ulLenuint32_t8
ulIduint32_t0
ulNameOfStationLenuint32_tsizeof("netxV5repns") - 1
abNameOfStation[240]uint8_t[]"netxV5repns"
ulTypeOfStationLenuint32_tsizeof("NETX PROFIDrive AC1") - 1has to be zero according to PNS API manual
abTypeOfStationuint8_t[]"NETX PROFIDrive AC1"has to be zero according to PNS API manual
abDeviceTypeuint8_t[]"NETX PROFIDrive AC1"Has to mach the GSDML
abOrderIduint8_t[]0
ulIpAddruint8_t0
ulNetMaskuint8_t0
ulGatewayuint8_t0
usHwRevisionuint16_t0
usSwRevision1uint16_t5
usSwRevision2uint16_t3
usSwRevision2uint16_t0
bSwRevisionPrefixuint8_t"V"
bReserveduint8_t0
usMaxDiagRecordsuint16_t16
usInstanceIduint16_t1
usReverveduint16_t0


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

 Module Config Description

PNS_IF_MODULE_CFG_REQ_DATA_T has the following structure:

tConfiguration.tModuleConfig values

VariableTypeValue/Range
ulNumApiuint32_t2

PNS_IF_API_STRUCT_T structure:

tConfiguration.tAPI values:

VariableTypeValue/Range
ulApiuint32_t0
ulNumSubmoduleItemsuint32_t4

PNS_IF_SUBMODULE_STRUCT_T has the following structure:



tConfiguration.tSubmodules consists of the following modules:

DAP V3.5

VariableTypeValue/Range
usSlotuint16_t0x0000
usSubslotuint16_t0x0001
ulModuleIduint32_t0x00003093
ulSubmoduleIduint32_t0x00003092
ulProvDataLenuint32_t0
ulConsDataLenuint32_t0
ulDPMOffsetInuint32_t0
ulDPMOffsetOutuint32_t0
usOffsetOPSProvideruint16_t0
usOffsetOPSConsumeruint16_t0
usOffsetOCSProvideruint16_t0
usOffsetOCSConsumeruint16_t0
ulReserveduint32_t0

PDEV PN-IO

VariableTypeValue/Range
usSlotuint16_t0
usSubslotuint16_t0x8000
ulModuleIduint32_t0x00003093
ulSubmoduleIduint32_t0x00003093
ulProvDataLenuint32_t0
ulConsDataLenuint32_t0
ulDPMOffsetInuint32_t0
ulDPMOffsetOutuint32_t0
usOffsetOPSProvideruint16_t0
usOffsetOPSConsumeruint16_t0
usOffsetOCSProvideruint16_t0
usOffsetOCSConsumeruint16_t0
ulReserveduint32_t

0

PDEV Port 1

VariableTypeValue/Range
usSlotuint16_t0
usSubslotuint16_t0x8001
ulModuleIduint32_t0x00003093
ulSubmoduleIduint32_t0x00003094
ulProvDataLenuint32_t0
ulConsDataLenuint32_t0
ulDPMOffsetInuint32_t0
ulDPMOffsetOutuint32_t0
usOffsetOPSProvideruint16_t0
usOffsetOPSConsumeruint16_t0
usOffsetOCSProvideruint16_t0
usOffsetOCSConsumeruint16_t0
ulReserveduint32_t0

PDEV Port 2

VariableTypeValue/Range
usSlotuint16_t0
usSubslotuint16_t0x8002
ulModuleIduint32_t0x00003093
ulSubmoduleIduint32_t0x00003094
ulProvDataLenuint32_t0
ulConsDataLenuint32_t0
ulDPMOffsetInuint32_t0
ulDPMOffsetOutuint32_t0
usOffsetOPSProvideruint16_t0
usOffsetOPSConsumeruint16_t0
usOffsetOCSProvideruint16_t0
usOffsetOCSConsumeruint16_t0
ulReserveduint32_t0

tConfiguration.tAPI_PDRV values:

VariableTypeValue/Range
ulApiuint32_t14848
ulNumSubmoduleItemsuint32_t2

Configuration.tSubmodules consists of the following modules:

PROFIDrive Device(P-device) Slot 1, subslot 1. MAP */

VariableTypeValue/Range
usSlotuint16_t0x0001
usSubslotuint16_t0x0001
ulModuleIduint32_t0x00004101
ulSubmoduleIduint32_t0x0000FFFF
ulProvDataLenuint32_t0
ulConsDataLenuint32_t0
ulDPMOffsetInuint32_t0
ulDPMOffsetOutuint32_t0
usOffsetOPSProvideruint16_t0
usOffsetOPSConsumeruint16_t0
usOffsetOCSProvideruint16_t0
usOffsetOCSConsumeruint16_t0
ulReserveduint32_t0

PROFIDrive Device(P-device) Slot 1, subslot 2. Standard Telegram */

VariableTypeValue/Range
usSlotuint16_t1
usSubslotuint16_t2
ulModuleIduint32_t0x00004101
ulSubmoduleIduint32_t0x00000001
ulProvDataLenuint32_t4
ulConsDataLenuint32_t4
ulDPMOffsetInuint32_t0
ulDPMOffsetOutuint32_t0
usOffsetOPSProvideruint16_t0
usOffsetOPSConsumeruint16_t0
usOffsetOCSProvideruint16_t0
usOffsetOCSConsumeruint16_t0
ulReserveduint32_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:

VariableTypeValue
ulDestuint32_t0x20
ulScruint32_t0
ulDestIduint32_t0
ulScrIduint32_t0
ulLenuint32_t8
ulIduint32_t0
ulStauint32_t0
ulCmduint32_t0x9422
ulExtuint32_t0
ulRouteuint32_t0

Data:

VariableTypeValue
usSubmoduleHandleuint16_t1
usIndexuint16_t2
ulMaxReadLenuint16_t4

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:

VariableTypeValue
ulDestuint32_t0x20
ulScruint32_t0
ulDestIduint32_t0
ulScrIduint32_t0
ulLenuint32_t16
ulIduint32_t0
ulStauint32_t0
ulCmduint32_t0x9422
ulExtuint32_t0
ulRouteuint32_t0

Data:

VariableTypeValue
usSubmoduleHandleuint16_t1
usIndexuint16_t2
ulMaxReadLenuint16_t4
ulPniouint32_t0
usAddVal1uint16_t0
usAddVal2uint16_t0
abRecordData[]uint8_t[]B0 80 DE 00


Wireshark Trace

extendedExampleNetworkCapture.pcapng

Here's a Wireshark sniff, that shows the Profinet packet:

Request:

Response: