You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
mitlib.pub/MITLIB/IODll/Motor_8134.h

188 lines
5.6 KiB
C++

// Motor_8134.h: interface for the CMotor_8134 class.
//
//////////////////////////////////////////////////////////////////////
#if !defined(AFX_MOTOR_8134_H__C10921AB_C838_4F26_9C8B_C8E38366E641__INCLUDED_)
#define AFX_MOTOR_8134_H__C10921AB_C838_4F26_9C8B_C8E38366E641__INCLUDED_
#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
// #include "8134ERR.H"
// #include "Pci_8134.h"
// #include "Pci8134a.h"
#include "MotorBase.h"
class CMotor_8134 : public CMotorBase
{
public:
CMotor_8134(CMtrProfile mtrProfile, double *dpPos);
virtual ~CMotor_8134();
// **************************************************************
// Methods declaration
// **************************************************************
// method to close the axis
void CloseAxis();
// method to initialize and configure the axis
void ConstructAxis() override;
// method to On/Off motor
int OnMtr(bool bOn);
// method to stop motor with decceleration
int DecStop();
// method to trigger Emergency stop the motor
int EStop();
// method to get commanded position
double GetCommandPosition();
// method to get the motor axis IO status
int GetMotionIOStatus();
// method to get the Motor Ready Status
BOOL IsMotorReady();
// method to get the Motor Alarm Status
BOOL IsMotorAlarm();
// method to get the Motor Negative/CCW Limit Status
BOOL IsNegLmtHit();
// method to get the Motor Positive/CW Limit Status
BOOL IsPosLmtHit();
// method to get the Motor Home Sensor Status
BOOL IsHomed();
// method to check if the Motor is TURN ON
bool IsMtrOn();
// method Check other axis home sensor
BOOL IsHomed(CMtrProfile mtrProfile);
// method to get other motor axis IO status
int GetMotionIOStatus(CMtrProfile mtrProfile);
// method to get Other axis motor ready status
BOOL IsMotorReady(CMtrProfile mtrProfile);
// method to get Other axis Alarm status
BOOL IsMotorAlarm(CMtrProfile mtrProfile);
// method to get Other axis negative/ccw limit status
BOOL IsNegLmtHit(CMtrProfile mtrProfile);
// method to get Other axis positive/cw limit status
BOOL IsPosLmtHit(CMtrProfile mtrProfile);
// method to get Other axis home sensor status
bool IsMtrOn(CMtrProfile mtrProfile);
// method to get other motor axis current position
double GetOtherAxisPosition(CMtrProfile mtrProfile);
// method to get motor axis current position error
double GetPosErr();
// method to get the current motor position
double GetPosition();
// method to do homing by limit sensor
BOOL HomingByLimit();
// method to do homing by sensor as well as index
BOOL HomeBySensorAndIndex();
// method to do homing by index signal
BOOL HomeByIndex();
// method to do homing by Home Sensor
BOOL HomeBySensor();
// method to move absolute
int MoveAbs(double dPosition, int nPos = -1, int nMode = 0);
// method to move continuously
int MoveContinuously(bool bCW = true);
// method to move relative distance
int MoveRel(double dDistance, int nPos = -1);
// method to process interrupt to decode what happen to the motor
void ProcessInt(int nIntCode = 0);
// method to reset single trigger
int ResetSingleTrigger();
// method to set the commanded position register
int SetCommandPosition(double dPosition);
// method to set the mechanical coversion factor
int SetConversionFactor(double dUPR, double dPPR, double dEPPR);
// method to set homing modes
int SetHomeMode(int iHomeMode);
// method to set multiple trigger
int SetMultipleTrigger(double dStartPosition, double dStopPosition, double dIntervalDistance, int nNoOfTrigger, int nCmpSource = 1);
// method to force set the current position
int SetPosition(double dPosition);
// method to arm controller axis for single trigger
int SetSingleTrigger(double dPosition, int nCmpSource = 1, int nPulseStretch = STRETCH_NON);
// method to arm multiaxis for simultaneous motion
int SimultaneousMove(int nNoOfAxis, CMtrProfile *mtrProfile, double *dPosition, double *dStartVel, double *dMaxVel, double *dAcc, int nMode = 0);
// method to move absolute with s-curve profile
int SMoveAbs(double dPosition, int nPos = -1, int nMode = 0);
// method to move motor in s-curve continuously
int SMoveContinuously(bool bCW = true);
// method to move relative distance with s-curve profile
int SMoveRel(double dDistance, int nPos = -1);
// return: success = MOTION_END; error = MOTION_ERROR; Force Stop = MOTION_FORCE_STOP
DWORD WaitHomeDone();
// virtual method to get the encoder index signal
virtual BOOL IsIndex();
// **************************************************************
// Methods declaration applicable to
// ADLINK 8134, 8164 ONLY - starts
// **************************************************************
// method to set the motor type and encoder input type
int SetMtrType(int iMtrType);
// method to set the motor alarm signal logic
int SetALM(int iALM);
// method to set the home sensor signal logic
int SetORGI(int iORGI);
// method to set the encoder Index signal logic
int SetIndexLogic(int iIndexLogic);
// method to set the in position signal logic
int SetINP(int iINP);
// method to set clk type, out/dir or cw/ccw
int SetClk(int iClk);
// **************************************************************
// Methods declaration applicable to
// ADLINK 8134, 8164 ONLY - ends
// **************************************************************
};
#endif // !defined(AFX_MOTOR_8134_H__C10921AB_C838_4F26_9C8B_C8E38366E641__INCLUDED_)