LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

Reapeating the same task without clearing...

I have 2 PCI-6534 cards conntected.  I an attempt to minimize inherent delays between switching from reading to writing, one is dedicated to reading one is dedicated to writing.  I want to create a task for reading and use it over and over.  Ex) I will write 0x00, write 0x55, then read, then write 0x00, 0xAA, then read...(the pattern continues indefinitly).  The problem I am having is that the program makes me stop the task, clear the task, then set it up all over again. (this process takes too long.)  Does any one have an example of how to do this?
 
Here are a couple lines from the code I am curently using and having problems with:
  
DAQmxErrChk (DAQmxCreateTask("",&gTaskHandle));
  DAQmxErrChk (DAQmxCreateDIChan (gTaskHandle, "Dev2/port0_16", "", DAQmx_Val_ChanForAllLines));
  DAQmxErrChk (DAQmxCfgChangeDetectionTiming (gTaskHandle, "Dev2/port0_16", "Dev2/port0_16", DAQmx_Val_ContSamps,2));
  DAQmxErrChk (DAQmxRegisterSignalEvent(gTaskHandle,DAQmx_Val_ChangeDetectionEvent,0,ChangeDetectionCallback,NULL));
  
Write_WFM32 ("AB_Module_ID.hws",8, 9);
Write_WFM32 ("A_Address_00.hws",8, 9);
  
  while (x<99999)
  {x++;
  Write_WFM32 ("AB_Write_05.hws",12, 13);
  Write_WFM32 ("A_Address_00.hws",8, 9);
  DAQmxErrChk (DAQmxStartTask(gTaskHandle));
  Readback_Waveform_AB ("AB_Read.hws",32);
  }
0 Kudos
Message 1 of 2
(2,829 Views)

Chris,

Have you tried doing a continuous generation.  It looks like this is what you should be doing.  There are some exampled in ...Program Files\National Instruments\NI-DAQ\Examples\DAQmx ANSI C\Digital.  There you will find both generation and acquisition examples.  And since you are using a different board for each, you should be able to merge these together fairly easily.  I hope this is helpful. 

Regards,

Lon

0 Kudos
Message 2 of 2
(2,786 Views)