public bool IsMoveDone(short sAxis) { bool bResult; if (_bArrayIsMoving[sAxis]) { bResult = false; } else { lock (lockObj) { _dArrayTargetPos[sAxis] = LTDMC.dmc_get_target_position(iCardIndex, (ushort)sAxis); } if (_dArrayCurrPos[sAxis] == _dArrayTargetPos[sAxis] && (!_bArrayAlarmSta[sAxis]) && (!_bArrayIsMoving[sAxis])) { bResult = true; } else { bResult = false; } } return(bResult); }
public void GetAllMotionStatus() { lock (lockObj) { for (ushort iAxis = 0; iAxis < 8; iAxis++) { uint uiCurrent = 0; try { _dArrayTargetPos[iAxis] = LTDMC.dmc_get_target_position(iCardIndex, iAxis); _dArrayCurrPos[iAxis] = LTDMC.dmc_get_position(iCardIndex, iAxis); if (LTDMC.dmc_check_done(iCardIndex, iAxis) == 1) { _bArrayIsMoving[iAxis] = false; } else { _bArrayIsMoving[iAxis] = true; } uiCurrent = LTDMC.dmc_axis_io_status(iCardIndex, iAxis); } catch { } if ((uiCurrent & 0x1) == 0) { _bArrayAlarmSta[iAxis] = false; } else { _bArrayAlarmSta[iAxis] = true; } if ((uiCurrent & 0x2) == 0) { _bArrayCWLLimitSta[iAxis] = false; } else { _bArrayCWLLimitSta[iAxis] = true; } if ((uiCurrent & 0x4) == 0) { _bArrayCCWLLimitSta[iAxis] = false; } else { _bArrayCCWLLimitSta[iAxis] = true; } if ((uiCurrent & 0x10) == 0) { _bArrayHomeSta[iAxis] = false; } else { _bArrayHomeSta[iAxis] = true; } } } }