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.

Automotive and Embedded Networks

cancel
Showing results for 
Search instead for 
Did you mean: 

Using Frame API for C, Need to change Data size for a TX Object

I need to Transmit different messages to the same ArbitrationID address. The Transmited messages have variable lengths. Can I call ncConfig on an object to change the NC_ATTR_CAN_DATA_LENGTH even after the call to ncOpenObject. Or do I have to Close the object and reopen it after the call to ncConfig?

Thanks!
0 Kudos
Message 1 of 4
(3,521 Views)
Hello Genesis,

your second assumption is right. You do have to close, reconfigure and reopen the object in order to change the data length.
As long as you're using the CAN Object in the 'Transmit Data by Call' mode only, you might want to consider using the Network Interface for transmitting. When you use the Network Interface, you can change the ArbitrationID for each write call.

-B2k
0 Kudos
Message 2 of 4
(3,521 Views)
Is the Network Interface another API. Where is the documentation for this API?
Thanks for you response!
0 Kudos
Message 3 of 4
(3,521 Views)
The 'Network Interface Object' is part of the Frame API. You can think of it as a port-level access whereas the 'CAN Object' one layer down and it only allows to work with a particular ArbitrationID (specified in its configuration).
Take a look at the NI-CAN Hardware and Software Manual. Chapter 9 (Using the Frame API) discusses the use cases of both object types.
0 Kudos
Message 4 of 4
(3,521 Views)