How to enable Modular Device Object for Profinet

I would like to use the ABCC Profinet module with the Modular Device Object approach.
So I implemented this Object and I also enabled it in the abcc_obj_cfg.h at host application side.
But the Module does not ask for it. In case of Profibus the module was asking for all attributes of the Modular Device Object.

Must the modular device object be switched on ?

Hello,

The 40 series PROFINET module should send requests to the Modular Device object. However, I don’t believe there is a way to enable this in the default abcc_object_cfg.h.
If you set MOD_OBJ_ENABLE to TRUE in abcc_obj_cfg.h, you have enabled the Modbus object.

All requests to host side objects are handled by ABCC_CbfReceiveMsg where there is a switch on destination object. However, there isn’t a case for ECh, which should be defined in abp.h as ABP_OBJ_NUM_MDD.

The first request to the Modular Device object comes after requests to the PROFINET IO host side object (and other objects). Perhaps one of your responses caused the CompactCom to skip the modular device object.

Dear Ian,

for sure I added the missing code parts at all mentioned places otherwise I couldn’t be able to use it with Profibus.

That is what I assume as well. Do you have any Idea ? I couldn’t find something in the Software design guide or Networkguide.

I checked the guides and the flowcharts listed in the appendix specific to PROFINET and didn’t see anything. In my testing to confirm that the Modular Device object was indeed queried, I disabled both the PROFINET IO object and the Assembly Mapping object. Could you please try this? It should be easy to do by setting the enable macros to false.
The very fist query is for the Modular device object’s revision number. All other queries are based on this response.
Also, could you please check your firmware version? Modular device object support was added in firmware version 1.27.

Thanks a lot for your investigation. I checked the firmware and it is version 1.08. As first step I will update the firmware…

With the latest firmware the device is asking for the attributes of the modular device object. Unfortunately my sample application still not work like expected there is now a configuration error accordingly to the red LED which flashes 3 times. I will open a new thread for that.

As already mentioned in the thread https://forum.hms-networks.com/t/how-to-enable-modular-device-object-for-profinet/7906, I would like to use the ABCC Profinet module with the Modular Device Object approach.
I created a GSDML based on the example GSDML-V2.34-HMS-CompactCom-40-PIR-MD-20180417.xml which described modules for the SPEED and REFSPEED ADIs. See below the according snipped:

			<ModuleList>
			<ModuleItem ID="ID_MODULE_2" ModuleIdentNumber="0x00000002">
				<ModuleInfo CategoryRef="CAT_REF_IN_MODULES">
					<Name TextId="T_ID_MODULE_NAME_2"/>
					<InfoText TextId="T_ID_INFO_TEXT_MODULE_2"/>
				</ModuleInfo>
				<VirtualSubmoduleList>
					<VirtualSubmoduleItem ID="ID_SUBMOD_IN_GROUP" SubmoduleIdentNumber="0x00000100" FixedInSubslots="1" MayIssueProcessAlarm="false">
						<IOData>
							<Input Consistency="All items consistency">
								<DataItem DataType="Unsigned16" TextId="T_ID_DATAITEM_IN_ELEMENT1"/>
							</Input>
						</IOData>
						<ModuleInfo>
							<Name TextId="T_ID_SUBMOD_NAME_IN"/>
							<InfoText TextId="T_ID_SUBMOD_INFO_ELEMENT_GROUP"/>
						</ModuleInfo>
					</VirtualSubmoduleItem>
				</VirtualSubmoduleList>
			</ModuleItem>
			<ModuleItem ID="ID_MODULE_3" ModuleIdentNumber="0x00000003">
				<ModuleInfo CategoryRef="CAT_REF_OUT_MODULES">
					<Name TextId="T_ID_MODULE_NAME_3"/>
					<InfoText TextId="T_ID_INFO_TEXT_MODULE_3"/>
				</ModuleInfo>
				<VirtualSubmoduleList>
					<VirtualSubmoduleItem ID="ID_SUBMOD_OUT_GROUP" SubmoduleIdentNumber="0x10012000" FixedInSubslots="1" MayIssueProcessAlarm="false">
						<IOData>
							<Output Consistency="All items consistency">
								<DataItem DataType="Unsigned16" TextId="T_ID_DATAITEM_OUT_ELEMENT1"/>
							</Output>
						</IOData>
						<ModuleInfo>
							<Name TextId="T_ID_SUBMOD_NAME_OUT"/>
							<InfoText TextId="T_ID_SUBMOD_INFO_ELEMENT_GROUP"/>
						</ModuleInfo>
					</VirtualSubmoduleItem>
				</VirtualSubmoduleList>
			</ModuleItem>
		</ModuleList>

If the module ask for the list of module IDs, I send back
0x00000002, 0x00000003, 0x00000002
which means there are plugged in 3 modules ( 2x SPEED, 1x REF SPEED).

I also modified the appl_admap_speed_example.c :

/*-------------------------------------------------------------------------------------------------------------
** 1. iInstance | 2. pabName | 3. bDataType | 4. bNumOfElements | 5. bDesc | 6. pxValuePtr | 7. pxValuePropPtr
**--------------------------------------------------------------------------------------------------------------
*/
const AD_AdiEntryType APPL_asAdiEntryList[] =
{
   {  4,  "SPEED",     ABP_UINT16,   1, APPL_WRITE_MAP_READ_ACCESS_DESC, { { &appl_iSpeed,    &appl_sUint16Prop } } },
   {  7,  "REF_SPEED", ABP_UINT16,   1, APPL_READ_MAP_WRITE_ACCESS_DESC, { { &appl_iRefSpeed, &appl_sUint16Prop } } },
   {  5,  "SPEED",     ABP_UINT16,   1, APPL_WRITE_MAP_READ_ACCESS_DESC, { { &appl_iSpeed,    &appl_sUint16Prop } } },
};

/*------------------------------------------------------------------------------
** Map all adi:s in both directions
**------------------------------------------------------------------------------
** 1. AD instance | 2. Direction | 3. Num elements | 4. Start index |
**------------------------------------------------------------------------------
*/
const AD_DefaultMapType APPL_asAdObjDefaultMap[] =
{
   { 4, PD_WRITE, AD_DEFAULT_MAP_ALL_ELEM, 0 },
   { 5, PD_WRITE, AD_DEFAULT_MAP_ALL_ELEM, 0 },
   { 7, PD_READ,  AD_DEFAULT_MAP_ALL_ELEM, 0 },
   { AD_DEFAULT_MAP_END_ENTRY }
};

and in the TIA-Portal the device is accordingly configured as well.
Everything seems to be correct until I connect the OPC-Scout and the PROFINET master is sending the configuration. The red led starts flashing 3 times which means according to the Networkguide PROFINET: " Red, 3 flashes | Configuration error | Expected Identification differs from Real Identification "

unfortunately also the log do not provide further hints what is going wrong, please see below:

Mem: Buffer allocated: 0x1fff0428
ANB_STATUS: ABP_ANB_STATE_WAIT_PROCESS 

Msg received:
[ MsgBuf:0x1fff0428 Size:0x0002 SrcId  :0x00 DestObj:PROFINET IO 
  Inst  :0x0000  E:0 C:1  Cmd :0x19   CmdExt0:0x01 CmdExt1:0x00 ]
[ 0x0f 0x00 ]


Msg sent:
[ MsgBuf:0x1fff0428 Size:0x0001 SrcId  :0x00 DestObj:PROFINET IO 
  Inst  :0x0000  E:1 C:0  Cmd :0x19   CmdExt0:0x01 CmdExt1:0x00 ]
[ 0x05 ]

Mem: Buffer returned:  0x1fff0428
Mem: Buffer allocated: 0x1fff0428

Msg received:
[ MsgBuf:0x1fff0428 Size:0x002f SrcId  :0x00 DestObj:PROFINET IO 
  Inst  :0x0000  E:0 C:1  Cmd :0x14   CmdExt0:0x01 CmdExt1:0x00 ]
[ 0x0c 0x05 0x10 0xac 0x01 0x00 0x11 0x00 0x00 0x00 0x24 0x70 0x63 0x2d 0x30 
  0x32 0x33 0x2d 0x76 0x6d 0x2d 0x77 0x69 0x6e 0x31 0x30 0x2e 0x69 0x65 0x78 0x61 
  0x61 0x6c 0x6c 0x67 0x65 0x6d 0x65 0x69 0x6e 0x78 0x62 0x31 0x65 0x39 0x34 0x62 ]

Mem: Buffer allocated: 0x1fff0538

Msg sent:
[ MsgBuf:0x1fff0428 Size:0x0001 SrcId  :0x00 DestObj:PROFINET IO 
  Inst  :0x0000  E:1 C:0  Cmd :0x14   CmdExt0:0x01 CmdExt1:0x00 ]
[ 0x05 ]

Mem: Buffer returned:  0x1fff0428

Msg received:
[ MsgBuf:0x1fff0538 Size:0x0070 SrcId  :0x01 DestObj:PROFINET IO 
  Inst  :0x0000  E:0 C:1  Cmd :0x1b   CmdExt0:0x00 CmdExt1:0x03 ]
[ 0x01 0x00 0x01 0x00 0x00 0x00 0x00 0x00 0x04 0x00 0x00 0x00 0x04 0x00 0x00 
  0x00 0x01 0x80 0x01 0x00 0x01 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x80 0x02 
  0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x01 0x80 0x03 0x00 0x00 0x00 0x00 0x00 0x00 
  0x00 0x02 0x80 0x03 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x01 0x00 0x01 0x00 0x02 
  0x00 0x00 0x00 0x01 0x00 0x00 0x01 0x00 0x00 0x02 0x00 0x00 0x00 0x02 0x00 0x01 
  0x00 0x03 0x00 0x00 0x00 0x01 0x00 0x00 0x20 0x01 0x10 0x00 0x00 0x02 0x00 0x03 
  0x00 0x01 0x00 0x02 0x00 0x00 0x00 0x01 0x00 0x00 0x01 0x00 0x00 0x02 0x00 0x00 
  0x00 ]


Msg sent:
[ MsgBuf:0x1fff0538 Size:0x0001 SrcId  :0x01 DestObj:PROFINET IO 
  Inst  :0x0000  E:1 C:0  Cmd :0x1b   CmdExt0:0x00 CmdExt1:0x03 ]
[ 0x05 ]

Mem: Buffer returned:  0x1fff0538
Mem: Buffer allocated: 0x1fff0538

Msg received:
[ MsgBuf:0x1fff0538 Size:0x0002 SrcId  :0x00 DestObj:Sync 
  Inst  :0x0001  E:0 C:1  Cmd :0x02   CmdExt0:0x07 CmdExt1:0x00 ]
[ 0x00 0x00 ]


Msg sent:
[ MsgBuf:0x1fff0538 Size:0x0001 SrcId  :0x00 DestObj:Sync 
  Inst  :0x0001  E:1 C:0  Cmd :0x02   CmdExt0:0x07 CmdExt1:0x00 ]
[ 0x03 ]

Mem: Buffer returned:  0x1fff0538
Mem: Buffer allocated: 0x1fff0538

Msg received:
[ MsgBuf:0x1fff0538 Size:0x0004 SrcId  :0x00 DestObj:Sync 
  Inst  :0x0001  E:0 C:1  Cmd :0x02   CmdExt0:0x01 CmdExt1:0x00 ]
[ 0x00 0x80 0x84 0x1e ]


Msg sent:
[ MsgBuf:0x1fff0538 Size:0x0001 SrcId  :0x00 DestObj:Sync 
  Inst  :0x0001  E:1 C:0  Cmd :0x02   CmdExt0:0x01 CmdExt1:0x00 ]
[ 0x03 ]

Mem: Buffer returned:  0x1fff0538
Mem: Buffer allocated: 0x1fff0538

Msg received:
[ MsgBuf:0x1fff0538 Size:0x0008 SrcId  :0x00 DestObj:PROFINET IO 
  Inst  :0x0000  E:0 C:1  Cmd :0x17   CmdExt0:0x01 CmdExt1:0x00 ]
[ 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 ]


Msg sent:
[ MsgBuf:0x1fff0538 Size:0x0001 SrcId  :0x00 DestObj:PROFINET IO 
  Inst  :0x0000  E:1 C:0  Cmd :0x17   CmdExt0:0x01 CmdExt1:0x00 ]
[ 0x05 ]

Mem: Buffer returned:  0x1fff0538
ANB_STATUS: ABP_ANB_STATE_ERROR

Do you have any Idea what could be going wrong ?

Please let me know, If it would help when I provide the GSDML or other files…

Thanks !

Topic closed due to inactivity.