The Host is a TI F2837 single core 16-bit microcontroller, and the device is a custom sized Compact Com Brick for Profinet.
The identification pins are set via hardware.
const ABCC_CmdSeqType DirectoryRead[] =
{
ABCC_CMD_SEQ( BKS_Create_Instance, BKS_Create_Instance_Response ),
ABCC_CMD_SEQ( BKS_Open_Directory, BKS_Open_Directory_Response),
ABCC_CMD_SEQ( BKS_Read_Directory, BKS_Read_Directory_Response),
ABCC_CMD_SEQ( BKS_Close_Directory, BKS_Close_Directory_Response),
ABCC_CMD_SEQ( BKS_Delete_Instance, BKS_Delete_Instance_Response),
ABCC_CMD_SEQ_END()
};
void HMSInstanceCreate(ABP_MsgType* pMsgBufferFile)
{
ABCC_SetLowAddrOct( pMsgBufferFile->sHeader.iSourceIdDestObj, ABCC_GetNewSourceId() ); //SourceID
ABCC_SetHighAddrOct( pMsgBufferFile->sHeader.iSourceIdDestObj, ABP_OBJ_NUM_FSI ); //Object
pMsgBufferFile->sHeader.iInstance = iTOiLe( 0 ); //Object Instance
ABCC_SetLowAddrOct( pMsgBufferFile->sHeader.iCmdReserved, //Cmd
ABP_MSG_HEADER_C_BIT | ABP_CMD_CREATE );
pMsgBufferFile->sHeader.iDataSize = 0; //DataSize
ABCC_SetLowAddrOct( pMsgBufferFile->sHeader.iCmdExt0CmdExt1, 0 ); //CmdExt[0]
ABCC_SetHighAddrOct( pMsgBufferFile->sHeader.iCmdExt0CmdExt1, 0 ); //CmdExt[1]
}
static ABCC_CmdSeqCmdStatusType BKS_Create_Instance(ABP_MsgType* pMsgReciveBuffer)
{
status = CREATE_INSTANCE; //Set the status to the condition.
HMSInstanceCreate(pMsgReciveBuffer); //Fill the header with the correct data to create an instance of a “Anybus File System Interface Object”
return( ABCC_SEND_COMMAND );
}
static ABCC_CmdSeqRespStatusType BKS_Create_Instance_Response(ABP_MsgType* pMsgReciveBuffer)
{
status = CREATE_INSTANCE_RESPONSE; //Set the status to the condition.
if (ABCC_VerifyMessage( pMsgReciveBuffer ) != ABCC_EC_RESP_MSG_E_BIT_SET ) //Check if brick has set the error bit and something gone wrong.
{
object_instance = pMsgReciveBuffer->aiData[0]; //Get the Instance Number of the Message as a reference for further communication
return (ABCC_EXEC_NEXT_COMMAND);
}
else
{
hms_command_sequence_error_code = eERROR_BIT;
return (ABCC_EXEC_CURR_COMMAND);
}
}
This is a extraction of the code which i wrote for the exchange with the filesystem.
However the Sequencer never gets to the Create Instance Response.
As to point of debugging, when ABCC_DrvSpiIsReadyForWriteMessage() is called directly afterwards by ABCC_LinkWriteMessage() never returns true.
I just wonder because the code works for a “normal” Compact Brick M40 via Parallel Host Communication. And the start up init sequence works normally too.