LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

XNET Flash Programming is slow

Hi,

I have a little problem with flash programming with XNET. Generally the programming works with a NI 9862 and the Automotive Diagnostic Command Set. However, this is pretty slow compared to other tools.

Of course, I checked settings like the baud rate... any ideas?

0 Kudos
Message 1 of 10
(4,249 Views)

Hi,

 

Could you describe bit more in detail what are you trying to achieve? Any piece of code or screenshot would be helpful to see.

 

Thanks!

Best Regards,
TK
Certified LabVIEW Architect (CLA)

0 Kudos
Message 2 of 10
(4,195 Views)

screen.PNG

This is the core part where the flash memory is programmed. The procedure is implemented as described in standard VW80126 - UDS compliant programming of ECUs.

0 Kudos
Message 3 of 10
(4,179 Views)

Hi, 

 

please let me know, what is slow exactly in this case. 

The "flash" global variable is updated slowly, or the whole loop is iterating slowly?

Which tools are you comparing it to?

 

Thanks

 

0 Kudos
Message 4 of 10
(4,161 Views)

Two issues I see.

 

The wait is not needed. The data transfer will time the loop better.

 

The select and associated shift register is just silly.  Replace with i mod(0xFF).  In range and coerce, use remainder.


"Should be" isn't "Is" -Jay
0 Kudos
Message 5 of 10
(4,154 Views)

Thank you for the hints. Programming takes 107s with Labview and 23s with vFlash from Vector. This does not change after the consideration of the hints.

 

I have recorded a CAN trace. There I can see my and the reference tool send and receive the same messages. But the time increases during my loop much more than with the reference tool. Maybe the communication VI (Diagnostic Service.vi -> in the picture marked with "TransferData") is a little bit slow?! Unfortunately I can't look into the password protected VI.

0 Kudos
Message 6 of 10
(4,133 Views)

This likely has to do with your code, but there is the possibility that NI could optimize things.  I've replicated vFlash process using UDS writes and ISO 15765 and I've been able to get a flash operation to take place within a couple seconds of vFlash.  Try removing all unnecessary code to the flashing process.  This means removing progress bar updates, and cancel checking just temporarily.  Also disable debugging, and automatic error handling, and inline VIs that you can.  Now look at the execution time.  You should be on par with what vFlash does.  Now slowly add feature and see what is taking extra time.  I suspect that you'll get better performance if you choose to only do things like check for cancel, and update progress once a second or so.  I'd also suggest using Split 1D array, instead of getting various array subsets each time.  Here is a quick example of something similar, note this isn't a snippet.

 

Untitled.png

 

Note that here each segment is 2048 bytes, and our block sequence counter goes from 1, to FF to 0 just like yours.  I do have a retry, but I think it is legacy and isn't needed.  We keep splitting away 2048 bytes until there isn't any left.  We also check once a second for cancel (queue reference destroyed) and if it isn't then we update the progress once a second.  The bottom tunnel is the total number of bytes to transfer.  There is no need for a wait, and even a wait 0 is not needed.  This is because the delays will be defined by the ISO15765 protocol and the ECU will state how much of a delay between frames is needed.  And bonus no globals and wireless programming.

 

Oh and the password protected VIs aren't interesting.  They just call NI DLLs that do the heavy lifting.  Of course if you want to implement the ISO 15765 protocol on your own in pure G you can use my code from Part 8 of my CAN blog.

 

I've drafted a CAN blog post on ISO 15765 flashing, and XCP/CCP but just haven't had time to finish it,

which would cover some of this.

 

And one more edit, why not.  If you are looking for more support on XNet and CAN you may find that posting on the Automotive subforum will get more attention from those dedicated to the subject.  The general LabVIEW forum gets flooded quite a bit and these dedicated ones might give you more attention.

Message 7 of 10
(4,121 Views)

Thank you Hooovahh for your answer!

I continue this topic in the automotive section. 

0 Kudos
Message 8 of 10
(4,105 Views)

Can you please share this vi?

0 Kudos
Message 9 of 10
(459 Views)

@r94 wrote:

Can you please share this vi?


If you are referring to what I posted, I can't really share it.  What I showed really is just one VI but each ECU may have a different steps in flashing.  I was really just trying to show the core of it, where data transfer is taking place since that is where any small delay can be amplified, since the code will be there the most.  Before this you'll need to set the address, and maybe run erase or CRC checking routines that are specific to the ECU.

0 Kudos
Message 10 of 10
(406 Views)