Digital I/O

cancel
Showing results for 
Search instead for 
Did you mean: 

How to generate a hardware strobe when outputting data with DAQmxWriteDigitalScalarU32

How to generate a hardware strobe when outputting data with DAQmxWriteDigitalScalarU32

 

System: Windows7 64bit, LabWindows/CVI 2010, NI-DAQmx 9.5.1 and NI-6533.

I’m reworking old source code to make the transition from traditional NI-DAQ to NI-DAQmx. I've got an issue with the simpliest of our operations.

 

I want to output one 16-bit word (with function DAQmxWriteDigitalScalarU32) and have a hardware strobe generated on ACK1/PFI6 (data available pulse). I have tried all kind of modes and attributes, but probably not in the right combination (I hope). Data output is working, the strobe is NOT.

Please show me how to setup NI-DAQmx to get the strobe generated.

 

This is one example of code I have tried.

 

TaskHandle ghmxTaskWrCmdPar;

Init()
  DAQmxCreateTask ("", &ghmxTaskWrCmdPar);
  DAQmxCreateDOChan (ghmxTaskWrCmdPar, "Dev2/port0_16", "", DAQmx_Val_ChanForAllLines);
  DAQmxSetTimingAttribute (ghmxTaskWrCmdPar, DAQmx_SampTimingType, ??????);
  DAQmxSetExportedSignalAttribute (ghmxTaskWrCmdPar, ???????, "/Dev2/PFI6");
  DAQmxSetExportedSignalAttribute (ghmxTaskWrCmdPar, DAQmx_Exported_HshkEvent_OutputBehavior, DAQmx_Val_Pulse);

WriteData(uInt32 databyte)
  DAQmxWriteDigitalScalarU32 (ghmxTaskWrCmdPar, 1, 10.0, databyte, 0);

 

This was the old code in NI-DAQ

init()
  // board 2, Port 0-1 output, data 16 bit, hand shake
  DAQChk(DIG_Grp_Config (2, 1, 2, 0, 1));
  DAQChk(DIG_Grp_Mode (2, 1, 1, 0, 0, 0, 0));

Write_Data()
  DIG_Out_Grp (2, 1, data16));  // strobe is generated here

 

 

Help is appreciated,

/Dan

0 Kudos
Message 1 of 1
(4,981 Views)