From 04:00 PM CDT – 08:00 PM CDT (09:00 PM UTC – 01:00 AM UTC) Tuesday, April 16, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

Automotive and Embedded Networks

cancel
Showing results for 
Search instead for 
Did you mean: 

XCP Master - Veristand - Read Characteristics Setting

Solved!
Go to solution

I am working on using the XCP master custom device to read channels under the 'Characteristics' section from the ECU. These are scalar constant values from the ECU (mostly boolean). I am having issues reconnecting to the ECU during a ECU power cycle test:

  1. Power on ECU, load sysdef, XCP master connects to ECU
  2. Power off ECU, wait for ECU to completely power down.
  3. Power ECU back on, check if XCP master reconnects to ECU.

I tried two different methods, using the read periodic and read using trigger settings :

  • Using Read Periodic (500ms) : ECU does not reconnect in the end as once the ECU is powered off, the XCP master sends a new 'Connect' command trying to read the characteristic from the ECU. This messes up the XCP client by opening a new client connection. 
  • Using Read Trigger: Mapped the ignition key switch to the read trigger channel. As a result, as long as ECU is powered on, the characteristic is read using the trigger. Once the ECU is powered off, the trigger is set to zero and the XCP master does not try to read it when ECU is powered off. ECU able to reconnect after power cycle.

Two questions:

  1. If the sysdef is executing at 1000 Hz and the Read trigger is set to a constant value of 1 (ECU powered on), then how fast is the char data read from the ECU? For just a few scalars (booleans) being read from the ECU, how does it affect the performance of the PharLap RT system? 
  2. When testing the same using VeriStand 2013 and the corresponding ECUMC version fro NIVS2013, when using the periodic read, the ECU was able to reconnect after a power cycle. Is there a particular reason why the older XCP master custom device worked but not the current one?

 

0 Kudos
Message 1 of 3
(2,611 Views)
Solution
Accepted by topic author iamrishi

I've just tested that this works like expected with the demo ECU. A CONNECT command is always sent after a power off to establish a new connection. This is by purpose and will not confuse the master.

1. The trigger channel is automatically reset to 0 just after the characteristic is read, so setting the trigger one time will read the characteristic one time. The reading is executed in a separate thread, so it will not affect the main VeriStand loop.

2. There were changes since 2013 but the ECU power off behavior should work the same way. Which version are you using now? Maybe you could record an XCP logfile (option in miscellaneous tab) which would give more information?

0 Kudos
Message 2 of 3
(2,589 Views)

Thank you for that explanation. I went back to the VS 2013 and it looks like there was a mistake on my part. The XCP Characteristic Read setting was set to 'Read Once'. As a result of that when I powered off the ECU, I did not see a new CONNECT command sent. When I changed the setting to read periodic, I was able to replicate the same issue on VS 2013.

 

I see that the read char is set up for a polling type of communication with the ECU. I have reconfigured the model to use the 'Read using Trigger' setting to stop sending a CONNECT command when the ECU is powered off.

 

Also, I am using VeriStand 2017 with ECUMC 18.0

0 Kudos
Message 3 of 3
(2,548 Views)