nick_musson
2007-01-05 18:10:12 UTC
i am using DAQmx from VB6 (CAPI)
i wish to use a digital output to be either tristate or low (using M or E series)
pseudo code to go tristate (which works fine)
DAQmxErrChk DAQmxCreateTask("", m_taskHandle) DAQmxErrChk DAQmxCreateDOChan(m_taskHandle, m_DO_ports_in_spec(DO_index), "", DAQmx_Val_ChanForAllLines) DAQmxErrChk DAQmxSetDOTristate(m_taskHandle, m_DO_ports_in_spec(DO_index), True) DAQmxErrChk DAQmxStartTask(m_taskHandle) DAQmxErrChk DAQmxWriteDigitalLines(m_taskHandle,1,True,10#, DAQmx_Val_GroupByChannel, 0,sampsPerChanWritten,ByVal 0&) StopTask
pseudo code to go tristate (which works fine but gives a 100usec 5V pulse before going low)
DAQmxErrChk DAQmxCreateTask("", m_taskHandle) DAQmxErrChk DAQmxCreateDOChan(m_taskHandle, m_DO_ports_in_spec(DO_index), "", DAQmx_Val_ChanForAllLines) DAQmxErrChk DAQmxSetDOTristate(m_taskHandle, m_DO_ports_in_spec(DO_index), False) DAQmxErrChk DAQmxStartTask(m_taskHandle) DAQmxErrChk DAQmxWriteDigitalLines(m_taskHandle,1,True,10#, DAQmx_Val_GroupByChannel, 0,sampsPerChanWritten,ByVal 0&) StopTask
note it is to be the DAQmxStartTask that takes the output high but if i remove the call it goes high when DAQmxWriteDigitalLines is called
i wish to use a digital output to be either tristate or low (using M or E series)
pseudo code to go tristate (which works fine)
DAQmxErrChk DAQmxCreateTask("", m_taskHandle) DAQmxErrChk DAQmxCreateDOChan(m_taskHandle, m_DO_ports_in_spec(DO_index), "", DAQmx_Val_ChanForAllLines) DAQmxErrChk DAQmxSetDOTristate(m_taskHandle, m_DO_ports_in_spec(DO_index), True) DAQmxErrChk DAQmxStartTask(m_taskHandle) DAQmxErrChk DAQmxWriteDigitalLines(m_taskHandle,1,True,10#, DAQmx_Val_GroupByChannel, 0,sampsPerChanWritten,ByVal 0&) StopTask
pseudo code to go tristate (which works fine but gives a 100usec 5V pulse before going low)
DAQmxErrChk DAQmxCreateTask("", m_taskHandle) DAQmxErrChk DAQmxCreateDOChan(m_taskHandle, m_DO_ports_in_spec(DO_index), "", DAQmx_Val_ChanForAllLines) DAQmxErrChk DAQmxSetDOTristate(m_taskHandle, m_DO_ports_in_spec(DO_index), False) DAQmxErrChk DAQmxStartTask(m_taskHandle) DAQmxErrChk DAQmxWriteDigitalLines(m_taskHandle,1,True,10#, DAQmx_Val_GroupByChannel, 0,sampsPerChanWritten,ByVal 0&) StopTask
note it is to be the DAQmxStartTask that takes the output high but if i remove the call it goes high when DAQmxWriteDigitalLines is called