Introduction
While most CAN devices work with the standard baud rates that NI-CAN supports, sometimes you need a custom baud rate or sometimes you need to modify some other timing settings such as the sync jump width (SJW), the time before sampling (TSEG) or Sample Point. Using the ncSetAttr.vi function, you can programmatically set the Bit Timing Register Values.
Read these KnowledgeBase articles for more details:
Additional Notes
It's important to note that if you are trying to set a standard baud rate, you can set the baud rate as a decimal value, and can pass that value directly. However, to set any value other than the standard values requires that you follow the steps found in the KnowledgeBase given above.
Also, note that you can use the port Settings in MAX to view and modify these Bit Timing Registers. This interface provides a little more insight into what the bits represent.
Thanks!
Example code from the Example Code Exchange in the NI Community is licensed with the MIT license.