Hi all,
I am new to PCAN-USB Pro device and PCAN UDS library.
Here, we want to use "one" PCAN channel to interact with several DUTs (our product). We have adjusted all their CAN IDs to avoid ID conflict.
First, I briefly describes some key features of the DUT:
1.a to keep a DUT in active state, we need keep sending a normal CAN message to the DUT in an approximate 200 ms period;
1.b a DUT will keep broadcasting "out" some normal CAN messages;
1.c to get the internal operating status of a DUT periodically, we have to send a UDS request to the DUT via physical address or functional address in a periodic way;
The application has to gather the UDS responses from all the DUTs and displays the statuses of all the DUTs.
For gathering several DUT statuses in active state, I have several questions and lists in the followings:
Q.1 for meeting 1.a and 1.c, the application not only has to send UDS requests but also has to send normal CAN messages. How to send a normal CAN message via PCAN-UDS API ?
Q.2 what is the default size of a receive queue allocated for one PCAN channel initialized by PCAN-UDS API ? Is there a way to adjust it ?
Q.3 what is the default size of a transmit queue allocated for one PCAN channel initialized by PCAN-UDS API ? Is there a way to adjust it ?
Q.4 is there any suggestion for preventing a receive queue from being saturated by the normal CAN messages originated from 1.b ?
Q.5 if sending a UDS request via functional address, what is the function of PCAN-UDS API to be invoked to read the responses from the receive queue ?
Q.6 if sending all UDS requests to all DUTs via physical addresses before reading any response, what is the function of PCAN-UDS API to be invoked to read the responses from the receive queue ?
Q.7 if sending a UDS request to one DUT via physical address, waiting for its response and read it, sending to another DUT, and ..., what is the function of PCAN-UDS API to be invoked to wait for the response and read it from the receive queue ?
Grateful for any help you can provide
Godel Sung
One PCAN channel to interact with several DUTs
-
- Software Development
- Posts: 305
- Joined: Mon 9. Sep 2013, 12:21
Re: One PCAN channel to interact with several DUTs
Hello Godel,
Here are the answers to your questions.
Otherwise there is no particular recommendation: simply create a thread that will call CANTP_Read_2016 as soon as a message is available.
But consider using event instead of periodic polling, it will increase performances.
Here are the answers to your questions.
You need to use PCAN-ISO-TP API functions to communicate on the channel initialized by PCAN-UDS API. You can check the sample "13_server_uds_and_can" included in PCAN-UDS API package.Q.1 for meeting 1.a and 1.c, the application not only has to send UDS requests but also has to send normal CAN messages. How to send a normal CAN message via PCAN-UDS API ?
There is a limit of 32765 messages in the receive queues of the lower layer APIS PCAN-ISO-TP and PCAN-Basic. The value cannot be adjusted.Q.2 what is the default size of a receive queue allocated for one PCAN channel initialized by PCAN-UDS API ? Is there a way to adjust it ?
The transmit queue is limited to the size of a 32-bit integer in PCAN-Basic, it cannot be adjusted. Also on cantp_write calls, PCAN-ISO-TP implements a mechanism that avoids starvation and odd API usage (for instance calling CANTP_Write_2016 in a while(1) loop), a TX_QUEUE error would simply indicate that the application is trying to send more quickly than the API is able to process ISOTP messages.Q.3 what is the default size of a transmit queue allocated for one PCAN channel initialized by PCAN-UDS API ? Is there a way to adjust it ?
To avoid saturation from heavy bus load, an application should filter messages that it wants (see PCAN-ISO-TP white-list filtering mechanism with CANTP_AddFiltering_2016 and parameter PCANTP_PARAMETER_FILTER_CAN_ID).Q.4 is there any suggestion for preventing a receive queue from being saturated by the normal CAN messages originated from 1.b ?
Otherwise there is no particular recommendation: simply create a thread that will call CANTP_Read_2016 as soon as a message is available.
But consider using event instead of periodic polling, it will increase performances.
Check the documentation on function UDS_WaitForServiceFunctional_2013.Q.5 if sending a UDS request via functional address, what is the function of PCAN-UDS API to be invoked to read the responses from the receive queue ?
Check the documentation on function UDS_WaitForService_2013.Q.6 if sending all UDS requests to all DUTs via physical addresses before reading any response, what is the function of PCAN-UDS API to be invoked to read the responses from the receive queue ?
Check the documentation on function UDS_WaitForService_2013.Q.7 if sending a UDS request to one DUT via physical address, waiting for its response and read it, sending to another DUT, and ..., what is the function of PCAN-UDS API to be invoked to wait for the response and read it from the receive queue ?
Best regards,
Fabrice
Fabrice