CompactCom m40 Network Config Obj Factory Default

I’ve been attempting to Factory Default the Network Configuration object in my Profibus 40 with no success. Here is the code I’ve got:

void ABCC_NodeAddressReset( void )
{
ABCC_AddCmdSeq( NodeAddressFactoryResetCmdSeq, NULL );
}

static const ABCC_CmdSeqType NodeAddressFactoryResetCmdSeq[] =
{
ABCC_CMD_SEQ( NodeAddressFactoryDefaultResetCmd, NULL ),
ABCC_CMD_SEQ_END()
};

static ABCC_CmdSeqCmdStatusType NodeAddressFactoryDefaultResetCmd( ABP_MsgType* psMsg )
{
ABCC_SetObjReset( psMsg, ABP_OBJ_NUM_NC, ABP_NC_INST_NUM_SW1,
ABP_RESET_POWER_ON_FACTORY_DEFAULT,
ABCC_GetNewSourceId() );

return( ABCC_SEND_COMMAND );
}

void ABCC_SetObjReset(ABP_MsgType* psMsg,
UINT8 bObject,
UINT16 iInstance,
UINT8 bResetType,
UINT8 bSourceId )
{
ABCC_MsgType sMsg;
sMsg.psMsg = psMsg;

ABCC_SetLowAddrOct( sMsg.psMsg16->sHeader.iSourceIdDestObj, bSourceId ); /* SourceId /
ABCC_SetHighAddrOct( sMsg.psMsg16->sHeader.iSourceIdDestObj, bObject ); /
bObject /
psMsg->sHeader.iInstance = iTOiLe( iInstance ); /
Instance /
ABCC_SetLowAddrOct( sMsg.psMsg16->sHeader.iCmdReserved,
ABP_CMD_RESET ); /
Command */

sMsg.psMsg16->sHeader.iDataSize = iTOiLe( 0 ); /* Data size /
ABCC_SetLowAddrOct( sMsg.psMsg16->sHeader.iCmdExt0CmdExt1, 0 ); /
CmdExt1 (reserved) /
ABCC_SetHighAddrOct( sMsg.psMsg16->sHeader.iCmdExt0CmdExt1, bResetType ); /
CmdExt0 (ResetType) */
}

Here’s a log of the debug output:

Mem: Buffer allocated: 0x80037634
CmdSeq(9d03e27c)->NodeAddressFactoryDefaultResetCmd()

Msg sent:
[ MsgBuf:0x80037634 Size:0x0000 SrcId :0x1a DestObj:0x04
Inst :0x0001 Cmd :0x05 CmdExt0:0x00 CmdExt1:0x02 ]
[ ]

Mem: Buffer returned: 0x80037634

There is no response from the module (I’m assuming this is correct on a reset, as I don’t see one, and there is no error returned)

The reset command definition from the manual:

image

I’ve tried these things:

  • performing a APPL_RestartAbcc after the default, with different wait periods after the default
  • not doing a APPL_RestartAbcc after the default
  • the ABP_RESET_FACTORY_DEFAULT option
  • resetting instance 0 and 1 of the Network Config object (04)
  • setting the ABP_MSG_HEADER_C_BIT in the command, which causes an exception error response
  • power cycling after the default
  • used an external tool (Siemens PDM) to read the Node Address (it doesn’t change)

I have SSA enabled, this is why I would need to default the object, to allow the user to have the option to set the address again if required.

When I read back the node address after the reset I always receive the address that was set previously (in this case, 6):

Msg sent:
[ MsgBuf:0x800372b4 Size:0x0000 SrcId :0x34 DestObj:0x04
Inst :0x0001 Cmd :0x41 CmdExt0:0x05 CmdExt1:0x00 ]
[ ]

Mem: Buffer returned: 0x800372b4
Mem: Buffer allocated: 0x800372b4
Outstanding commands: 254

Msg received:
[ MsgBuf:0x800372b4 Size:0x0001 SrcId :0x34 DestObj:0x04
Inst :0x0001 Cmd :0x01 CmdExt0:0x05 CmdExt1:0x00 ]
[ 0x06 ]

What am i missing here?

-ed

Hi Ed,

When you tried clearing the Network configuration object were you only clearing the object, instace 0?

image

Can you enable the abcc debugging and provide a log for us to look at?

Also, What firmware are you using on your module?

Deryck

Hi Deryck!

I’ve attached two logs – resetting instance 0 and instance 1 of the Network Config object (4) (I tried both)

After I do the default, I wait two seconds then do a reset of the module, hence all the messages after the factory default.

In all those messages you’ll see the ‘getnodeaddress’ returns a ‘116’ – the address previously set. I would expect the module to return 126 (the default).

The firmware version is 1.7.3

I’ve also tried NOT doing a reset after the default and reading the address externally, power cycling, a few things and the default doesn’t look to be happening.

-ed

m40Reset Inst0.txt (23.4 KB)

m40Reset Inst1.txt (23.4 KB)

Can you try using the “ABP_RESET_FACTORY_DEFAULT” vs the “ABP_RESET_POWER_ON_FACTORY_DEFAULT”.

Deryck

The pic on the cover of the kit is the b40 module itself

Here’s what I have. And a b40 in my hardware.

NOTICE: The information in this electronic transmission (including any attachments) may contain confidential or legally privileged information and is intended solely for the individual(s) or entity(ies) named above. If you are not an intended recipient or an authorized agent, you are hereby notified that reading, distributing, or otherwise disseminating or copying, or taking any action based on the contents of this transmission is strictly prohibited. Any unauthorized interception of this transmission is illegal under the law. If you have received this transmission in error, please immediately notify the return sender by email or telephone at the number indicated above and then destroy all copies of the transmission.

From what I saw in the docs it indicates that there is a non-vol flag that gets set for Profibus when the address gets changed from the network once – and unless the Network Object is reset you can’t change it again.

I’ve assumed that this is why I can’t change the address using a Profibus tool (I’m trying to get SSA to work now). I’ve seen it work, but only once.

SSA should already be configured in the application. What do you have the attribute set to for the Profibus object FDh?

Another possible workaround might be to set the node id to 126 to re-enable SSA. I believe this should give you the same result as a reset and allow you to set another address.

Deryck

Hi Deryck,

Sorry – just back from lunch now…

Didn’t realize but the image on the cover of the demo suitcase was just the B40 module itself. (der)

Is there a way to put the B40 module into the demo board?

I need to write the code in our firmware still to do the upgrade.

-ed

Hi Ed,

I know the B40 starter kit comes with an option board for the bricks but I’m not sure if it can be purchased alone. I have asked the our sales team if they have any details.

Regarding setting the address to 126 it looks like you actually need to perform the reset.

Did you have any better luck using “ABP_RESET_FACTORY_DEFAULT” ?

Sales has also confirmed that you can order a 023080-B for just the B40 extension board.
Our inside sales team can assist you with ordering one along with provide pricing and availability. You can email them at us-sales@hms.se or call 312-829-0601

Deryck

Hi,

If there’s a different kit for the B40 vs the M40 that might explain why I don’t have an adapter. I must have the M40 kit.

I tried the ABP_RESET_FACTORY_DEFAULT previously and that also did not do a default.

But – setting the address to 126 appears to let the Profibus tool set the address… and it lets me set it more than once.

(things seem a little flaky – I really wish to update the firmware now)

So perhaps I need to implement the file system to do the firmware update.

(I must ask if there’s any code for this out there? Not just the header file?)

-ed

Hi Deryck,

Just to confirm, once I have the extension board I can do the upgrade by using the HMS Firmware Manager over Ethernet?

-ed

The extension board allows you to connect to the module thought he starter kit like you can with a M40. Using the transport provider and Firmware manager you can update the firmare.

Deryck

Thanks for your help today.

Hopefully this will work!

-ed

Im not aware of anything that we have available that isnt in the host application. It may be worth requesting the latest version here: Get started with your Anybus CompactCom In-design

Deryck

I took a look at these logs with another colleague.

He pointed out that your are sending a response back and not a command

SONAR: Profibus DP: Resetting Profibus Address…
Mem: Buffer allocated: 0x8003789c
CmdSeq(9d03e7ec)->NodeAddressFactoryDefaultResetCmd()

Msg sent:
[ MsgBuf:0x8003789c Size:0x0000 SrcId :0x1a DestObj:0x04
Inst :0x0000 Cmd :0x05 CmdExt0:0x00 CmdExt1:0x02 ]
[ ]

You should be using command 0x45 not 0x05 which would be a response.

Hi Deryck,

When I set that command bit ABP_MSG_HEADER_C_BIT I saw a fatal error returned. So I thought that was incorrect. But this makes sense if I was sending a response!

Right now I’m in the process of merging the latest example code and the errata so I’ll see what happens after that.

-ed

Hi Deryck,

Ha!

It turned out to be the combination of Instance 0, the command bit and the ABP_RESET_FACTORY_DEFAULT command in ext1

Phew.

It’ll be (apparently) 20 days or so until I get the extension board for the B40, so I’ll look at using the file objects to do a firmware update, but for now this appears to be working!

Thanks again,

Ed

Here’s the log:

SONAR: Profibus DP: Resetting Profibus Address…

Mem: Buffer allocated: 0x8003789c

CmdSeq(9d050bf8)->NodeAddressFactoryDefaultResetCmd()

Msg sent:

[ MsgBuf:0x8003789c Size:0x0000 SrcId :0x37 DestObj:0x04

Inst :0x0000 Cmd :0x45 CmdExt0:0x00 CmdExt1:0x01 ]

[ ]

Mem: Buffer returned: 0x8003789c

Mem: Buffer allocated: 0x8003789c

Outstanding commands: 254

Msg received:

[ MsgBuf:0x8003789c Size:0x0000 SrcId :0x37 DestObj:0x04

Inst :0x0000 Cmd :0x05 CmdExt0:0x00 CmdExt1:0x01 ]

[ ]

Routing response to registered response handler: MsgBuf:0x8003789c SrcId:0x37

CmdSeq(9d050bf8)->Response received

Mem: Buffer returned: 0x8003789c

CmdSeq(9d050bf8)->Done

SONAR: Profibus DP Node Address Reset Complete

Great! that looks a lot better!

I see the updated example code implements the file object. I’m sure I’ll get that going with no questions whatsoever….

(I should wait till I get the expansion board so if I brick my brick I’m not stuck)

Thanks again,

Ed