Counter/Timer

cancel
Showing results for 
Search instead for 
Did you mean: 

route signal from pxi 6602 to RTSI

Hi,
 
I have a problem to export pulse from pxi 6602 to RTSI0. The code is simple as follows:
 
...
DAQmxCreateTask("",&taskHandle);
  DAQmxCreateAOVoltageChan(taskHandle,"AO/ao0","",-10.0,10.0,DAQmx_Val_Volts,NULL);
  DAQmxCreateAOVoltageChan(taskHandle,"AO/ao1","",-10.0,10.0,DAQmx_Val_Volts,NULL);
  DAQmxCfgSampClkTiming(taskHandle,NULL,1000.0,DAQmx_Val_Rising,DAQmx_Val_ContSamps,2);
 
  DAQmxCfgDigEdgeStartTrig (taskHandle, "RTSI0", DAQmx_Val_Rising );
  DAQmxWriteAnalogF64(taskHandle,2,0,10.0,DAQmx_Val_GroupByChannel,out,NULL,NULL);
  
  DAQmxCreateTask ("", &countHandle0);
  DAQmxCreateCOPulseChanTime(countHandle0,"TimingIO/ctr0","",
   DAQmx_Val_Seconds,DAQmx_Val_Low,1,0.5,1);
  err = DAQmxExportSignal (countHandle0, DAQmx_Val_StartTrigger, "RTSI0");
//  err = DAQmxConnectTerms ("TimingIO/Ctr0Gate", "RTSI0",DAQmx_Val_DoNotInvertPolarity );
  DAQmxStartTask(taskHandle);
  DAQmxStartTask (countHandle0);
 
the lines at DAQmxExportSignal(..) and DAQmxConnectTerms(..) both generate big negative number, I spent hours and no answer. In fact I have to use the counter to trigger other boards in my project, I plan to use the route signals a lot.
 
Sincerely,
Taishan
0 Kudos
Message 1 of 2
(3,339 Views)

Hello Taishan,

Thanks for contacting National Instruments. 

When you are using DAQmx with a PXI system, much of the signal routing can be handled implicitly by the driver.  From your code, it appears that you want to use a counter output to start an analog output task.  Please let me know if this assumption is incorrect. 

When used while configuring your analog output task, the following function will cause the internal output of Counter0 to be routed automatically over the PXI backplane to the analog output device.  I have assumed that your PXI-6602 is in slot 2 of the PXI chassis. 

DAQmxCfgDigEdgeStartTrig (AnalogOutputTaskHandle, "/PXI1Slot2/Ctr0InternalOutput", DAQmx_Val_Rising);  

The tutorials Getting Started with NI-DAQmx and Learn 10 Functions in NI-DAQmx and Handle 80 Percent of Your Data Acquisition Applications are great starting points for programming with the DAQmx API.  Since you are using C, Using NI-DAQmx in Text Based Programming Environments, is a great starting point for comparing the LabVIEW API to the C API for DAQmx. 

Please post back if you have any questions. 

Regards,
Browning G
FlexRIO R&D
0 Kudos
Message 2 of 2
(3,325 Views)