test vs2019
parent
1a825f2228
commit
9420719f85
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@ -0,0 +1,27 @@
|
||||
// InputController_1203.h: interface for the CInputController_1203 class.
|
||||
//
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
|
||||
#if !defined(AFX_INPUTCONTROLLER_1203_H__D937EBC5_25E7_4A81_9CAF_18EBCF8F49F8__INCLUDED_)
|
||||
#define AFX_INPUTCONTROLLER_1203_H__D937EBC5_25E7_4A81_9CAF_18EBCF8F49F8__INCLUDED_
|
||||
|
||||
#if _MSC_VER > 1000
|
||||
#pragma once
|
||||
#endif // _MSC_VER > 1000
|
||||
|
||||
#include "InputControllerBase.h"
|
||||
|
||||
class CInputController_1203 : public CInputControllerBase
|
||||
{
|
||||
public:
|
||||
CInputController_1203();
|
||||
virtual ~CInputController_1203();
|
||||
|
||||
// method to initialise the input controller card
|
||||
int InitCard(int nHardwareIniTypeID, int nHardwareIniTypeCardNo, int *pPhysicalCardID) override;
|
||||
|
||||
// method to close the input controller card
|
||||
int CloseCard(int nPhysicalCardID) override;
|
||||
};
|
||||
|
||||
#endif // !defined(AFX_INPUTCONTROLLER_1203_H__D937EBC5_25E7_4A81_9CAF_18EBCF8F49F8__INCLUDED_)
|
||||
@ -0,0 +1,35 @@
|
||||
// Input_1203.h: interface for the CInput_1203 class.
|
||||
//
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
|
||||
#if !defined(AFX_INPUT_1203_H__541D5DB0_55F8_40BA_B3D7_EE128774A724__INCLUDED_)
|
||||
#define AFX_INPUT_1203_H__541D5DB0_55F8_40BA_B3D7_EE128774A724__INCLUDED_
|
||||
|
||||
#if _MSC_VER > 1000
|
||||
#pragma once
|
||||
#endif // _MSC_VER > 1000
|
||||
|
||||
#include "InputBase.h"
|
||||
|
||||
class CAdvantechCommon_ACM;
|
||||
|
||||
class CInput_1203 : public CInputBase
|
||||
{
|
||||
public:
|
||||
CInput_1203(const CInputSetting &Setting);
|
||||
virtual ~CInput_1203();
|
||||
|
||||
// method to query Analog input voltage
|
||||
// nRange = 0 -> +/-10V
|
||||
// nRange = 1 -> +/-5V
|
||||
// nRange = 2 -> +/-2.5V
|
||||
// nRange = 3 -> +/-1.25V
|
||||
BOOL GetVoltage(double &dVoltage, int nRange) override;
|
||||
|
||||
int GetState() override;
|
||||
|
||||
private:
|
||||
std::unique_ptr<CAdvantechCommon_ACM> m_pCommon;
|
||||
};
|
||||
|
||||
#endif // !defined(AFX_INPUT_1203_H__541D5DB0_55F8_40BA_B3D7_EE128774A724__INCLUDED_)
|
||||
@ -0,0 +1,39 @@
|
||||
// MotionController_1203.h: interface for the CMotionController_1203 class.
|
||||
//
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
|
||||
#if !defined(AFX_MOTIONCONTROLLER_1203_H__7EA80A57_50A0_4983_A3B7_8176E4504168__INCLUDED_)
|
||||
#define AFX_MOTIONCONTROLLER_1203_H__7EA80A57_50A0_4983_A3B7_8176E4504168__INCLUDED_
|
||||
|
||||
#if _MSC_VER > 1000
|
||||
#pragma once
|
||||
#endif // _MSC_VER > 1000
|
||||
|
||||
#include "MotionControllerBase.h"
|
||||
|
||||
class CMotionController_1203 : public CMotionControllerBase
|
||||
{
|
||||
public:
|
||||
CMotionController_1203(int index);
|
||||
virtual ~CMotionController_1203();
|
||||
|
||||
BOOL Init(int &nNoOfMtr) override;
|
||||
void Close() override;
|
||||
|
||||
// get the IOs status of the motor
|
||||
unsigned short GetMotionIOStatus(const CMtrProfile &mtrProfile) override;
|
||||
|
||||
// get Motion status of motor
|
||||
int GetMotionStatus(const CMtrProfile &mtrProfile) override;
|
||||
|
||||
// get Motor Pos value
|
||||
double GetMtrPos(const CMtrProfile &mtrProfile) override;
|
||||
|
||||
// get position error value
|
||||
double GetPosErr(const CMtrProfile &mtrProfile) override;
|
||||
|
||||
private:
|
||||
|
||||
};
|
||||
|
||||
#endif // !defined(AFX_MOTIONCONTROLLER_1203_H__7EA80A57_50A0_4983_A3B7_8176E4504168__INCLUDED_)
|
||||
@ -0,0 +1,69 @@
|
||||
// MotionController_ADVANTECH_ETHERCAT.h: interface for the CMotionController_ADVANTECH_ETHERCAT class.
|
||||
//
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
|
||||
#if !defined(AFX_MOTIONCONTROLLER_ADVANTECH_ETHERCAT_H__2B8E92ED_42EF_4887_8D87_9C9AAEEE22CD__INCLUDED_)
|
||||
#define AFX_MOTIONCONTROLLER_ADVANTECH_ETHERCAT_H__2B8E92ED_42EF_4887_8D87_9C9AAEEE22CD__INCLUDED_
|
||||
|
||||
#if _MSC_VER > 1000
|
||||
#pragma once
|
||||
#endif // _MSC_VER > 1000
|
||||
#include <vector>
|
||||
#include "MotionControllerBase.h"
|
||||
|
||||
class CMotionController_ADVANTECH_ETHERCAT;
|
||||
typedef struct _stThreadParam {
|
||||
int nId;
|
||||
CMotionController_ADVANTECH_ETHERCAT *pController;
|
||||
// ctor
|
||||
_stThreadParam(int _id, CMotionController_ADVANTECH_ETHERCAT* _pController)
|
||||
{
|
||||
nId = _id;
|
||||
pController = _pController;
|
||||
}
|
||||
} stThreadParam;
|
||||
|
||||
class CMotionController_ADVANTECH_ETHERCAT : public CMotionControllerBase
|
||||
{
|
||||
public:
|
||||
CMotionController_ADVANTECH_ETHERCAT(int index);
|
||||
virtual ~CMotionController_ADVANTECH_ETHERCAT();
|
||||
|
||||
BOOL Init(int &nNoOfMtr) override;
|
||||
void Close() override;
|
||||
|
||||
int GetCardId(int nIndex)
|
||||
{
|
||||
return m_cardInfo[nIndex].nId;
|
||||
}
|
||||
|
||||
void SetAdvantechMotionInt(int nCardNo, int nAxisNo);
|
||||
bool m_bKillThread;
|
||||
|
||||
private:
|
||||
typedef struct _stCardInfo {
|
||||
unsigned short nId;
|
||||
unsigned short nNumOfAxes;
|
||||
unsigned short nNumOfMotionSlaves;
|
||||
unsigned short nNumOfIoSlaves;
|
||||
|
||||
_stCardInfo(unsigned short _Id, unsigned short _numOfAxes, unsigned short _numOfMotionSlaves, unsigned short _numOfIoSlaves)
|
||||
{
|
||||
nId = _Id;
|
||||
nNumOfAxes = _numOfAxes;
|
||||
nNumOfMotionSlaves = _numOfMotionSlaves;
|
||||
nNumOfIoSlaves = _numOfIoSlaves;
|
||||
}
|
||||
} stCardInfo;
|
||||
// methods
|
||||
|
||||
// attributes
|
||||
std::vector<stCardInfo> m_cardInfo;
|
||||
std::map<std::string, ULONG> m_mapModelDeviceType;
|
||||
|
||||
std::vector<stThreadParam> m_vecThdParam;
|
||||
CWinThread *m_pAdvantechIntThread[2];
|
||||
|
||||
};
|
||||
|
||||
#endif // !defined(AFX_MOTIONCONTROLLER_ADVANTECH_ETHERCAT_H__2B8E92ED_42EF_4887_8D87_9C9AAEEE22CD__INCLUDED_)
|
||||
@ -0,0 +1,191 @@
|
||||
// Motor_7856.h: interface for the CMotor_1203 class.
|
||||
//
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
|
||||
#if !defined(AFX_MOTOR_1203_H__912D0237_EABF_43CC_B320_635408A66001__INCLUDED_)
|
||||
#define AFX_MOTOR_1203_H__912D0237_EABF_43CC_B320_635408A66001__INCLUDED_
|
||||
|
||||
#if _MSC_VER > 1000
|
||||
#pragma once
|
||||
#endif // _MSC_VER > 1000
|
||||
|
||||
#include "MotorAdlinkBase.h"
|
||||
|
||||
#include <map>
|
||||
|
||||
#define MAX_AXIS_SIMULTANEOUS_MOV_ETHERCAT 8
|
||||
|
||||
|
||||
class CMotor_1203 : public CMotorAdlinkBase
|
||||
{
|
||||
public:
|
||||
CMotor_1203(CMtrProfile mtrProfile, double *dpPos, CMotionControllerBase *pBaseController);
|
||||
virtual ~CMotor_1203();
|
||||
|
||||
// **************************************************************
|
||||
// Methods declaration
|
||||
// **************************************************************
|
||||
|
||||
// method to close the axis
|
||||
void CloseAxis() override;
|
||||
|
||||
void ConstructAxis() override;
|
||||
|
||||
// method to initialize and configure the axis
|
||||
void ConstructMotor() override;
|
||||
|
||||
// method to On/Off motor
|
||||
bool OnMotor() override;
|
||||
bool OffMotor() override;
|
||||
|
||||
// method to stop motor with decceleration
|
||||
bool DecelStop() override;
|
||||
|
||||
// method to trigger Emergency stop the motor int EStop();
|
||||
bool EmergStop() override;
|
||||
|
||||
// method to get commanded position
|
||||
bool GetMotorCommandedPosition(int nMtrNo, double *pRaw) override;
|
||||
|
||||
// method to get other motor axis IO status
|
||||
int GetMotionIOStatus(const CMtrProfile &mtrProfile) override;
|
||||
|
||||
// method to get other motor axis current position
|
||||
bool GetMotorPosition(const CMtrProfile &mtrProfile, double *pRawPosition) override;
|
||||
|
||||
// method to get motor axis current position error
|
||||
bool GetMotorPositionError(double *pRawPositionError) override;
|
||||
|
||||
bool FindHome(HOME_DIR homeDir, MOTION_SPEED speed, bool bToggleHomeSensor);
|
||||
|
||||
// Home by sensor or by limit
|
||||
BOOL HomeByHomeMode(int homeMode);
|
||||
|
||||
// method to do homing by limit sensor
|
||||
BOOL HomingByLimit() override;
|
||||
|
||||
// method to do homing by index signal
|
||||
BOOL HomeByIndex() override;
|
||||
|
||||
// method to do homing by Home Sensor
|
||||
BOOL HomeBySensor() override;
|
||||
|
||||
// method to home by home mode 27: (EL On Then reverse to count EZ number and reset counter)
|
||||
BOOL HomeByLimitThenIndex() override;
|
||||
|
||||
// method to move absolute
|
||||
bool AbsoluteMove(double dPosition, int nMode, PROFILE_CURVE curve) override;
|
||||
|
||||
// method to move continuously
|
||||
int MoveContinuously(bool bCW = true) override;
|
||||
|
||||
// method to move relative distance
|
||||
bool RelativeMove(double dDistance, PROFILE_CURVE curve) override;
|
||||
|
||||
// method to process interrupt to decode what happen to the motor
|
||||
void ProcessInt(int nIntCode = 0) override;
|
||||
|
||||
// method to reset single trigger
|
||||
int ResetSingleTrigger(double dPosition = 0.0) override;
|
||||
|
||||
// method to set the commanded position register
|
||||
bool SetMotorCommandedPosition(double dPosition) override;
|
||||
|
||||
// method to set the mechanical coversion factor
|
||||
bool RefreshMotorConversionFactor() override;
|
||||
|
||||
// method to set homing modes
|
||||
bool SetMotorHomeMode(int iHomeMode) override;
|
||||
|
||||
int SetMultipleTrigger(double* pPosition, int nNoOfTrigger, int nCmpSource = 1) override;
|
||||
|
||||
// method to set multiple trigger
|
||||
bool SetMotorMultipleTrigger(const multiple_trigger &trigger) override;
|
||||
|
||||
// method to force set the current position
|
||||
bool SetMotorPosition(double dPosition) override;
|
||||
|
||||
// method to arm controller axis for single trigger
|
||||
int SetSingleTrigger(double dPosition, int nCmpSource = 1, int nPulseStretch = STRETCH_NON) override;
|
||||
|
||||
// method to arm multiaxis for simultaneous motion
|
||||
bool SetupAbsoluteSimultaneousMove(int nNoOfAxis, short *sAxis, double *dPosition, double *dStartVel, double *dMaxVel, double *dAcc, double *dDec) override;
|
||||
bool SetupRelativeSimultaneousMove(int nNoOfAxis, short *sAxis, double *dPosition, double *dStartVel, double *dMaxVel, double *dAcc, double *dDec) override;
|
||||
bool StartSimultaneousMove(int nFirstAxisNo) override;
|
||||
// - use MotorAdLinkBase Simultaneous move Move - Lim HS
|
||||
|
||||
// method to move motor in s-curve continuously
|
||||
int SMoveContinuously(bool bCW = true) override;
|
||||
|
||||
void SetMotorProfile(double dValue, motion_profile::PROFILE_TYPE type) override;
|
||||
|
||||
// method to set the motor type and encoder input type
|
||||
bool SetMotorType(int iMtrType) override;
|
||||
|
||||
// method to set the motor alarm signal logic
|
||||
bool SetMotorAlarmLogic(int iALM) override;
|
||||
|
||||
// method to set the home sensor signal logic
|
||||
bool SetMotorHomeSensorLogic(int iORGI) override;
|
||||
|
||||
// method to set the encoder Index signal logic
|
||||
bool SetMotorIndexLogic(int iIndexLogic) override;
|
||||
|
||||
// method to set the in position signal logic
|
||||
bool SetMotorINPLogic(int iINP) override;
|
||||
|
||||
// method to set clk type, out/dir or cw/ccw
|
||||
bool SetMotorClk(int iClk) override;
|
||||
|
||||
// Gary 21Mar11, V1.28.01
|
||||
// Method to reset driver alarm via MotionNet
|
||||
int ResetAlarm(bool bReset) override;
|
||||
bool IsSimultaneousMoveSupported(void) override;
|
||||
|
||||
virtual double ConvertAccToMtrUnits(double dAcc, double dNumPulsePerMM) override;
|
||||
|
||||
private:
|
||||
typedef struct _stSimMoveInfo {
|
||||
unsigned short shMode; //0 = ABs, 1 = Rel
|
||||
double dMasterPos;
|
||||
//ctor
|
||||
_stSimMoveInfo()
|
||||
{
|
||||
shMode = 0;
|
||||
dMasterPos = 0;
|
||||
}
|
||||
} stSimMoveInfo;
|
||||
|
||||
UINT_PTR m_hAxis;
|
||||
|
||||
int Home(bool bHomeReverse, bool bSlowSpeed);
|
||||
|
||||
bool PrepareMotionCurve(PROFILE_CURVE curve);
|
||||
|
||||
enum PROFILE_TYPE
|
||||
{
|
||||
ACC,
|
||||
DEC,
|
||||
START_VEL,
|
||||
MAX_VEL,
|
||||
};
|
||||
|
||||
ULONG GetHwHomeMode(int iHomeMode);
|
||||
|
||||
bool SetMotionProfile(PROFILE_TYPE profileType);
|
||||
|
||||
bool BeginContinuousMove(bool bDirection);
|
||||
|
||||
bool ContinuousMove(PROFILE_CURVE profileCurve, bool bDir);
|
||||
|
||||
bool PrepareForMove(PROFILE_CURVE profileCurve);
|
||||
bool PrepareSimultaneousMove(const std::vector<UINT_PTR> &vecAxisHandle, double *dPosition, double *dStartVel, double *dMaxVel, double *dAcc, double *dDec);
|
||||
|
||||
stSimMoveInfo m_stSimMove;
|
||||
long m_AxisId [MAX_AXIS_SIMULTANEOUS_MOV_ETHERCAT];
|
||||
long m_Posn [MAX_AXIS_SIMULTANEOUS_MOV_ETHERCAT];
|
||||
long m_MaxVel [MAX_AXIS_SIMULTANEOUS_MOV_ETHERCAT];
|
||||
|
||||
};
|
||||
|
||||
#endif // !defined(AFX_MOTOR_1203_H__912D0237_EABF_43CC_B320_635408A66001__INCLUDED_)
|
||||
@ -0,0 +1,27 @@
|
||||
// OutputController_1203.h: interface for the COutputController_1203 class.
|
||||
//
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
|
||||
#if !defined(AFX_OUTPUTCONTROLLER_1203_H__35C41678_8787_408E_854C_739C6DE40BCF__INCLUDED_)
|
||||
#define AFX_OUTPUTCONTROLLER_1203_H__35C41678_8787_408E_854C_739C6DE40BCF__INCLUDED_
|
||||
|
||||
#if _MSC_VER > 1000
|
||||
#pragma once
|
||||
#endif // _MSC_VER > 1000
|
||||
|
||||
#include "OutputControllerBase.h"
|
||||
|
||||
class COutputController_1203 : public COutputControllerBase
|
||||
{
|
||||
public:
|
||||
COutputController_1203();
|
||||
virtual ~COutputController_1203();
|
||||
|
||||
// method to initialise the output controller card
|
||||
int InitCard(int nHardwareIniTypeID, int nHardwareIniTypeCardNo, int *pPhysicalCardID) override;
|
||||
|
||||
// method to close the output controller card
|
||||
int CloseCard(int nPhysicalCardID) override;
|
||||
};
|
||||
|
||||
#endif // !defined(AFX_OUTPUTCONTROLLER_1203_H__35C41678_8787_408E_854C_739C6DE40BCF__INCLUDED_)
|
||||
@ -0,0 +1,31 @@
|
||||
// Output_1203.h: interface for the COutput_1203 class.
|
||||
//
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
|
||||
#if !defined(AFX_OUTPUT_1203_H__C047F760_46EB_44CC_A05A_78B815955096__INCLUDED_)
|
||||
#define AFX_OUTPUT_1203_H__C047F760_46EB_44CC_A05A_78B815955096__INCLUDED_
|
||||
|
||||
#if _MSC_VER > 1000
|
||||
#pragma once
|
||||
#endif // _MSC_VER > 1000
|
||||
|
||||
#include "OutputBase.h"
|
||||
|
||||
class CAdvantechCommon_ACM;
|
||||
|
||||
class COutput_1203 : public COutputBase
|
||||
{
|
||||
public:
|
||||
COutput_1203(const COutputSetting &Setting);
|
||||
virtual ~COutput_1203();
|
||||
|
||||
// method to set analog output voltage
|
||||
BOOL SetVoltage(double dVoltage, double dRange) override;
|
||||
|
||||
BOOL SetState(bool bState) override;
|
||||
|
||||
private:
|
||||
std::unique_ptr<CAdvantechCommon_ACM> m_pCommon;
|
||||
};
|
||||
|
||||
#endif // !defined(AFX_OUTPUT_1203_H__C047F760_46EB_44CC_A05A_78B815955096__INCLUDED_)
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Loading…
Reference in New Issue