VeriStand

cancel
Showing results for 
Search instead for 
Did you mean: 

Access to RAW frames on CAN port?

Hello,

 

Does anyone know if there is a way, maybe through the VS API, to access the RAW frame data received on a CAN port?  I know you can log this data but I need to be able to access it from a custom device while deployed.

 

Thanks,

Will



I saw my father do some work on a car once as a kid and I asked him "How did you know how to do that?" He responded "I didn't, I had to figure it out."
0 Kudos
Message 1 of 5
(5,273 Views)

That's a good question. My first thought is to map the XNET channels you need to a channel or waveform created by your custom device. However, this assumes you are using NI-XNET compatible hardware.

 

What hardware are you using for CAN communication and are you using an XNET DB in your VeriStand System Definition? 

 

Andy

 

 

0 Kudos
Message 2 of 5
(5,200 Views)

The problem with mapping the channels is that:

 

a) I would only be able to map channels that I explicitly have added to the system definition and

b) The channels I mapped will reflect the values determined by the scaling, etc of the XNET DB

 

I need to be able to read any RAW data at a port, regardless of the XNET DB and system definition, without knowing ahead of time what data might arrive.  Right now I can do that using a simple custom device but it requires a dedicated second CAN port and a Y splitter.  One port simply allows access to all RAW data coming in and the other port has an actual DB applied and is communicating with my DUT.  I would like to use a single port to do both.

 

Since VeriStand allows you to simultaneously log the RAW data from a port, while also applying a DB to that port, this should in theory be possible the only difference being that instead of directly logging the RAW frame data, I just want to be able to access it from a custom device while deployed.  Now whether or not VeriStand has an API to make that raw data available outside of the built in RAW data logging, is a different story.



I saw my father do some work on a car once as a kid and I asked him "How did you know how to do that?" He responded "I didn't, I had to figure it out."
0 Kudos
Message 3 of 5
(5,171 Views)

This is good feedback. I believe as of NI-XNET 14.0 that you are able to open multiple stream sessions on the same port. What version of VeriStand and NI-XNET are you using? Have you tried setting your custom device to use the same port as VeriStand?

 

VeriStand does allow you to import frames as Raw Data frames, in which case you can read the raw data from the frame without the scaling and other information. However, as you mentioned you would still have to import select frames into your system definition to be able to read them.

 

From the NI-XNET 14.5 Readme

 

New NI-XNET 14.0 Features and Changes as Compared to NI-XNET 1.8

The NI-XNET 14.0 release adds the following features:

  • Added support for LabVIEW 2014.
  • Added support for 64-bit LabVIEW.
  • Added support for the NI cDAQ-9134 cDAQ Controller (Windows).
  • Added support for the CAN FD protocol.
  • Added support for multiple input and output streams on the same port.
  • Added support for merging database.
  • Added support for LIN output stream immediate and replay modes.
  • Added support for LIN checksum corruption.
  • Added support for LDF export.
  • Added support for Bus Monitor on Real-Time targets.
Jarrod S.
National Instruments
0 Kudos
Message 4 of 5
(5,164 Views)

I have VS 2014 and XNET 14.5 but I did update XNET at one point and while I did initially try to use the same port, I ran into issues with multiple sessions, I don't recall if that was pre or post update so I'll try that again to verify.

 

As far as adding RAW frames goes, I have a routine in place to switch out DBC files, re add signals, map models, etc so it would be pretty straightforward to add frames dynamically, my only concern with that, is the XNET frame limit.  The number of incoming frames from the dbc I would need to add to ensure I had access to all necessary data, fairly significantly exceeds the limit.



I saw my father do some work on a car once as a kid and I asked him "How did you know how to do that?" He responded "I didn't, I had to figure it out."
0 Kudos
Message 5 of 5
(5,161 Views)