I am converting Traditional NiDaq code to DaqMX. This is not my original code and the original programmer is no longer around.
The following code is used without any wiring connected to pin 43 on 6030E series:
Select_Signal(m_sDeviceNumber, ND_PFI_2,ND_IN_CONVERT,ND_HIGH_TO_LOW)
Any idea what this does when no wiring is connected to pin 43 (PFI 2/AI CONV CLK)?
and...if you have time, what does each function call in the follwowing code do?
if ((nStatus = GPCTR_Control(m_sDeviceNumber,ND_COUNTER_1, ND_RESET)) != 0) { sprintf(szErrorMessage,"AT-MIO-16X GPCTR_Control error, %d.",nStatus); AfxMessageBox(szErrorMessage, MB_OK | MB_ICONSTOP ); return FALSE; } if ((nStatus = GPCTR_Set_Application(m_sDeviceNumber,ND_COUNTER_1, ND_PULSE_TRAIN_GNR)) != 0) { sprintf(szErrorMessage,"AT-MIO-16X GPCTR_Set_Application error, %d.",nStatus); AfxMessageBox(szErrorMessage, MB_OK | MB_ICONSTOP ); return FALSE; } if ((nStatus = GPCTR_Change_Parameter(m_sDeviceNumber,ND_COUNTER_1, ND_COUNT_1,(m_dwCount - m_nNumberChannel))) != 0) { sprintf(szErrorMessage,"AT-MIO-16X GPCTR_Change_Parameter error, %d.",nStatus); AfxMessageBox(szErrorMessage, MB_OK | MB_ICONSTOP ); return FALSE; } if ((nStatus = GPCTR_Change_Parameter(m_sDeviceNumber,ND_COUNTER_1, ND_COUNT_2,m_nNumberChannel)) != 0) { sprintf(szErrorMessage,"AT-MIO-16X GPCTR_Change_Parameter error, %d.",nStatus); AfxMessageBox(szErrorMessage, MB_OK | MB_ICONSTOP ); return FALSE; } // if ((nStatus = GPCTR_Change_Parameter(m_sDeviceNumber,ND_COUNTER_1, ND_SOURCE,ND_PFI_2)) != 0) { sprintf(szErrorMessage,"AT-MIO-16X GPCTR_Change_Parameter error, %d.",nStatus); AfxMessageBox(szErrorMessage, MB_OK | MB_ICONSTOP ); return FALSE; } if ((nStatus = GPCTR_Change_Parameter(m_sDeviceNumber,ND_COUNTER_1, ND_OUTPUT_POLARITY,ND_NEGATIVE)) != 0) { sprintf(szErrorMessage,"AT-MIO-16X GPCTR_Change_Parameter error, %d.",nStatus); AfxMessageBox(szErrorMessage, MB_OK | MB_ICONSTOP ); return FALSE; } if ((nStatus = Select_Signal(m_sDeviceNumber, ND_PFI_2,ND_IN_CONVERT,ND_HIGH_TO_LOW)) != 0) { sprintf(szErrorMessage,"AT-MIO-16X GPCTR_Select_Signal error, %d.",nStatus); AfxMessageBox(szErrorMessage, MB_OK | MB_ICONSTOP ); return FALSE; } if ((nStatus = Select_Signal(m_sDeviceNumber, ND_GPCTR1_OUTPUT,ND_GPCTR1_OUTPUT,ND_LOW_TO_HIGH)) != 0) { sprintf(szErrorMessage,"AT-MIO-16X GPCTR_Select_Signal error, %d.",nStatus); AfxMessageBox(szErrorMessage, MB_OK | MB_ICONSTOP ); return FALSE; } if ((nStatus = GPCTR_Control(m_sDeviceNumber,ND_COUNTER_1,ND_PROGRAM)) != 0) { sprintf(szErrorMessage,"AT-MIO-16X GPCTR_Control error, %d.",nStatus); AfxMessageBox(szErrorMessage, MB_OK | MB_ICONSTOP ); return FALSE; }
Thanks fro your help