Discussion:
How do I send different messages with different timings?
(too old to reply)
Chris_R.
2007-08-27 19:40:15 UTC
Permalink
Hi Prajeesh,
 
The best way to change the sample rate while running your program is to close out the session and reopen it at the new rate.  The driver will not allow you to change properties or reinitialize the port without stopping the communication resource first.  You can start with examples in LabVIEW by going to Help>>Find Examples and then browse to the Hardware Input and Output>>CAN>>Basic folder for some examples which set the sample rate at the front of the CAN VI sequence.  The sample rate input is in Samples per Second.  You can also check out the NI-CAN Hardware and Software Manual which is installed with the NI-CAN drivers.  You can find this from the start menu in Windows by browsing to All Programs>>National Instruments>>NI-CAN.
 
Here are some additional documents that may help:
 
<a href="http://digital.ni.com/public.nsf/allkb/32815319A4FE711986256E92003FD4F4?OpenDocument" target="_blank">How Do I Programmatically Change My Baud Rate in Channel API?</a>
&nbsp;
<a href="http://zone.ni.com/devzone/cda/tut/p/id/4294" target="_blank">The NI-CAN Channel API</a>
&nbsp;
<a href="http://zone.ni.com/devzone/cda/epd/p/id/782" target="_blank">CAN Periodic Transmission in LabVIEW Example Program</a>
&nbsp;
Let me know if you have any questions!&nbsp; Best of luck with your program!
DirkW
2007-08-28 13:40:10 UTC
Permalink
yes, the best way to go is as Paul described, using multiple tasks with different sample rates (Channel api). Thats the same as using the frame api and different objects with different periods. See the attached example.
DirkW


CAN_Multi-Chans_Diff-Period.vi:
http://forums.ni.com/attachments/ni/30/2811/1/CAN_Multi-Chans_Diff-Period.vi
Loading...