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

How Do I Pause a Synchronized DAQmx - CAN Task?

Hardware: Industrial Communications>>CAN

Problem:
I am trying to synchronize a DAQmx task with an NI CAN task. I also want to be able to pause the task without loosing any data or overflowing buffers. How would I do this?

Solution:
There are multiple shipping examples that show how to synchronize DAQmx tasks with NI CAN tasks. The shipping example used to construct this program is the CAN Frame API Input DAQmx Input.vi. It is in the NI Example Finder » Hardware input and Output » CAN » Frame API » Synchronization » Basic » DAQmx.   

The code must be altered so that the DAQmx task is stopped first with the DAQmx Stop Task VI before the CAN task is stopped. Because the tasks are synchronized with RTSI, the DAQmx Stop Task VI will also stop the CAN task. After both tasks are stopped, a dialog box appears which waits for user input before continuing. After the user determines that they want to resume the task, the synchronized tasks must be started up in the correct order. In order to start the tasks correctly, the CAN Action VI with the start opcode must execute first, followed by the DAQmx Start Task VI. This will make sure that the CAN task is started and is waiting for the DAQmx task to begin.

An example is shown below:



Related Links:

KnowledgeBase 3FSAAUHR: 'CAN Sync Start with NI-DAQmx' VI Does Not Work Properly with a Series 2 PCMCIA-CAN Card.
KnowledgeBase 2NB8GMYY: Is it Possible to Synchronize the CAN Ports on My Two Port CAN Board?



Attachments:

canpause.JPG
NI CAN_DAQmx_RTSI Sync_with Pause.vi






Report Date: 01/29/2009
Last Updated: 01/30/2009
Document ID: 4TSANO0S

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