RP1210_ReadMessage

RP1210 Development Package and RP1210 Connectivity to PEAK CAN Interfaces
Locked
nathan86
Posts: 4
Joined: Tue 10. Dec 2019, 19:30

RP1210_ReadMessage

Post by nathan86 » Tue 10. Dec 2019, 19:32

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?

K.Wagner
Software Development
Software Development
Posts: 767
Joined: Wed 22. Sep 2010, 13:36

Re: RP1210_ReadMessage

Post by K.Wagner » Wed 11. Dec 2019, 09:09

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.
Best regards,
Keneth

nathan86
Posts: 4
Joined: Tue 10. Dec 2019, 19:30

Re: RP1210_ReadMessage

Post by nathan86 » Wed 11. Dec 2019, 14:36

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.

K.Wagner
Software Development
Software Development
Posts: 767
Joined: Wed 22. Sep 2010, 13:36

Re: RP1210_ReadMessage

Post by K.Wagner » Wed 11. Dec 2019, 15:23

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
Best regards,
Keneth

nathan86
Posts: 4
Joined: Tue 10. Dec 2019, 19:30

Re: RP1210_ReadMessage

Post by nathan86 » Wed 11. Dec 2019, 21:52

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!

K.Wagner
Software Development
Software Development
Posts: 767
Joined: Wed 22. Sep 2010, 13:36

Re: RP1210_ReadMessage

Post by K.Wagner » Thu 12. Dec 2019, 08:45

Hello,

you're welcome. Closed.
Best regards,
Keneth

Locked