Automotive and Embedded Networks

cancel
Showing results for 
Search instead for 
Did you mean: 

Usign XNET Databases, how to convert payload to Boolean Indicator for corresponding Fault Detection True/False Value and real numeric or Scaled values

I have a mixed signal database (Vector dbc based) that I have imported into XNET.  I have to decode 44 fault messages in order to deteremine the unit under test (UUT) overall health.  I found an example called "Convert Frames to From Signals" in NI Examples. This VI converts the Hexadecimal payload to decimal equiviant.   How to do I convert a payload using the XNET Database to indicate the Fault Parameter  True/False Status?

I can use the same boolean indication to give discrete input and output status Ground/Open  where Ground =True and Open =False.

 

For Example, Extended Identfier (hex) 0A42882C; Byte 1 Bit 0  Open Circuit Fault Heater 8.  

 

It looks to be that I have to convert the payload from a numeric to boolean myself.

 

 

Byte  0 value =01 then Open Circuit Fault Heater 8 is True.   If value is 00; Open Circuit Fault Heater 8 is False.

 

For Scaled Values, it looks like the same "Convert Frames to From Signals" vi, only converts the Hex payload to decimal equilivant.

Using the same example, for Heater 1 Current is scaled by a fractional values between 0  - 3F(h) Byte 1 Bits 2 - 7 to equal 0 - 64 Amps.

Since this vi does not scale, I have to take the payload associated with that byte; dropped bits 0 & 1 and scale appropriately.

 

Question Does it make sense to do use a database or just read the identifier value and decode the payload to whatever I need - Scaled Value or Boolean Indicator  - Discrete Input /Output Status or Fault Indicator?

 

Thanks,

Greg

Greg
0 Kudos
Message 1 of 2
(6,616 Views)

Hi Greg,

 

Signals (in XNET) are meant to allow the payload into meaningful numeric data - they're not meant to hold a boolean data type. As such, there's not a built in way to convert the payload to boolean data, meaning that you will have to implement the conversion yourself. You could do this without a database/signals by just taking the payload (in LabVIEW, the payload is an array of unsigned byte integers), selecting the integer you want, using the Number to Boolean Array function to convert in integer into an equivalent array of booleans, and then pulling the desired boolean value you want out of the array. You could also do this with a database/signals (if you wanted to) by configuring signals to correspond to the relevant bytes and then converting the numerical output of the XNET Convert function to a boolean manually using some type of logic.

 

To address your question about scaled values, you should be able to configure a signal in your database that corresponds to the correct bits in the payload and then converts those bits in to properly scaled numeric data. You also could do so manually, but it would likely be easiest to use the database.

 

I've also linked some resources below that discuss XNET in more detail, in case you're interested.

 

Getting Started with the NI-XNET API for LabVIEW

 

FIBEX and the NI-XNET Database Editor Overview

 

I hope that information helps. I'm still not sure that I understand the construction of the payload of your frames (what specific data each different byte/bit represents and how that data needs to be converted). If you can clarify that for me, I might be able to give you some more specific advice.

 

Regards,

Ryan K.
Product Manager, ATCA and BEEcube
National Instruments
0 Kudos
Message 2 of 2
(6,590 Views)