Automotive and Embedded Networks

cancel
Showing results for 
Search instead for 
Did you mean: 

How to implement custom CAN protocol with XNET for VeriStand

Hi All

I'd like to implement a custom CAN protocol to interface to a model using Veristand, XNET, and a PXIe XNET card.  What are my options?  I see that VeriStand offers XNET Databases along with Single-Point, Event Triggered, Cyclic Event, Cyclic session modes.  This will cover some of the requirement, but not all.  For example, there is a multi-frame transport protocol.  Is it possible to extend the existing session modes to also add something like a transport protocol?  Is it possible to create a custom device to accomplish this?  If so, can the XNET Databases be incorporated and do the existing session modes need to re-implemented?  Thank you!

0 Kudos
Message 1 of 4
(3,657 Views)

Hey andy_3141593, 

 

What kind of protocol are you trying to implement? If it's some close-to-standard (like J1939), there may be some example code for a custom device available. A good rule of thumb is that if it's possible to do through LabVIEW, you can most likely do it through VeriStand as well. I'd suggest you look into doing this communication through LabVIEW, which could then be built into a custom device to use with VeriStand. 

 

-aprillest 

0 Kudos
Message 2 of 4
(3,629 Views)

For a multi-frame message,

you will need to follow UDS spec (hopefully your device does) by sending/receiving flow control

by sending point-to-point or queued frame sessions.

What I mean is:

write the first frame using XNET Write ($10 $0A-$0D $xx $xx etc)

listen for response flow control frame ($30 $xx $xx $AA $AA $AA $AA $AA)

send your second frame and beyond ($21 $xx etc)

 

you will have to code all this - there isnt a way XNET handles this UDS spec in the background.

Dan Haugen
Certified LabVIEW Developer
CLD Instructor
0 Kudos
Message 3 of 4
(3,606 Views)

If it's UDS you're looking to do check out my Part 8 of my CAN Blog which goes over ISO15765 and some of the protocols that sit on top of that.  The source is available and written in pure G and shows how to do the communication with three different 3rd party drivers with a raw frame API.  These Read/Write frame functions can be replaced with the Read/Write frame functions of any hardware (including XNet).  If your protocol isn't 15765 you can just use that code as an example of a way to write your own protocol.

0 Kudos
Message 4 of 4
(3,603 Views)