07-16-2015 11:41 AM
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
07-19-2015 12:50 PM
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
07-20-2015 11:10 AM
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.
07-20-2015 12:19 PM
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:
The NI-XNET 14.0 release adds the following features:
07-20-2015 12:55 PM
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.