I am programming a 7344 motion control board using Visual Basic. My process requires multiple motions in order. However, recently, after the first move, I am not seeing the motion complete bit getting set. The motor stops moving, but no error is flagged and the motion complete bit is not getting set. The code being used is below:
' start motion
fresult = flex_load_target_pos(NIboard, YMotor.axis, 190050, &HFF)
If fresult <> 0 Then
Call MsgBox(fresult)
motionerror = True
Exit Sub
End If
fresult = flex_start(NIboard, YMotor.axis, 0)
If fresult <> 0 Then
Call MsgBox(fresult)
motionerror = True
Exit Sub
End If
' wait for movement complete
Do While True
DoEvents
fresult = flex_read_mcs_rtn(NIboard, Status)
fresult = flex_read_csr_rtn(NIboard, status2)
If Status And &H10 Then Exit Do
Call cbGetStatus(ADboard, Status, numtaken, currindex)
If stopRun Then
Call cbStopBackground(ADboard)
Call cbWinBufFree(bufHandle)
WaitForMeas = True
Exit Function
End If
Loop
Nothing has been changed in the code recently so what could cause this change in behavior?
Chuck Cottle
Advanced Inspection and Measurement