CanOpen

Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
User7878
Level 1
Level 1
Hi,
To implement the CANOPEN I need reconfigure the identifier in the transmission messages.
I try to change the "CAN001_MessageHandle0_2.Identifier=0x180" but it do not work. The message goes with the base ID for that LMO
How can i do it?

I want to use only 1 LMO to receive all messages and 1 LMO to transmit, but i need to change the messages identifier.

I tried this

i configured the LMO_1 to receive and for transmit LMO_2.



TempMsgHandle.Identifier = 0x180
TempMsgHandle.DataLength = 4;
TempMsgHandle.data[0] = (uint8_t) adc_Res.Result;
TempMsgHandle.data[1] = (uint8_t) (adc_Res.Result >> 8);
TempMsgHandle.data[2] = (uint8_t) (adc_Res.Result >> 16);
TempMsgHandle.data[3] = (uint8_t) (adc_Res.Result >> 24);

CAN001_MessageHandle0_2.Identifier=0x180;

status = CAN001_ConfigMsgObj(&CAN001_Handle0, &TempMsgHandle, 2);
status=CAN001_UpdateMODataRegisters(&CAN001_Handle0, 2, TempMsgHandle.DataLength, TempMsgHandle.data);
status = CAN001_SendDataFrame(&CAN001_Handle0, 2);

It doesn´t work 😞

Can anyone help me with this?

Luis Silva
0 Likes
5 Replies
Not applicable
Hi Luis Silva,

Why don't you try to change the CAN identifier via register MOARn.ID[28:0]?

BR,
Zain
0 Likes
Not applicable
Hi Luis Silva,

In the CAN001_ConfigMsgObj() function, the following parameters will be checked:
1) TempMsgHandle.IDExten =1; // 0 or 1
2) TempMsgHandle.MsgObjEN = CAN001_ENABLE; // must be enabled
3) TempMsgHandle.MsgObjType = (CAN_MsgType)1; // Tx=1 or Rx=0
If one of the above parameters is incorrect, you will get "CAN001_INVALID_INPUT" status return value.

The local parameter TempMsgHandle is undefined after reset. Hence, you need add the above init. parameters before calling CAN001_ConfigMsgObj() function.

Best regards,
Sophia
0 Likes
Not applicable
Good afternoon,

this is an interesting thread.

I am similarly wanting to be able to use a single message object for Tx and a single message object for Rx.

I have achieved this for the Tx by using the method outlined above, but how is it possible to have all CAN message IDs go to a single Rx message object? I cannot see a way of doing this, since within DAVE one has to specify a different message object for each CAN message ID one is expecting.

How can this configuration from the DAVE IDE be overwritten (as was done for Tx) so as all CAN message IDs go to a single Rx message object?

Has anyone any advice on how to achieve this?

Thanks,

Steve
0 Likes
Not applicable
Hi Steve,

Perhaps you can try to change the "Standard Acceptance Mask" to 0x000?

BR,
Zain
0 Likes
Not applicable
THANKS, worked well for me 🙂

sophia wrote:
Hi Luis Silva,

In the CAN001_ConfigMsgObj() function, the following parameters will be checked:
1) TempMsgHandle.IDExten =1; // 0 or 1
2) TempMsgHandle.MsgObjEN = CAN001_ENABLE; // must be enabled
3) TempMsgHandle.MsgObjType = (CAN_MsgType)1; // Tx=1 or Rx=0
If one of the above parameters is incorrect, you will get "CAN001_INVALID_INPUT" status return value.

The local parameter TempMsgHandle is undefined after reset. Hence, you need add the above init. parameters before calling CAN001_ConfigMsgObj() function.

Best regards,
Sophia
0 Likes