|
|
|
|
#pragma once
|
|
|
|
|
|
|
|
|
|
#define CORE_NUM 1
|
|
|
|
|
#define CYCLIC_SYNC_POSITION 8 //<2F><><EFBFBD><EFBFBD>ģʽΪѭ<CEAA><D1AD><EFBFBD>˶<EFBFBD><CBB6><EFBFBD><EFBFBD><EFBFBD>ģʽ
|
|
|
|
|
|
|
|
|
|
#include <windows.h>
|
|
|
|
|
#include <vector>
|
|
|
|
|
#include "IGugaoDriver.h"
|
|
|
|
|
#include "Logger.h"
|
|
|
|
|
class _declspec(dllexport) CGugaoDriver : public IGugaoDriver
|
|
|
|
|
{
|
|
|
|
|
public:
|
|
|
|
|
CGugaoDriver();
|
|
|
|
|
~CGugaoDriver();
|
|
|
|
|
|
|
|
|
|
public:
|
|
|
|
|
virtual bool OpenCard(std::vector<int>& axisIdVec);
|
|
|
|
|
virtual bool CloseCard(std::vector<int>& axisIdVec);
|
|
|
|
|
virtual int AbsMove(int iAxisId,
|
|
|
|
|
int pulseTo1mm,
|
|
|
|
|
double dPos,
|
|
|
|
|
double dAcc,
|
|
|
|
|
double dDec,
|
|
|
|
|
double dMoveSpeed,
|
|
|
|
|
bool bWaitFinished);
|
|
|
|
|
virtual int WriteIO(short sSlaveNo, short sIoIndex, unsigned char ucValue);
|
|
|
|
|
virtual int WriteAO(short sSlaveNo, short sIoIndex, short sValue); //<2F><><EFBFBD><EFBFBD>ģ<EFBFBD><C4A3><EFBFBD><EFBFBD>
|
|
|
|
|
virtual short ReadDo(short sSlaveNo, short sIoIndex);
|
|
|
|
|
virtual unsigned char ReadDi(short sSlaveNo, short sIoIndex);
|
|
|
|
|
virtual double GetCurPos(int iAxisId, int pulseTo1mm);
|
|
|
|
|
virtual void stopMove(int iAxisId);
|
|
|
|
|
virtual int home(int iAxisId, double dSearchSpeed, double iIndexSpeed, double sSearchAcc, short sModule);
|
|
|
|
|
|
|
|
|
|
//״̬<D7B4>ж<EFBFBD>
|
|
|
|
|
virtual bool IsHome(int iAxisId);
|
|
|
|
|
virtual bool IsHoming(int iAxisId);
|
|
|
|
|
virtual bool IsMoveing(int iAxisId);
|
|
|
|
|
virtual bool IsMoveEnd(int iAxisId);
|
|
|
|
|
virtual bool IsAxisEnable(int iAxisId);
|
|
|
|
|
virtual bool IsAxisError(int iAxisId);
|
|
|
|
|
virtual bool GetAxisErrorCode(int iAxisId);
|
|
|
|
|
virtual bool IsAxisPaslimit(int iAxisId);
|
|
|
|
|
virtual bool isAxisNagLimit(int iAxisId);
|
|
|
|
|
|
|
|
|
|
private:
|
|
|
|
|
bool m_open = false;
|
|
|
|
|
};
|
|
|
|
|
|