Automotive and Embedded Networks

cancel
Showing results for 
Search instead for 
Did you mean: 

How to send Can Frames with different lenght over can

Hello,
I have to write an Application which is able to send and receive Data asynchronous in C. The Examples from the NICan Driver 1.6 work fine, but i have the Porblem that i have to send Data with different lenght. From 1 to 8 Bytes, and I don't know how to program this. An other user asked nearly the same question, because he want to send data with one or 2 byte lenght. The answer was he has to reset the can object(card) each time, but this would be an large overhead. Does this work?
I want to program an thread that receive data all the time, and use an other function which send data with special lenght code and idetifier. The receive works like in the Analyze.c example. so i need only a liitle bit code which
is able to send different data with different lenght in the Analyze.c example.

Many thanks for your help

Robert Hecker
0 Kudos
Message 1 of 2
(3,969 Views)
Hello-

With CAN Objects, it is necessary to stop the object to change the size of the bytes. This can be done using the NC_ATTR_CAN_DATA_LENGTH attribute. However, Network Interface Objects have the ability to transmit at any length. It might be possible to use this method instead.

Randy Solomonson
Application Engineer
National Instruments
Message 2 of 2
(3,969 Views)