can我打开了RTR远程帧,中断接收函数canMessageNotification。
但是实际上我在中断中没有接收到远程帧,是不是另有地方来读取RTR?
我移植了CANopen,发送远程帧,开启RTR后,得到了回应,但是不知道在什么地方接受的远程帧,因为我写的底层can只有一个发送,一个中断。
This thread has been locked.
If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.
can我打开了RTR远程帧,中断接收函数canMessageNotification。
但是实际上我在中断中没有接收到远程帧,是不是另有地方来读取RTR?
我移植了CANopen,发送远程帧,开启RTR后,得到了回应,但是不知道在什么地方接受的远程帧,因为我写的底层can只有一个发送,一个中断。
我的所有接收都是通过can中断来接收的,那么是不是包括远程帧呢?
master发送远程帧的时候,can中断没有响应,所以下面的RTR判断也无法进行。
unsigned char canReceive(Message *m)
{
uint32 msgBoxArbitVal = 0;
uint32 msgCTL = 0;
msgCTL = canGetMCTL(canREG1,canMESSAGE_BOX1);
msgBoxArbitVal = canGetID(canREG1,canMESSAGE_BOX1);
canGetData(canREG1,canMESSAGE_BOX1,m->data);
m->cob_id = (uint16)(msgBoxArbitVal>>18) & 0x7FF;
m->len = (uint8)(msgCTL & 0xFU);
m->rtr = (uint8)((msgCTL>>9)&0x01);
return 1;
}
A message object with Dir = ‘0’ is configured for the reception of data frames, with Dir = ‘1’ AND Umask =
‘1’ AND RmtEn = ‘0’ it is configured for the reception of remote frames.
我按照以上描述进行配置,可以接收远程帧了,但是数据帧就收不到了。
是不是数据帧和远程帧必须要分开使用两个message box呢?
我想既收到数据帧也收到远程帧。
你好 我也正在移植CANOPEN,我想请教下远程帧应该怎么发?
我试了很多方法,手册上说的是把接收对象的TxRqst置高就会引起远程帧的发送。但实际上这么做以后发出的数据还是“数据帧”,而不是远程帧。
Setting TxRqst for
a receive object causes the transmission of a remote frame with the same identifier as the data frame for
which this receive object is configured.
谢谢!