Page 1 of 1
RP1210_ReadMessage
Posted: Tue 10. Dec 2019, 19:32
by nathan86
I seem to be having issues with the RP1210_ReadMessage command. Whenever I run it even though I am broadcasting a message every 100ms I seem to not be seeing the messages. SendMessage seems to be working ok but readmessage just returns 0 "No Error" basically every time but no actual data. Does anyone have any ideas of what I might be doing wrong?
Re: RP1210_ReadMessage
Posted: Wed 11. Dec 2019, 09:09
by K.Wagner
Hello,
did you configure the filter? Please note that the reception filter is closed after connecting.
Without calling RP1210_SendCommand with the parameter RP1210_Set_All_Filters_States_To_pass or RP1210_Set_Message_Filtering_For_CAN / RP1210_Set_Message_Filtering_For_J1939 you won't be able to receive any message.
Re: RP1210_ReadMessage
Posted: Wed 11. Dec 2019, 14:36
by nathan86
Yea I did the RP1210_Set_All_Filters_States_to_Pass right after initiating the ClientConnect but still don't appear to be reading any messages back.
Re: RP1210_ReadMessage
Posted: Wed 11. Dec 2019, 15:23
by K.Wagner
Hello,
having a result of 0 when reading means that the reception queue is empty. This can only happens if ...
- no filter is configured,
- no messages are being received by the device in use,
- you have disabled the reception of messages by issuing the parameter RP1210_Set_Message_Receive,
- you are expecting to receive a large J1939 message, but you have no address claimed.
Do you have a counterpart device who is sending messages, or are you using only one device to send and receive for testing purposes? Note that RP1210 needs real communication, this is, unacknowledged messages are not placed in the reception queue.
Also check that your APIs are up to date. You can check the history of changes here:
PCAN-RP1210-A,
PCAN-RP1210-C
Re: RP1210_ReadMessage
Posted: Wed 11. Dec 2019, 21:52
by nathan86
Yea I am testing with both a controller with built in CAN and also have been testing with another peak adapter.
It looks like issuing RP1210_Set_Message_Receive to on solved the issue. I'm not sure why that was off by default though. I would have expected it to be on after turning off the filters but apparently you have to set it to on.
Thanks for your help!
Re: RP1210_ReadMessage
Posted: Thu 12. Dec 2019, 08:45
by K.Wagner
Hello,
you're welcome. Closed.