Problem adapting code to use the Anybus File System Interface Object via SPI Host Communication


#1

Hello there,

I have a problem with adapting my code to the Anybus File System Interface Object with the command sequencer via SPI Host Communication.
The first command is creating an instance of the object, and the response is never called. It looks almost like the sequence is never handled.

Same code is running without problems with an anybus brick on Parallel Host Communication .
The message exchange is handled normally, the start up works correct. A SPS has been connected to the Brick, and i can interchange process data.

Is there something special to consider in use with the file system object via SPI Host Communication which is not mentioned in the Software Design Guide?

Thank you very much.

Bafoit


#2

Can you tell me which device you’re using? Is this a Compact COM M40? Also what networks are we communicating with? Can you send me the code you’re working with and I’ll try and take a look at it?


#4

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.


#5

The device I am using is a Custom Sized Compact Com M40, and an Ti F2837x single core as an host processor.

extern const ABCC_CmdSeqType DirectoryRead[];

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 an extraction of the code I’ve written. It works fine with the same code on a standard Compact Com M40 with Profinet and Parallel Host Communication.

When the code is triggered, the BKS_Create_Instance method is called. But never gets to the BKS_Create_Instance_Response.


#6

Thought maybe I should add, the call which should keep the driver coder running I need.

ABCC_AddCmdSeq(DirectoryRead, NULL);
//Trigger communication between HMS Brick and C2000 till the rest of the sequence is processed
do
{
ABCC_TriggerTransmitMessage();
ABCC_TriggerReceiveMessage();
}
while(Return_Status_of_Filesystem() != DELETE_INSTANCE_RESPONSE);


#7

Hi @bafoit00

Sorry for the delay. Just to make sure, you’re saying that all of this code works fine on a standard CompactCom M40 but it is just having issues with this custom sized one?


#8

It works fine, on a Standard Compact Com M40 Brick with a Parallel Host Communication.

Its not working on the Custom Sized One with SPI Host Communication. But only my code referring the Anybus File System Interface Object.
SPI Frame is correct (checked with an oscilloscope).
Start up procedure works fine on the Custom Brick. Communication between a Siemens SPS and Brick via Profinet works like it should.


#9
  • Can you check which ABCC firmware you have on each of these devices. Also the version info specified in the ABCC_version.h

  • Can you check if the FTP feature is enabled. You may need to check this in the ABCC_Obj_cfg.h

/*
*** Attribute 6: Enable FTP server (BOOL - TRUE/FALSE)*
*/
#ifndefETN_IA_ENABLE_FTP_ENABLE
#defineETN_IA_ENABLE_FTP_ENABLEFALSE
#defineETN_IA_ENABLE_FTP_VALUETRUE
#endif

  • Can you access the FTP from your PC if this is enabled with both SPI and Parallel?

  • Also what company was this custom M40 made for?


#10
  • Firmware Version on the custom brick is v.1.42. Build 02.

  • Whats specified in ABCC_version.h:

/*------------------------------------------------------------------------------
** Version information for the starter kit.
**------------------------------------------------------------------------------
*/
#define ABCC_STARTER_KIT_VER_STRING “ABCC Starter Kit version 3.05.02 (2018-08-30)”
#define ABCC_STARTER_KIT_VER_MAJOR 3
#define ABCC_STARTER_KIT_VER_MINOR 5
#define ABCC_STARTER_KIT_VER_BUILD 2

/*------------------------------------------------------------------------------
** Version information of ABCC Drive included in this starter kit release.
**------------------------------------------------------------------------------
*/
#define ABCC_DRIVER_VER_STRING “ABCC Driver 5.05.02 (2018-08-30)”
#define ABCC_DRIVER_VER_MAJOR 5
#define ABCC_DRIVER_VER_MINOR 5
#define ABCC_DRIVER_VER_BUILD 2

/*------------------------------------------------------------------------------
** Version information of ABP files in this starter kit release.
**------------------------------------------------------------------------------
*/
#define ABP_VER_STRING “ABP 7.59.01 (2018-05-17)”
#define ABP_VER_MAJOR 7
#define ABP_VER_MINOR 59
#define ABP_VER_BUILD 1

  • FTP Enable in ABCC_Obj_cfg.h:

/*
** Attribute 6: Enable FTP server (BOOL - TRUE/FALSE)
*/
#ifndef ETN_IA_ENABLE_FTP_ENABLE
#define ETN_IA_ENABLE_FTP_ENABLE TRUE //FALSE
#define ETN_IA_ENABLE_FTP_VALUE TRUE
#endif

  • Yes I can access FTP via PC with both.

  • I write it to you in a private message. :wink:


#11

Ok thanks and just to clarify, is the other M40 that you were testing with also on FW 1.42?