Anybus File System Interface Object (0Ah)

Hallo to all, this is my first post.
I have a project with Anybus Compact Com C40 and DSPIC33 (host microcontroller).
With that object I would like read a file present in free memory space of Anybus (this file is before writed with FTP client) by DSPIC33.

I tought to use a sequence command below:
;---------------------------------------------------------------------------------------------------------------
static const ABCC_CmdSeqType FileHEXRead[] =
{
ABCC_CMD_SEQ( HEX_Create_Instance, HEX_Create_Instance_Response ),
ABCC_CMD_SEQ( HEX_Open_File, HEX_Open_File_Response),
ABCC_CMD_SEQ( HEX_Read_File, HEX_Read_File_Response),
ABCC_CMD_SEQ( HEX_Close_File, HEX_Close_File_Response),
ABCC_CMD_SEQ( HEX_Delete_Instance, HEX_Delete_Instance_Response),
ABCC_CMD_SEQ_END()
};
;---------------------------------------------------------------------------------------------------------------
The proble is that I do not have example how to write the single function:
HEX_Open_File, HEX_Open_File_Response, HEX_Read_File, HEX_Read_File_Response, etc…
Can you help me?

Hello,

Typically for the Anybus CompactCom questions we ask that users submit their questions to mysupport.hms.se.

It also looks like you seem to be in the EU so we could help you on this but there will be some delays due to the time difference since this is a U.S. forum.

Can you tell us what type of compactcom you’re using and what you want to do with this file?

Why I cannot see my previous post?
Thank’s

Hi @paolo,

I moved your new post to the old one. the ticket number is 55827

Compact Com C40 Ethernet/IP and Profinet

I would like read a file (“dspic.hex”) present in free memory space of Anybus (this file is before writed with FTP cliente in a new folder named “update”) by DSPIC33.
I have tried to write a function for “Open File” but it does not work because in the response the errror bit is set (ABCC_EC_RESP_MSG_E_BIT_SET ).

void HMSFileOpen(ABP_MsgType* pMsgBufferFile)
{
//ABCC_SetByteAttribute( pMsgBufferFile, ABP_OBJ_NUM_FSI, 0x10, 0, “/update/dspic.hex”, object_instance );
ABCC_SetMsgHeader( pMsgBufferFile,ABP_OBJ_NUM_FSI,0x10,0x00,ABP_MSG_HEADER_C_BIT |ABP_CMD_SET_ATTR,0x10,object_instance );
ABCC_SetMsgString( pMsgBufferFile, “update/dspic.hex”, 0x10, 0x00);
}

ABCC_CmdSeqRespStatusType HEX_Open_File_Response( ABP_MsgType* psMsg )
{
if (ABCC_VerifyMessage( psMsg ) != ABCC_EC_RESP_MSG_E_BIT_SET ) //Check if Compact Com has set the error bit and something gone wrong.
{
return (ABCC_EXEC_NEXT_COMMAND);
}
else
{
return (ABCC_EXEC_CURR_COMMAND);
}

Hi @paolo,

Is this what you’re trying to do by reading this file?

  • Via FTP, send a host firmware file to the ABCC integrated filesystem
  • Via his host application somehow detect (poll) that a firmware is present (likely he would read this at startup of the device
  • Validate the file
  • Erase/reprogram host firmware

It looks like you are using an unsupported Instance and you need to make sure to create the instance before you attempt to open a file.

It also looks like you’re attempting to address attribute 0 and that doesn’t exist on the Anybus object model. Usually SourceId should be given the result from ABCC_GetNewSourceId(). What you are getting may not necessarily be wrong but you may want to be careful with this.

You are right. This is what I would like to do.
You mean that I must create a function like this ?:

void HMSInstanceCreate(ABP_MsgType* pMsgBufferFile)
{
ABCC_SetLowAddrOct( pMsgBufferFile->sHeader.bSourceId, ABCC_GetNewSourceId() ); //SourceID
ABCC_SetHighAddrOct( pMsgBufferFile->sHeader.bDestObj, ABP_OBJ_NUM_FSI ); //Object
pMsgBufferFile->sHeader.iInstance = iTOiLe( 0 ); //Object Instance
ABCC_SetLowAddrOct( pMsgBufferFile->sHeader.bCmd,ABP_MSG_HEADER_C_BIT | ABP_CMD_CREATE ); //Cmd
pMsgBufferFile->sHeader.iDataSize = 0; //DataSize
ABCC_SetLowAddrOct( pMsgBufferFile->sHeader.bCmdExt0, 0 ); //CmdExt[0]
ABCC_SetHighAddrOct( pMsgBufferFile->sHeader.bCmdExt1, 0 ); //CmdExt[1]
}

If you have the most recent version of the SDK then you can probably base most of the framework off of anb_fsi_obj.c.

You just need to handle when and where to make the calls and perform the firmware update process

But where can I download the last SDK version?

You should be able to get the code by going through the download and register button at the bottom of this link:

https://www.anybus.com/products/embedded-index/anybus-compactcom-starterkit

Many many thank’s.
I don’t have till download this file and it seems there is what I’m looking for. I inform you in any case.

Ok thanks, let me know what you find out

Hallo to all!
Now my project is working very well: I’m able to write data to a file and read data from a file using Object 0Ah.
If someone need help I can share my work.
Thank you very much!

Hi @paolo,

Thanks for the update, glad to hear you got the project working!