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.
163 lines
4.7 KiB
C++
163 lines
4.7 KiB
C++
// Robot.h: interface for the CRobot class.
|
|
//
|
|
//////////////////////////////////////////////////////////////////////
|
|
|
|
#pragma once
|
|
|
|
#include <string>
|
|
|
|
#include "Scanner.h"
|
|
#include "Utility.h"
|
|
|
|
#ifdef BUILD_COMMDLL
|
|
#define COMMDLL_DLLCLASS __declspec(dllexport)
|
|
#else
|
|
#define COMMDLL_DLLCLASS __declspec(dllimport)
|
|
#endif
|
|
|
|
enum SCAN_RESULT
|
|
{
|
|
SCAN_UNKNOWN,
|
|
SCAN_COMPLETE,
|
|
SCAN_IN_PROGRESS,
|
|
SCAN_MOTION_ERROR,
|
|
SCAN_PROTRUDE_WAFER,
|
|
SCAN_CROSS_SLOTTED_WAFER,
|
|
};
|
|
|
|
enum ROBOT_POSITION
|
|
{
|
|
T_POSITION,
|
|
R_POSITION,
|
|
Y_POSITION,
|
|
Z_POSITION,
|
|
MAX_ROBOT_POSITION,
|
|
};
|
|
|
|
using stPosition = struct _stPosition
|
|
{
|
|
std::array<double, MAX_ROBOT_POSITION> dPos;
|
|
};
|
|
|
|
const std::string g_strHEX[]{
|
|
"0",
|
|
"1",
|
|
"2",
|
|
"3",
|
|
"4",
|
|
"5",
|
|
"6",
|
|
"7",
|
|
"8",
|
|
"9",
|
|
"A",
|
|
"B",
|
|
"C",
|
|
"D",
|
|
"E",
|
|
"F",
|
|
};
|
|
|
|
class COMMDLL_DLLCLASS CRobotComm : public CScanner, public CMyWait
|
|
{
|
|
public:
|
|
// ctor
|
|
CRobotComm();
|
|
virtual ~CRobotComm();
|
|
|
|
// methods
|
|
bool SetAlignAngle(double dAngle);
|
|
bool DisableTrajectoryMode();
|
|
bool EnableTrajectoryMode();
|
|
bool MoveStraight(int nDistance);
|
|
bool SetMoveSpeed(int nSpeed);
|
|
void ResetCommand();
|
|
void Disconnect(); // chan 8Dec05
|
|
bool MoveToCustomHome();
|
|
bool OffPrealignVacuum();
|
|
bool OnPrealignVacuum();
|
|
bool OffVacuum();
|
|
bool OnVacuum();
|
|
bool SendCommand();
|
|
bool Send(const std::string& csMsg); // chan 7Dec05
|
|
|
|
bool ScanCassetteFast(char cStation, int nOption = 1);
|
|
bool Prealign();
|
|
bool SetWaferDiameter(int nDia);
|
|
bool OffRobot();
|
|
bool OnRobot();
|
|
void ResetReplyEvents();
|
|
bool WaitAck();
|
|
void Stop();
|
|
bool HomeAllAxis();
|
|
bool SetInformMode(int nMode);
|
|
|
|
void ReceiveComm(const char* cpcBuffer, int nSize);
|
|
|
|
bool Input(int nPoint);
|
|
bool Output(int nOutput, int nState);
|
|
bool MoveToPoint(double dT_Position, double dR_Position, double dZ_Position, DWORD dwTimeout);
|
|
bool MoveAbs(char cAxis, double dPosition, DWORD dwTimeout);
|
|
bool MoveRel(char cAxis, double dDistance, DWORD dwTimeout);
|
|
bool MoveToPickup(char cStation, int nSlot, int nOption, DWORD dwTimeout, int nArm = 0);
|
|
bool MoveToCoordinates(char cStation, int nSlot, int nOption, DWORD dwTimeout, int nArm = 0);
|
|
bool MoveToStartScan(char cStation, int nSlot, int nIndex, DWORD dwTimeout, int nArm = 0);
|
|
bool MoveToApproach(char cStation, int nSlot, int nOption, DWORD dwTimeout, int nArm = 0);
|
|
bool MoveToStation(char cStation, int nSlot, DWORD dwTimeout, int nArm = 0);
|
|
bool PutWafer(char cStation, int nSlot, int nOption, DWORD dwTimeout, int nArm = 0);
|
|
bool GetWafer(char cStation, int nSlot, int nOption, DWORD dwTimeout, int nArm = 0);
|
|
|
|
// read robot status
|
|
bool CheckOnLine();
|
|
bool IsPrealignVacuumSensed();
|
|
bool IsVacuumSensed();
|
|
bool GetHomeStatus();
|
|
bool WaitForHomeComplete(DWORD dwTimeout);
|
|
bool WaitForRobotComplete(DWORD dwTimeout, bool bPrealigner = false);
|
|
bool WaitForPrealignComplete(DWORD dwTimeout);
|
|
std::string ReadStroke(char* cStation); // V1.14 31Jul06
|
|
std::string ReadVerticalOffset(char* cStation); // V1.14 31Jul06
|
|
std::string ReadCassetteDepth(char* cStation); // V1.14 31Jul06
|
|
std::string ReadScannedData(int nOption = 0);
|
|
|
|
std::string GetReceiveData();
|
|
int WaitForScanningComplete(DWORD dwTimeout);
|
|
|
|
private:
|
|
void UpdateCurrentCommand(const std::string& csCmd);
|
|
int GetIntValue(const std::string& csValue);
|
|
int ConvertHexToInt(const std::string& csHexString);
|
|
std::string GetCommand();
|
|
void SetCommand(const std::string& csCmd, bool bUpdateCommand = 0);
|
|
bool IsCurrentCommand(const std::string& csCmd);
|
|
bool TraceCurrentCommand(const std::string& csCmd, int iCmdLength = 3); // V1.14 31Jul06-compare command only.
|
|
|
|
// attributes
|
|
bool m_bWaitForTerminator2{ false };
|
|
bool m_bWaitForTerminator3{ false };
|
|
HANDLE m_hAck;
|
|
HANDLE m_hNck;
|
|
HANDLE m_hPrealignComplete;
|
|
HANDLE m_hStopRobot;
|
|
HANDLE m_hRobotComplete;
|
|
HANDLE m_hScanningComplete;
|
|
HANDLE m_hRobotHomeComplete;
|
|
HANDLE m_hReadPositionComplete;
|
|
HANDLE m_hReadVacuumComplete;
|
|
HANDLE m_hReadPrealignVacuumComplete;
|
|
HANDLE m_hStatusReceived;
|
|
HANDLE m_hReadStrokeComplete, m_hReadVerticalOffsetComplete, m_hReadCassetteDepthComplete; // V1.14 31Jul06
|
|
|
|
int m_nScanningResult;
|
|
|
|
std::string m_strCurrentCommand;
|
|
bool m_bCheckPrealignBusy;
|
|
bool m_bCheckRobotBusy;
|
|
std::string m_strScannedData;
|
|
std::string m_strCmd;
|
|
std::string m_strStrokeData, m_strVerticalOffsetData, m_strCassetteDepthData; // V1.14 31Jul06
|
|
|
|
bool m_bVacuumSensed;
|
|
bool m_bPrealignVacuumSensed;
|
|
};
|