Automotive and Embedded Networks

cancel
Showing results for 
Search instead for 
Did you mean: 

Reading Signal State value with XNET and .DBC File.

Hello, 

 

I am trying to show a state/string value to a CAN Signal. Where the Signal could be something like 0 = Off, 1 = On, 2 = Running, 3 = Shutdown, etc. 

 

I can read in the CAN Data and the Data output is Double, so it at least gives me the Raw Value from XNet Read (Signal Single-Point) but would like it to see the String value to it as well. 

 

Using Xnet Session, I can see the list of Signals from my DBC file of what's being received, then picked one out and used the Xnet Database Get DBC Attribute.VI. This then gives me all the possible String values for each Raw Value but that seems to just be reading out from the DBC file. 

 

So I am wondering is there a way to change the Data output for Xnet Read to give me the string value instead? Or some other easy way to get the string value? Otherwise I am thinking I will need to make a mess of things by using Scan String from Get DBC attribute then use a Case structure to show the string based on Value. 

0 Kudos
Message 1 of 2
(1,412 Views)

This is one of the several reasons I decided to write my own CAN Frame to Signal conversion library.  It still uses XNet to parse the database, but the signal conversion itself is written in LabVIEW for doing the scaling to engineering units.  The Frame to Signals can be returns as Doubles, Strings, XY values, or Waveform Signals.  When Using the String reading mode it will use the Get DBC Attribute first, getting the look up from the numeric value to the enum value.  Then when it does a frame to signals conversion it will use that for the string value.  You can attempt to use my library, or just use this information to make your own conversion from double to string.

 

I mention this library along with some others in my CAN Blog Part 5.

0 Kudos
Message 2 of 2
(1,405 Views)