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

CAN Property Not Set After Attempting to Set the Property Programmatically

Hardware: Industrial Communications>>CAN

Problem:
Why does my CAN property not set when I programmatically set it?

Solution:
Some CAN properties can only be set programmatically before starting execution of a specified task using CAN Start.vi. The reason for this is many properties affect the manner in which communication takes place, which if changed dynamically after starting a task would inevitably ruin the current state of any transmission (an example of such a property is the baud rate).

If you would like to set a CAN property programmatically you should do so before the start operation. For example, if you are using the Channel API you will not want to use CAN Init Start.vi, rather the advanced level VIs CAN Initialize.vi and CAN Start.vi, where you can insert the CAN Set Property.vi between those VIs to set a given property.

See the attachments below for an example of this, where one VI correctly sets a CAN property before starting a task, while the other incorrectly attempts to set the property after starting a task. You can run the VIs to see the affects of this, where the Baud Rate value is first set and then retrieved using CAN Get Property.vi.  On the other hand, when the CAN Set Property.vi is executed after the Start.vi, an error is generated.  See below.




Related Links:
Product Manuals: NI-CAN Hardware and Software Manual and Specifications
KnowledgeBase 3DNBCA4B: Interpreting Values Written to and Returned by the ncWaitForState function or ncWait.vi
KnowledgeBase 3X2IG5C5: Error -1074388969 When Running a CAN Program


Attachments:

WillSetProperty.vi
WillNotSetProperty.vi

 






Report Date: 09/24/2004
Last Updated: 03/30/2009
Document ID: 3DNAUQ4B

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