Academic Company Events NI Developer Zone Support Solutions Products & Services Contact NI MyNI
This Document is not yet Rated  Rate this Document

Can I Send Multiple CAN Messages at Different Rates Using the Same CAN Port?

Primary Software: Driver Software>>NI-CAN
Primary Software Version: 1.1
Primary Software Fixed Version: N/A
Secondary Software: LabVIEW Development Systems>>Base Package

Problem:
I am trying to write multiple messages to the CAN bus and I want the messages to be written at different rates.  I am using the NI-CAN Channel API and I only want to use 1 CAN port.  How can I do this?

Solution:
Writing multiple messages at different rates is possible.  To do this follow these steps:
  1. Initialize each message individually using CAN Initialize.vi.  This VI has an input for sample rate, so this is where you can set the desired sample rate for each message. 


  2. Start each task individually using CAN Start.vi.


  3. Use CAN Write.vi to specify the data that will be written to the bus for each message.


  4. When you are done writing to the bus, stop each message individually using CAN Clear.vi.
In order for this to work, you must follow the order in the above steps.  This will not work if one task is already started and you try to initialize and configure the second message.

See the attachment, CAN_Multi-Message_Dif-Rate.vi, for an example on how to do this.

Related Links:

Attachments:
CAN_Multi-Message_Dif-Rate.vi




Report Date: 01/02/2008
Last Updated: 02/19/2008
Document ID: 4H1BTGQN

Your Feedback! poor Poor  |  Excellent excellent   Yes No
 Document Quality? 
 Answered Your Question? 
  1 2 3 4 5
Please Contact NI for all product and support inquiries.submit