From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

NI-CAN frame API ncWriteNet with a DataLength greater than 8

Solved!
Go to solution

Hello to all,


I am using NI CAN frame API to write and read data from a CAN device , I have no problems with all frames except a frame than has a length of 10 bytes and the problem is that the DataLength of the ncWriteNet function can't be greater than 8 bytes, I would like to have a solution for this problem to send my data,Any suggestion? for example can I divide the frame to 2 parts and send it in two attempts. I am using pci-can/xs2 series 2 as hardware.


Houssemeddine Snoussi
Certified LabVIEW associate Developer | Certified TestStand Developer



0 Kudos
Message 1 of 10
(2,854 Views)

What kind of product expect a 10 bytes CAN payload? 

 

The CAN standard, that the NI-CAN frame API uses, has a maximum of 8 bytes of payload.

The protocol that your device is using might have a method of transferring  more than 8 bytes of data using 2 or more CAN messages. But you need to look at the protocol for that.

Message 2 of 10
(2,822 Views)

It is an automotive product. one of my CAN frames that I should send to the product  has 10 bytes of payloads.



0 Kudos
Message 3 of 10
(2,816 Views)

The protocole of the product is CAN Low speed bus standard.



0 Kudos
Message 4 of 10
(2,813 Views)

@HoussemeddineSnoussi wrote:

The protocole of the product is CAN Low speed bus standard.


That is not the protocol, that is the CAN hardware/ low level specification. 

So now we know that you are running on a Low Speed CAN bus. 

 

What is the name of the protocol that is uses?  

What is the product?

0 Kudos
Message 5 of 10
(2,809 Views)

The protocole is not mentioned in the specification document. I know only that the product is communication using a low speed CAN interface with a specified baudrate. I am communicating with the product successfully . the only problem is that same frames are greater than 8 bytes that I should send them.
The product is a steering wheel of a car.



0 Kudos
Message 6 of 10
(2,804 Views)
Solution
Accepted by topic author HoussemeddineSnoussi

And the specification document is found were? 

 

So it is not a SAE J1939 or CANopen compliant product? 

0 Kudos
Message 7 of 10
(2,802 Views)
Solution
Accepted by topic author HoussemeddineSnoussi

There are protocols which run on top of CAN to handle messages longer than 8 bytes, for example Keyword Protocol 2000/ISO-14230. This is commonly used in automotive applications, following the Diagnostics over CAN (DoCAN) specification, ISO 15765, in particular section 2 (and can coexist with J1939 traffic on the same CAN bus). Does your device use this protocol?

Message 8 of 10
(2,796 Views)
Solution
Accepted by topic author HoussemeddineSnoussi

As others have said this device does not communicate of the CAN2.0 spec established in the 90s for the Frame API.  That by definition is limited to 8 bytes in payload.  This is covered in my Part 2 CAN Basics blog post, but in various other places like the CAN wiki.  Working around this limitation are things like XCP/CCP or the ISO-15765 protocols which sit on top of the standard CAN frame API for doing other things.  Several of these protocols are described in Part 8 of my blog.  Nothing on XCP or CCP yet from me but NI sells the ECU Measurement and Calibration toolkit which covers this for NI hardware.  NI also has the Automotive Diagnostic Command set for other protocols.  Both toolkits have free trials but if you are unsure of what CAN is in general then I'm guessing you won't have all the information needed to communicate with these protocols yet.  Consult the manufacturer and get more information about what is needed to communicate with the device.

Message 9 of 10
(2,789 Views)

Thank you all for your great response , it's a KWP protocol.



0 Kudos
Message 10 of 10
(2,773 Views)