676 lines
23 KiB
C++
676 lines
23 KiB
C++
// DataLink.h: interface for the CDataLink class.
|
|
//
|
|
//////////////////////////////////////////////////////////////////////
|
|
#if !defined(AFX_DataLink_H__B422904C_2CEB_495B_B7BD_B45AB30286DD__INCLUDED_)
|
|
#define AFX_DataLink_H__B422904C_2CEB_495B_B7BD_B45AB30286DD__INCLUDED_
|
|
|
|
#define MV_TRACE if ( g_pLogger && g_pLogger->m_lLogMask & LOGACTIONS ) g_pLogger->SendAndFlushPerMode
|
|
|
|
#if _MSC_VER > 1000
|
|
#pragma once
|
|
#endif // _MSC_VER > 1000 /*ThirdParty\UsbSupport\LibUsb_Win\Include\lusb0_usb.h
|
|
|
|
#include "..\Tools\UsbUtility\logger.h"
|
|
#include "..\..\..\..\..\ThirdParty\UsbSupport\LibUsb_Win\Include\lusb0_usb.h"
|
|
#include "SsiStatus.h"
|
|
|
|
#define MV_TIMER_POLL_58 0x58
|
|
#define MV_TIMER_POLL_59 0x59
|
|
#define MV_TIMER_POLL_2B 0x2B
|
|
|
|
#define MAX_ASYNC_CONTEXT 10
|
|
#define MV_CMD_UNKNOWN 0x00
|
|
#define MV_CMD_POLL_00_01 0x01
|
|
#define MV_CMD_GET_POS_XYZ_00_02 0x02
|
|
#define MV_CMD_SET_POS_XYZ_00_03 0x03
|
|
#define MV_CMD_GET_POS_R_00_04 0x04
|
|
#define MV_CMD_SET_POS_R_00_05 0x05
|
|
#define MV_CMD_SET_ZOOM_00_06 0x06
|
|
#define MV_CMD_GET_ZOOM_00_07 0x07
|
|
#define MV_CMD_GET_STARUP_CONFIG_00 0x00
|
|
#define MV_CMD_GET_SUB_CONFIG_28 0x28 // Get 0x12 bytes
|
|
#define MV_CMD_GET_SUB_CONFIG_29 0x29 // Get 0x60 bytes - two subcode
|
|
#define MV_CMD_SERVO_CMD_2B 0x2b // Get 0x45 bytes
|
|
#define MV_CMD_START_MACHINE_2C 0x2c // Get 0x20 bytes
|
|
#define MV_CMD_GET_UNK_31 0x31 // Get 0x20
|
|
#define MV_CMD_GET_UNK_32 0x32 // Get 0x02
|
|
#define MV_CMD_GET_UNK_34 0x34 // Get 0x02
|
|
#define MV_CMD_GET_UNK_35 0x35 // Get 0x10
|
|
#define MV_CMD_GET_UNK_3C 0x3C // Get 0x10
|
|
#define MV_CMD_GET_X_INDEX_41 0x41 // Get 0x06
|
|
#define MV_CMD_GET_Y_INDEX_42 0x42 // Get 0x06
|
|
#define MV_CMD_GET_MAG_43 0x43 // Get 0x06
|
|
#define MV_CMD_GET_ZOOM_DECEL_45 0x45 // Get 0x06
|
|
#define MV_CMD_SET_JOYSTICK_MODE_47 0x47 //
|
|
#define MV_CMD_MOVE_AXIS_4C 0x4C // Get 0x02
|
|
#define MV_CMD_GET_INDEX_4E 0x4E // Get 0x07
|
|
#define MV_CMD_SEEK_INDEX_4F 0x4F // Get 0x07
|
|
#define MV_CMD_MAX_SPEED_50 0x50
|
|
#define MV_CMD_MAX_ACCEL_51 0x51
|
|
#define MV_CMD_MOVE_TO_53 0x53 // Get 0x11
|
|
#define MV_CMD_GET_UNK_56 0x56 // Get 0x20
|
|
#define MV_CMD_GET_SCALE_58 0x58 // Get 0x11
|
|
#define MV_CMD_GET_POLL_59 0x59 // Get 0x3E
|
|
#define MV_CMD_GET_WORKING_LIMITS_5E 0x5E // Get 0x78
|
|
#define MV_CMD_GET_CONFIG_60 0x60 // Get 0x72 bytes
|
|
#define MV_CMD_GET_RAW_SCALE_63 0x63 // Get 0x63
|
|
#define MV_CMD_GET_CONFIG_69 0x69 // Get 0xFE
|
|
#define MV_CMD_GET_UNK_6A 0x6A // Get 0x6a
|
|
#define MV_CMD_SET_LIGHT_6E 0x6E // Get 0xFE
|
|
#define MV_CMD_GET_MACHINE_SIGNATURE_6F 0x6F // Get 0xFE
|
|
#define MV_CMD_GET_LIGHT_CONFIG_70 0x70 // Get 0xFE
|
|
#define MV_CMD_GET_UNK_71 0x71 // Get 0xFE
|
|
#define MV_CMD_GET_UNK_74 0x74 // Get 0xFE
|
|
#define MV_CMD_GET_UNK_75 0x75 // Get 0xFE
|
|
#define MV_CMD_MAX_DECEL_76 0x76 // Get 0x11
|
|
#define MV_CMD_GET_SCALE_SLACK_7C 0x7C // Get 0x04
|
|
|
|
#define MAX_BUFF_SIZE 0x200
|
|
|
|
#define USB_ENDPOINT_TYPE_CONTROL 0
|
|
#define USB_ENDPOINT_TYPE_ISOCHRONOUS 1
|
|
#define USB_ENDPOINT_TYPE_BULK 2
|
|
#define USB_ENDPOINT_TYPE_INTERRUPT 3
|
|
|
|
#define USB_DEVICE_DESCRIPTOR_TYPE 1
|
|
#define USB_CONFIGURATION_DESCRIPTOR_TYPE 2
|
|
|
|
#define THREAD_RUNNING 0
|
|
#define THREAD_PAUSED 1
|
|
#define THREAD_EXIT -1
|
|
|
|
// Device configuration and interface id.
|
|
#define MV_USB_CONFIG 1
|
|
#define MV_USB_INTF 0
|
|
|
|
#define EP_01 0x01
|
|
#define EP_02 0x02
|
|
#define EP_03 0x03
|
|
#define EP_81 0x81
|
|
#define EP_82 0x82
|
|
#define EP_84 0x84
|
|
|
|
#define EP_01_CMD_IDX 0 // index to usb buffers
|
|
#define EP_81_DATA_IDX 1 //
|
|
#define EP_02_CMD_IDX 2 //
|
|
#define EP_82_DATA_IDX 3 //
|
|
#define EP_03_CMD_IDX 4 //
|
|
#define EP_84_DATA_IDX 5 //
|
|
|
|
#define lEPSIZE 6
|
|
#define MAXRINGS 5 // for MicroVu Vertex 220
|
|
#define MAXSEGS 8
|
|
|
|
#define TWO_RINGS 2
|
|
#define EIGHT_SEGS 8
|
|
#define FIVE_RINGS 5
|
|
|
|
const long MAXINTENSITY = 0x3FF;
|
|
#define mvMAXLIGHTVALUE 1024
|
|
|
|
enum SETTLE_STATUS
|
|
{
|
|
NOTSETTLED = 0,
|
|
SETTLED,
|
|
TIMEDOUT
|
|
};
|
|
|
|
#pragma pack(push)
|
|
#pragma pack(1)
|
|
//****************************************************************************************************
|
|
// Set the _status to Idle after reply data has been received.
|
|
// How to recover? In order to send data, _status must be Idle. If the system is not available
|
|
// for 1 second, assume something wrong and treat it as "TimeOut".
|
|
// Another way to do this is to lock this structure is to use a mutex to ensure single-threaded
|
|
// access.
|
|
//****************************************************************************************************
|
|
typedef struct s_axis // axis parameters
|
|
{
|
|
long _pos_58;
|
|
long _pos_59;
|
|
long _scale_pos;
|
|
long _speed;
|
|
long _acceleration;
|
|
long _deceleration;
|
|
double _deg;
|
|
} AXIS;
|
|
struct s_axis_config // axis configuration
|
|
{
|
|
double _scale_resolution;
|
|
long _scale_range;
|
|
long _neg_working_limit;
|
|
long _pos_working_limit;
|
|
long _scale_count;
|
|
long _max_speed;
|
|
long _max_accel;
|
|
long _max_decel;
|
|
long _index_10;
|
|
long _index_03;
|
|
bool _bhomed;
|
|
};
|
|
struct s_zm_axis_config // zm configuration
|
|
{
|
|
int _mag_step; // number of steps
|
|
long _max_speed;
|
|
long _scale_count; // total scale count
|
|
long _neg_working_limit; // within the limits
|
|
long _pos_working_limit;
|
|
long _max_accel;
|
|
long _max_decel;
|
|
long _index_03;
|
|
long _index_10;
|
|
int _slack;
|
|
};
|
|
|
|
struct s_r_axis_config
|
|
{
|
|
double _scale_resolution;
|
|
long _scale_count; // total scale count
|
|
};
|
|
|
|
//--------------------------------------------------------------------
|
|
//
|
|
//--------------------------------------------------------------------
|
|
struct struct_machine
|
|
{ // g_machine structure
|
|
struct s_machine_config
|
|
{
|
|
wchar_t _str_servo_Id[16];
|
|
wchar_t _str_model[16];
|
|
wchar_t _str_model_nbr[16];
|
|
wchar_t _str_serial_no[16];
|
|
int _vector_light_model;
|
|
char _str_2b[64];
|
|
BYTE _str_bin_2b[64];
|
|
char _str_4c02_signature[64];
|
|
BYTE _str_bin_4c02[64];
|
|
char _str_6f00_signature[64];
|
|
BYTE _str_bin_6f00[64];
|
|
char _str_7000_signature[64];
|
|
BYTE _str_bin_7000[64];
|
|
int _usb_command_wait;
|
|
int _usb_command_timeout;
|
|
struct s_axis_config x_axis;
|
|
struct s_axis_config y_axis;
|
|
struct s_axis_config z_axis;
|
|
struct s_zm_axis_config zm_axis;
|
|
struct s_r_axis_config r1_axis;
|
|
struct s_r_axis_config r2_axis;
|
|
int _nbr_lamps;
|
|
double _dXYZSpeed; // this is not part of the MV original config data
|
|
} s_machine_config;
|
|
struct s_status
|
|
{
|
|
bool _homed;
|
|
bool _machine_running;
|
|
bool _poll_58_active;
|
|
bool _poll_59_active;
|
|
bool _poll_2b_active;
|
|
bool _bXMoving;
|
|
bool _bYMoving;
|
|
bool _bZMoving;
|
|
bool _bZMMoving;
|
|
bool _bXYZZMIdle;
|
|
} s_status;
|
|
union {
|
|
struct s_lights_300 // special data structure for 5x8 ring configuration
|
|
{
|
|
int _segment[FIVE_RINGS][EIGHT_SEGS];
|
|
int _bottom_light;
|
|
int _axial_light;
|
|
} s_lights_300;
|
|
struct s_lights_200 // special data structure for 2x8 ring configuration
|
|
{
|
|
int _segment[TWO_RINGS][EIGHT_SEGS];
|
|
int _bottom_light;
|
|
int _axial_light;
|
|
} s_lights_200;
|
|
};
|
|
long _hit_pos_x; // touch probe
|
|
long _hit_pos_y; // touch probe
|
|
struct s_axis x;
|
|
struct s_axis y;
|
|
struct s_axis z;
|
|
struct s_axis zm;
|
|
struct s_axis r1;
|
|
struct s_axis r2;
|
|
};
|
|
|
|
#define MICROVU_VID 0x0d26
|
|
#define MICROVU_PID 0x1001
|
|
|
|
//****************************************************************************************************
|
|
// Binary MicroVu command structure, out going
|
|
//
|
|
//****************************************************************************************************
|
|
#define pMV_CMD_01 ((s_MV_CMD_BUFF_01 *) ep_buff[EP_01_CMD_IDX]._buffer)
|
|
|
|
struct s_MV_CMD_BUFF_01
|
|
{
|
|
UCHAR uCmdByte;
|
|
//----------------------------------------------------------------------
|
|
// [endpoint 0x00000001] 00000060 : 530001010100fffe1d89ffff4d37fffebeee000000000000c34e0000021a0000003200000000000f423b000029fb0000138800000000003d08ee00030d4000030d40000000000000000000000000000000000000000000000000000000000000
|
|
// *Command : 53 Move To -- X Y Z ZM Scale-0123511 -0045769 -0082194 00000000
|
|
// *Speed : 00049998 00000538 00000050 00000000
|
|
// *Unk1 : 00999995 00010747 00005000 00000000
|
|
// *Unk2 : 03999982 00200000 00200000 00000000
|
|
union
|
|
{
|
|
struct
|
|
{
|
|
BYTE cmd0;
|
|
DWORD dAddr;
|
|
BYTE cmd1;
|
|
} S_MV_CMD_0x29;
|
|
struct
|
|
{
|
|
wchar_t servo_Id[16];
|
|
unsigned int unk_1[16];
|
|
} S_MV_CMD_0x2b;
|
|
struct
|
|
{
|
|
BYTE cmd0;
|
|
} S_MV_CMD_0x41;
|
|
struct
|
|
{
|
|
BYTE cmd0;
|
|
} S_MV_CMD_0x42;
|
|
struct
|
|
{
|
|
BYTE cmd0;
|
|
} S_MV_CMD_0x43;
|
|
struct
|
|
{
|
|
BYTE cmd0;
|
|
} S_MV_CMD_0x45;
|
|
struct
|
|
{
|
|
BYTE cmd0;
|
|
} S_MV_CMD_0x4E;
|
|
struct
|
|
{
|
|
BYTE cmd0;
|
|
BYTE cmd1;
|
|
} S_MV_CMD_0x4F;
|
|
struct
|
|
{
|
|
BYTE cmd0;
|
|
} S_MV_CMD_0x50;
|
|
struct
|
|
{
|
|
UCHAR uSubCmdByte;
|
|
UCHAR statusByte[4];
|
|
struct S_POS
|
|
{
|
|
LONG x;
|
|
LONG y;
|
|
LONG z;
|
|
LONG zm;
|
|
} S_POS;
|
|
struct S_SPEED
|
|
{
|
|
LONG x;
|
|
LONG y;
|
|
LONG z;
|
|
LONG zm;
|
|
}S_SPEED;
|
|
struct S_ACC
|
|
{
|
|
LONG x;
|
|
LONG y;
|
|
LONG z;
|
|
LONG zm;
|
|
}S_ACC;
|
|
struct S_DEC
|
|
{
|
|
LONG x;
|
|
LONG y;
|
|
LONG z;
|
|
LONG zm;
|
|
}S_DEC;
|
|
} S_MV_CMD_0x53;
|
|
struct // single axis move command
|
|
{
|
|
UCHAR uAxis;
|
|
UCHAR statusByte;
|
|
LONG lPosition;
|
|
LONG lSpeed;
|
|
LONG lAcc;
|
|
LONG lDecel;
|
|
} S_MV_CMD_0x4C;
|
|
struct // single axis move command
|
|
{
|
|
UCHAR uAxis;
|
|
LONG lR1_Pos;
|
|
LONG lR2_Pos;
|
|
LONG lX;
|
|
LONG lY;
|
|
LONG lZ;
|
|
} S_MV_CMD_0x4C10;
|
|
struct
|
|
{
|
|
BYTE cmd0;
|
|
BYTE cmd1;
|
|
} S_MV_CMD_0x59;
|
|
struct
|
|
{
|
|
BYTE cmd0;
|
|
} S_MV_CMD_0x69;
|
|
struct
|
|
{
|
|
UINT uSubCmdByte;
|
|
UINT segment[FIVE_RINGS][EIGHT_SEGS];
|
|
UINT bottom_light;
|
|
UINT axial_light;
|
|
} S_MV_CMD_300_0x6e;
|
|
struct
|
|
{
|
|
UINT uSubCmdByte;
|
|
UINT segment[TWO_RINGS][EIGHT_SEGS];
|
|
UINT bottom_light;
|
|
UINT axial_light;
|
|
} S_MV_CMD_200_0x6e;
|
|
struct
|
|
{
|
|
BYTE cmd0;
|
|
} S_MV_CMD_0x6F;
|
|
struct
|
|
{
|
|
BYTE cmd0;
|
|
} S_MV_CMD_0x76;
|
|
struct
|
|
{
|
|
BYTE cmd0;
|
|
} S_MV_CMD_0x7C;
|
|
};
|
|
};
|
|
|
|
//======================
|
|
typedef struct s_xyzzm
|
|
{
|
|
bool bFast;
|
|
long from;
|
|
long to;
|
|
long speed;
|
|
long acc;
|
|
long dec;
|
|
double dFromMM;
|
|
double dToMM;
|
|
} AXISMOVE;
|
|
#pragma pack(pop)
|
|
|
|
//======================
|
|
struct struct_ep_buff
|
|
{
|
|
int _ep;
|
|
BYTE _save_send_cmd;
|
|
BYTE _save_send_cmd0;
|
|
BYTE _save_send_cmd1;
|
|
char *_buffer; // MAX_BUFF_SIZE
|
|
int _size;
|
|
void *_async_context;
|
|
BOOL _hProtoPending;
|
|
HANDLE _event;
|
|
};
|
|
|
|
// CSettleStageParams and CSettleStage are copied from QVI, but QVI is based on millionths of and inch
|
|
// and we will use microns for MV
|
|
class CSettleStageParams
|
|
{
|
|
public:
|
|
CSettleStageParams()
|
|
{
|
|
EDGE_RETRY_TIMEOUT_X = 800;
|
|
EDGE_RETRY_TIMEOUT_Y = 800;
|
|
EDGE_RETRY_TIMEOUT_Z = 800;
|
|
EDGE_RETRY_TIMEOUT_MAG = 800;
|
|
EDGE_RETRY_BANDWIDTH_X = 1;
|
|
EDGE_RETRY_BANDWIDTH_Y = 1;
|
|
EDGE_RETRY_BANDWIDTH_Z = 1;
|
|
EDGE_RETRY_BANDWIDTH_MAG = 1;
|
|
EDGE_RETRY_COUNT_X = 1;
|
|
EDGE_RETRY_COUNT_Y = 1;
|
|
EDGE_RETRY_COUNT_Z = 1;
|
|
EDGE_RETRY_COUNT_MAG = 1;
|
|
};
|
|
|
|
long EDGE_RETRY_TIMEOUT_X; //300
|
|
long EDGE_RETRY_TIMEOUT_Y; //300
|
|
long EDGE_RETRY_TIMEOUT_Z; //300
|
|
long EDGE_RETRY_TIMEOUT_MAG; //300
|
|
long EDGE_RETRY_BANDWIDTH_X; //50
|
|
long EDGE_RETRY_BANDWIDTH_Y; //50
|
|
long EDGE_RETRY_BANDWIDTH_Z; //50
|
|
long EDGE_RETRY_BANDWIDTH_MAG; //50
|
|
long EDGE_RETRY_COUNT_X; //1
|
|
long EDGE_RETRY_COUNT_Y; //1
|
|
long EDGE_RETRY_COUNT_Z; //1
|
|
long EDGE_RETRY_COUNT_MAG; //1
|
|
};
|
|
|
|
class CSettleStage
|
|
{
|
|
public:
|
|
CSettleStage(long lAxis, double dStartTime, long lStart, long lDeadband, double dTestIncrSec, double dMaxTimeSec);
|
|
enum SETTLE_STATUS Test(double dCurTime, long lCurPos);
|
|
|
|
private:
|
|
double m_dStartTime;
|
|
long m_lStartPos;
|
|
long m_lDeadband;
|
|
double m_dTestIncrSec;
|
|
double m_dMaxTimeSec;
|
|
double m_dIncrStartTimeSec;
|
|
long m_lAxis;
|
|
};
|
|
|
|
//======================================================================================
|
|
class CMv_Proto
|
|
{
|
|
public:
|
|
// EP 01/81 channel threads.
|
|
static int g_hEP81_Thread_State;
|
|
static unsigned __stdcall g_EP81_Thread(LPVOID pThis);
|
|
static HANDLE g_hEP81_Thread_Id;
|
|
|
|
// EP 02/82 channel threads.
|
|
static int g_hEP82_Thread_State;
|
|
static unsigned __stdcall g_EP82_Thread(LPVOID pThis);
|
|
static HANDLE g_hEP82_Thread_Id;
|
|
//
|
|
// g_hEP01_Thread_Event is used to kick a command
|
|
//
|
|
static int g_hEP01_Thread_State;
|
|
static unsigned __stdcall g_EP01_Thread(LPVOID pThis);
|
|
static HANDLE g_hEP01_Thread_Id;
|
|
static HANDLE g_hEP01_Serial_Mutex; // EP01
|
|
//
|
|
static int g_hEP02_Thread_State;
|
|
static unsigned __stdcall g_EP02_Thread(LPVOID pThis);
|
|
static HANDLE g_hEP02_Thread_Id;
|
|
static HANDLE g_hEP02_Serial_Mutex; // EP02
|
|
|
|
static HANDLE g_hHomedEvent;
|
|
|
|
double ScaleToMM(long lCount, double dResolution);
|
|
long MMtoScale(double lDistanceMM, double dResolution);
|
|
static void Trace_EP_Buff(long lIndex);
|
|
|
|
static void _process_rcv_transfer_data(int iEP);
|
|
static SSI_STATUS _process_MV_CMD_SERVO_CMD_2B();
|
|
static SSI_STATUS _process_MV_CMD_2C();
|
|
static SSI_STATUS _process_MV_CMD_GET_SUB_CONFIG_28();
|
|
static SSI_STATUS _process_MV_CMD_GET_CONFIG_60();
|
|
static SSI_STATUS _process_MV_CMD_GET_CONFIG_69();
|
|
static SSI_STATUS _process_MV_CMD_SET_LIGHT_6E();
|
|
static SSI_STATUS _process_MV_CMD_GET_X_INDEX_41();
|
|
static SSI_STATUS _process_MV_CMD_GET_Y_INDEX_42();
|
|
static SSI_STATUS _process_MV_CMD_GET_MAG_43();
|
|
static SSI_STATUS _process_MV_CMD_GET_ZOOM_DECEL_45();
|
|
static SSI_STATUS _process_MV_CMD_GET_INDEX_4E();
|
|
static SSI_STATUS _process_MV_CMD_MAX_SPEED_50();
|
|
static SSI_STATUS _process_MV_CMD_MAX_ACCEL_51();
|
|
static SSI_STATUS _process_MV_CMD_GET_UNK_56();
|
|
static SSI_STATUS _process_MV_CMD_GET_SCALE_58();
|
|
static SSI_STATUS _process_MV_CMD_GET_POLL_59();
|
|
static SSI_STATUS _process_MV_CMD_GET_WORKING_LIMITS_5E();
|
|
static SSI_STATUS _process_MV_CMD_GET_LIGHT_CONFIG_70();
|
|
static SSI_STATUS _process_MV_CMD_MAX_DECEL_76();
|
|
static SSI_STATUS _process_MV_CMD_GET_SCALE_SLACK_7C();
|
|
static SSI_STATUS _process_MV_CMD_GET_FINE_SCALE();
|
|
|
|
// Global Structures
|
|
static struct_ep_buff ep_buff[lEPSIZE];
|
|
static struct_machine g_machine;
|
|
|
|
//
|
|
CMv_Proto();
|
|
virtual ~CMv_Proto();
|
|
SSI_STATUS Init_MvUsb();
|
|
SSI_STATUS Exit_MvUsb();
|
|
SSI_STATUS Load_MicroVu_Config();
|
|
SSI_STATUS GetAppPath(CString &Path);
|
|
SSI_STATUS ExtractAppPath(CString &Path);
|
|
|
|
static double TimeInSecs(void);
|
|
static CLogger* g_pLogger;
|
|
static usb_dev_handle *g_dev;
|
|
bool m_bHomingActive;
|
|
|
|
usb_dev_handle* _open_usb_dev(void);
|
|
SSI_STATUS _start_machine();
|
|
SSI_STATUS _shutdown_machine();
|
|
SSI_STATUS _do_single_threaded_usb_comm(int iEP);
|
|
SSI_STATUS _poll_machine_2b();
|
|
SSI_STATUS _poll_machine_58();
|
|
SSI_STATUS _poll_machine_59();
|
|
|
|
SSI_STATUS _submit_async_8x(int iEP_Base);
|
|
SSI_STATUS _reap_async_8x(int iEP_Base);
|
|
SSI_STATUS _send_usb_data(int iEP_Base);
|
|
|
|
SSI_STATUS _get_config();
|
|
SSI_STATUS _get_xyz_index();
|
|
SSI_STATUS _replay_capture(CString cFileName);
|
|
SSI_STATUS _process_replay_capture_commands(char *inBuff, FILE* pInFile);
|
|
static void _swap_byte(unsigned short &Val);
|
|
static void _reverse_dword(DWORD *);
|
|
static void _scale2inch(unsigned long scale, double &inch);
|
|
static void _inch2scale(unsigned long &scale, double inch);
|
|
static long _4char2long(unsigned char *cBuff);
|
|
static void _char2bin(unsigned char *cBuff, BYTE *cBytes, int len);
|
|
SSI_STATUS _calculate_straightline_motion(AXISMOVE &X, AXISMOVE &Y, AXISMOVE &Z, double dSpeedMM);
|
|
SSI_STATUS WaitForSettleXYZZM();
|
|
void mv_set_full_ringlight_data(long lIntensity);
|
|
void mv_set_ringlight_data(long lMaxSize, double *pSegments);
|
|
|
|
SSI_STATUS _set_position_xyz(AXISMOVE &X, AXISMOVE &Y, AXISMOVE &Z);
|
|
//
|
|
// Motion Related
|
|
//
|
|
SSI_STATUS mv_motion_is_supported();
|
|
SSI_STATUS mv_motion_startup(double x_scale_resolution, double y_scale_resolution, double z_scale_resolution);
|
|
SSI_STATUS mv_motion_get_axis_count(int &iCount);
|
|
SSI_STATUS mv_motion_set_speed_xyz(double dSpeed);
|
|
SSI_STATUS mv_motion_get_speed_xyz(double &dSpeed);
|
|
SSI_STATUS mv_motion_set_speed_r(long r_speed);
|
|
SSI_STATUS mv_motion_get_settle_time();
|
|
SSI_STATUS mv_motion_get_deadband();
|
|
SSI_STATUS mv_motion_get_refresh_deadband();
|
|
SSI_STATUS mv_motion_get_position_xyz(double &_dX, double &_dY, double &_dZ);
|
|
SSI_STATUS mv_motion_set_position_xyz(double dX, double dY, double dZ, bool bWait);
|
|
SSI_STATUS mv_motion_get_position_r(double &dPositionR);
|
|
SSI_STATUS mv_motion_set_position_r(double dPositionR);
|
|
SSI_STATUS mv_motion_store_position_xyz();
|
|
SSI_STATUS mv_motion_get_stored_positions_xyz();
|
|
SSI_STATUS mv_motion_is_axis_moving();
|
|
bool mv_motion_is_homed();
|
|
SSI_STATUS mv_motion_set_stage_limits();
|
|
SSI_STATUS mv_motion_get_stage_limits();
|
|
SSI_STATUS mv_motion_dcc_scan_start();
|
|
SSI_STATUS mv_motion_dcc_scan_get_data_size();
|
|
SSI_STATUS mv_motion_dcc_scan_get_data();
|
|
SSI_STATUS mv_motion_Dcc_Home();
|
|
SSI_STATUS mv_motion_shut_down();
|
|
SSI_STATUS mv_motion_fly_mode_cancel();
|
|
SSI_STATUS mv_motion_get_axes_max_speed(double &dMaxSpeedX, double &dMaxSpeedY, double &dMaxSpeedZ);
|
|
SSI_STATUS mv_motion_get_3D_max_speed(double &dMaxSpeed);
|
|
SSI_STATUS mv_motion_get_position_meas_point();
|
|
//
|
|
SSI_STATUS mv_optics_is_supported();
|
|
SSI_STATUS mv_optics_start_up();
|
|
SSI_STATUS mv_optics_get_magnification_steps(int& iSteps);
|
|
SSI_STATUS mv_optics_get_numeric_aperture();
|
|
SSI_STATUS mv_optics_get_magnification(int& iStep);
|
|
SSI_STATUS mv_optics_set_magnification(int iStep);
|
|
SSI_STATUS mv_optics_get_deadband();
|
|
SSI_STATUS mv_optics_get_scale_range(long &neg_scale_range, long &pos_scale_range);
|
|
SSI_STATUS mv_optics_get_scale_position(long &lScale);
|
|
SSI_STATUS mv_optics_set_scale_position(const long lScale);
|
|
SSI_STATUS mv_optics_refresh_lens();
|
|
SSI_STATUS mv_optics_enable_grid();
|
|
SSI_STATUS mv_optics_is_grid_enabled();
|
|
SSI_STATUS mv_optics_enable_laser();
|
|
SSI_STATUS mv_optics_is_laser_enabled();
|
|
SSI_STATUS mv_optics_shut_down();
|
|
SSI_STATUS mv_light_is_supported(BOOL &bTrue);
|
|
SSI_STATUS mv_light_start_up();
|
|
SSI_STATUS mv_light_get_lamp_count(int& iCount);
|
|
SSI_STATUS mv_light_get_lamp_info();
|
|
SSI_STATUS mv_light_set_lamp_state(double dBottomPercent, double dTopPercent);
|
|
SSI_STATUS mv_light_shut_down();
|
|
SSI_STATUS mv_light_set_light();
|
|
SSI_STATUS mv_light_set_light_off();
|
|
|
|
SSI_STATUS mv_pendant_enable(BOOL bTrue);
|
|
|
|
SSI_STATUS _send_cmd_MV_CMD_GET_POS_XYZ_00_02();
|
|
SSI_STATUS _send_cmd_MV_CMD_SET_POS_XYZ_00_03();
|
|
SSI_STATUS _send_cmd_MV_CMD_GET_POS_R_00_04();
|
|
SSI_STATUS _send_cmd_MV_CMD_SET_POS_R_00_05();
|
|
SSI_STATUS _send_cmd_MV_CMD_SET_ZOOM_00_06();
|
|
SSI_STATUS _send_cmd_MV_CMD_GET_ZOOM_00_07();
|
|
SSI_STATUS _send_cmd_MV_CMD_GET_STARUP_CONFIG_00();
|
|
SSI_STATUS _send_cmd_MV_CMD_GET_SUB_CONFIG_28();
|
|
SSI_STATUS _send_cmd_MV_CMD_GET_SUB_CONFIG_29(BYTE cmd0, DWORD addr, BYTE cmd1);
|
|
SSI_STATUS _send_cmd_MV_CMD_SERVO_CMD_2B();
|
|
SSI_STATUS _send_cmd_MV_CMD_START_MACHINE_2C(BYTE cmd0);
|
|
SSI_STATUS _send_cmd_MV_CMD_GET_UNK_31();
|
|
SSI_STATUS _send_cmd_MV_CMD_GET_UNK_32();
|
|
SSI_STATUS _send_cmd_MV_CMD_GET_UNK_34();
|
|
SSI_STATUS _send_cmd_MV_CMD_GET_UNK_35();
|
|
SSI_STATUS _send_cmd_MV_CMD_GET_UNK_3C();
|
|
SSI_STATUS _send_cmd_MV_CMD_GET_X_INDEX_41(BYTE cmd0);
|
|
SSI_STATUS _send_cmd_MV_CMD_GET_Y_INDEX_42(BYTE cmd0);
|
|
SSI_STATUS _send_cmd_MV_CMD_GET_MAG_43(BYTE cmd0);
|
|
SSI_STATUS _send_cmd_MV_CMD_GET_ZOOM_DECEL_45(BYTE cmd0);
|
|
SSI_STATUS _send_cmd_MV_CMD_MOVE_AXIS_4C(BYTE Axis, long lDestination, BYTE lStatusByte);
|
|
SSI_STATUS _send_cmd_PRE_ROTARY();
|
|
SSI_STATUS _send_cmd_MV_CMD_MOVE_AXIS_4C10(long lCount);
|
|
SSI_STATUS _send_cmd_MV_CMD_SET_JOYSTICK_MODE_47(BOOL bTrue);
|
|
SSI_STATUS _send_cmd_MV_CMD_GET_INDEX_4E(BYTE cmd0, BYTE send_len, BYTE recv_len);
|
|
SSI_STATUS _send_cmd_MV_CMD_SEEK_INDEX_4F(BYTE cmd0, BYTE cmd1);
|
|
SSI_STATUS _send_cmd_MV_CMD_MAX_SPEED_50(BYTE cmd0, BYTE send_len, BYTE recv_len);
|
|
SSI_STATUS _send_cmd_MV_CMD_MAX_ACCEL_51(BYTE cmd0, BYTE send_len, BYTE recv_len);
|
|
SSI_STATUS _send_cmd_MV_CMD_MOVE_TO_53();
|
|
SSI_STATUS _send_cmd_MV_CMD_GET_STAGE_RANGE_56();
|
|
SSI_STATUS _send_cmd_MV_CMD_GET_SCALE_58(long &lX, long &lY, long &lZ);
|
|
SSI_STATUS _send_cmd_MV_CMD_GET_POLL_59(long &lX, long &lY, long &lZ, long &lZM);
|
|
SSI_STATUS _send_cmd_MV_CMD_GET_WORKING_LIMITS_5E();
|
|
SSI_STATUS _send_cmd_MV_CMD_GET_CONFIG_60();
|
|
SSI_STATUS _send_cmd_MV_CMD_GET_RAW_SCALE_63();
|
|
SSI_STATUS _send_cmd_MV_CMD_GET_CONFIG_69(BYTE cmd0);
|
|
SSI_STATUS _send_cmd_MV_CMD_GET_UNK_6A();
|
|
SSI_STATUS _send_cmd_MV_CMD_SET_LIGHT_6E();
|
|
SSI_STATUS _send_cmd_MV_CMD_GET_MACHINE_SIGNATURE_6F(BYTE cmd0);
|
|
SSI_STATUS _send_cmd_MV_CMD_GET_LIGHT_CONFIG_70();
|
|
SSI_STATUS _send_cmd_MV_CMD_GET_UNK_71();
|
|
SSI_STATUS _send_cmd_MV_CMD_GET_UNK_74();
|
|
SSI_STATUS _send_cmd_MV_CMD_GET_UNK_75();
|
|
SSI_STATUS _send_cmd_MV_CMD_MAX_DECEL_76(BYTE cmd0, BYTE send_len, BYTE recv_len);
|
|
SSI_STATUS _send_cmd_MV_CMD_GET_SCALE_SLACK_7C(BYTE cmd0);
|
|
SSI_STATUS _send_cmd_MV_CMD_GET_FINE_SCALE(long &lX, long &lY, long &lZ, long &lZM);
|
|
};
|
|
|
|
#endif
|
|
// !defined(AFX_DataLink_H__B422904C_2CEB_495B_B7BD_B45AB30286DD__INCLUDED_)
|