Hello, I am trying to send a command to the Anybus CompactComm module to set all fields back to the factory default. I am having issues where the slave address of the device can only be set once by a configuration tool.
I found this in the documentaion :
“This service features a flag which specifies whether or not it is allowed to change the device address fromthe network again at a later stage. If the service is accepted, the module saves the value of this flag innon-volatile memory; the only way to restore it again is by performing a Factory Default-reset on theNetwork Configuration Object (consult the general AnybusCompactCom Software Design Guide for
more information).”
In code I tried this:
static ABCC_CmdSeqCMDStatusType FactoryDefaultReset( ABP_MsgType * psMsg){
ABCC_MsgType sMsg;
ABCC_SetLowAddrOct( sMsg.psMsg16->sHeader.iSourceIdDestObj, ABCC_GetNewSourceId() ); /* SourceId */
ABCC_SetHighAddrOct( sMsg.psMsg16->sHeader.iSourceIdDestObj, ABP_OBJ_NUM_NC ); /* bObject */
psMsg->sHeader.iInstance = iTOiLe( 0 ); /* Instance */
ABCC_SetLowAddrOct( sMsg.psMsg16->sHeader.iCmdReserved,
ABP_MSG_HEADER_C_BIT | ABP_CMD_RESET ); /* Command */
sMsg.psMsg16->sHeader.iDataSize = iTOiLe( 1 ); /* Data size */
ABCC_SetLowAddrOct( sMsg.psMsg16->sHeader.iCmdExt0CmdExt1, ABP_RESET_POWER_ON_FACTORY_DEFAULT ); /* CmdExt0 (Attribute) */
ABCC_SetHighAddrOct( sMsg.psMsg16->sHeader.iCmdExt0CmdExt1, ABP_RESET_POWER_ON_FACTORY_DEFAULT); /* CmdExt1 (reserved) */
//ABCC_SetLowAddrOct( sMsg.psMsg16->aiData[ 0 ], 0x01 ); /* Data */
return( ABCC_SEND_COMMAND );
}
I am using the UART to communicate with the Anybus module and this is the hex output transmitted to the module:
A0 0C 04 00 00 45 01 02 02 06 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 BF 80 00 00 47 F4
I get a response and then my application just freezes…
Any suggestions?