Automotive and Embedded Networks

cancel
Showing results for 
Search instead for 
Did you mean: 

Negative values in ReadDatabyIdentifier

Hi all! I stumbled across a bit of a weird scenario yesterday and I'm hoping I'm not the only one that's had this problem. I'm using the Diagnostics Communications Custom Device, which is built around the ADCS Toolkit, for those not familiar. I can successfully read any DID I want, but I found that there's at least one DID that uses a -1 as a valid value, and of course the array of U8 produced by the ReadDatabyIdentifier VI can't handle this. If it was an I8 array it could, but that would bork pretty much all the other DID reads.

 

Any ideas on how to handle this?

 

Thanks!

 

Wraith

0 Kudos
Message 1 of 4
(4,221 Views)

Hi Wraith,

 

Have you tried just converting the U8 to an I8 on the output using the To Byte Integer.vi? The function should return the bits that were sent by the ECU, you can interpret them in any way you want.

 

  

A Johnson
Applications Engineer
National Instruments
0 Kudos
Message 2 of 4
(4,195 Views)

Do you mean right at the output of the ReadDatabyIdentifier VI? No, I haven't tried that since the vast majority of the data I'll get back needs to be U8. I was quite surprised to run across this particular signed integer as literally everything else I've been dealing with has been unsigned. Is the ReadDatabyIdentifier VI's output U8 because that's standard for UDS? This is a really odd problem and I think it might just lead to this one particular value getting ignored...

0 Kudos
Message 3 of 4
(4,191 Views)
There isn't really a standard for UDS. Generally, you'll have a diagnostic database (ODX, CDD, etc) that will describe what the format of each parameter is. At the UDS level, it's just a collection of bytes. I haven't used this toolkit, but I'm making an assumption that it will not read a database and do the conversion for you like XNET would do for a DBC (based on 30 seconds of Google-fu). At your application level, you'll have to do the conversion yourself based on each individual DID. There is a VI in the toolkit called Convert to Phys.vi that should help.
0 Kudos
Message 4 of 4
(4,183 Views)