⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 esp6000.h

📁 NewPort ESP6000多轴平控制器控制范例
💻 H
字号:
/************************************************************************;
;* FILE: esp6000.h    													*;
;* Author: Glenn Stevenson												*;
;* Date: June 7, 1997   												*;
;* 																		*;
;* Description: Defines and prototypes for use with esp6000.dll   		*;
;*				    													*;
;*			  		 													*;
;*																		*;
;*    Revsions															*;
;*     [1.0 GS @ Newport  6/7/97 Initial ]								*;
;*		 [1.1 GS @ Newport  1/14/98 Added new prototypes and constants] *;
;*		 [1.2 GS @ Newport  6/17/98 Added new prototypes ] 				*;
;*																		*;
;*																		*;
;*																		*;
;************************************************************************/
#include <windows.h>


//ESP6000 Return values
#define ESPOK         0
#define ESPERROR     -1
#define ESPDONE       1
#define ESPNOTDONE    0


// Motion / Trajectory Modes
#define TRAPEZOID     3
#define TRAPSTEP      4
#define SCURVE        5
#define SLAVEP        6
#define SLAVET        7
#define JOG           8
#define TRACKJOG     28

 
// Motor Types
#define UNDEFINED     0
#define DCSERVO       1
#define STEPPER       2  

// Digital I/O
#define PORT_INPUT    0
#define PORT_OUTPUT   1

// Analog I/O
#define UNIPOLAR      1
#define BIPOLAR       0

// DAC Gains
#define V1_25         3
#define V2_5          2
#define V5            1
#define V10           0
  

// Home Modes
#define HOMEONLY      0
#define HOMEINDEX     1

// The following is for the user units conversion
#define ENCODER_COUNT   0
#define MOTOR_STEP      1
#define MILLIMETER      2 
#define MICROMETER      3
#define INCHES          4
#define MILLI_INCHES    5
#define MICRO_INCHES    6
#define DEGREE          7
#define GRADIAN         8
#define RADIAN          9
#define MILLIRADIAN     10
#define MICRORADIAN     11


// Prototypes 

#ifdef __cplusplus
extern "C"  {
#endif	 
// Initialization  
 int _stdcall esp_init_system(void);
 int _stdcall esp_open_system(void);
 int _stdcall esp_update_unidrive(long Axis);
 int _stdcall esp_running_nt(void);
 int _stdcall esp_get_num_boards(int *Boards, int *BdsUsed);

//configuration
 int _stdcall esp_set_motor_type(long Axis, long mtype);
 int _stdcall esp_get_motor_type(long Axis, long *mtype);
 int _stdcall esp_get_sys_config(long *DevStatus);
 int _stdcall esp_get_sys_fault_config(long *config);
 int _stdcall esp_set_sys_fault_config(long config);
 int _stdcall esp_set_target_board(int target);
 int _stdcall esp_get_followerr_config(long Axis,long *config);
 int _stdcall esp_set_followerr_config(long Axis,long config);
 int _stdcall esp_get_hardlimit_config(long Axis,long *config);
 int _stdcall esp_set_hardlimit_config(long Axis,long config);
 int _stdcall esp_get_softlimit_config(long Axis,long *config);
 int _stdcall esp_set_softlimit_config(long Axis,long config);
 int _stdcall esp_get_ampio_config(long Axis,long *config);
 int _stdcall esp_set_ampio_config(long Axis,long config);
 int _stdcall esp_get_feedback_config(long Axis,long *config);
 int _stdcall esp_set_feedback_config(long Axis,long config);
 int _stdcall esp_set_e_stop_config(long Axis, long config);
 int _stdcall esp_get_e_stop_config(long Axis, long *config);
 int _stdcall esp_set_dac_offset(long Axis, float offset);
 int _stdcall esp_get_dac_offset(long Axis, float *offset);
 int _stdcall esp_save_parameters(void);
 int _stdcall esp_save_setup(char *Path);
 int _stdcall esp_get_hardware_status(long *hardstat1,long  *hardstat2);
 int _stdcall esp_restore_setup(char *Path);

// Motion
 int _stdcall esp_move_absolute(long Axis, double Position);
 int _stdcall esp_delay(float time);
 int _stdcall esp_delay_after_stop(long Axis, float time); 
 int _stdcall esp_move_relative(long Axis, double Position);
 int _stdcall esp_find_home(long axis, long mode);
 int _stdcall esp_move_done(long axis);
 int _stdcall esp_home_done(long axis);
 int _stdcall esp_get_motion_status(long *mstat);
 int _stdcall esp_stop(long Axis);
 int _stdcall esp_stop_all(void);
 int _stdcall esp_find_limit(long Axis, long Direction);
 BOOLEAN _stdcall esp_limit_done(long Axis);
 int _stdcall esp_find_index(long axis, long Direction);
 BOOLEAN _stdcall esp_index_done(long axis);

// Trajectory
 int _stdcall esp_set_traj_mode(long Axis, long mode);
 int _stdcall esp_get_traj_mode(long Axis, long *mode);
 int _stdcall esp_set_speed(long Axis,float speed);
 int _stdcall esp_get_speed(long Axis,float *speed);
 int _stdcall esp_set_max_speed(long Axis,float speed);
 int _stdcall esp_get_max_speed(long Axis,float *speed);
 int _stdcall esp_set_accel(long Axis,float accel);
 int _stdcall esp_get_accel(long Axis,float *accel);
 int _stdcall esp_set_decel(long Axis,float decel);
 int _stdcall esp_get_decel(long Axis,float *decel);
 int _stdcall esp_set_max_accel(long Axis,float accel);
 int _stdcall esp_get_max_accel(long Axis,float *accel);
 int _stdcall esp_set_jerk(long Axis,float jerk);
 int _stdcall esp_get_jerk(long Axis,float *jerk);
 int _stdcall esp_set_home_speed(long axis, float speed);
 int _stdcall esp_get_home_speed(long axis, float *speed);
 int _stdcall esp_set_startstop_speed(long Axis, float speed);
 int _stdcall esp_get_startstop_speed(long Axis, float *speed);
 int _stdcall esp_set_jog_speed(long Axis, float speed);
 int _stdcall esp_get_jog_speed(long Axis, float *speed);
 int _stdcall esp_set_estop_decel(long axis, float decel);
 int _stdcall esp_get_estop_decel(long axis, float *decel);

 // Motion Related
 int _stdcall esp_enable_motor(long Axis);
 int _stdcall esp_disable_motor(long Axis);
 int _stdcall esp_get_motor_onoff_status(long *onoff);
 int _stdcall esp_update_filter(void);
 int _stdcall esp_get_master_slave(long *master, long slave);
 int _stdcall esp_set_master_slave(long master, long slave);
 int _stdcall esp_set_master_slave_ratio(long slave, float ratio);
 int _stdcall esp_get_master_slave_ratio(long slave, float *ratio);
 int _stdcall esp_set_resolution(long Axis, float resolution, long units);
 int _stdcall esp_get_resolution(long Axis,float *resolution, long *units);
 int _stdcall esp_set_soft_limits(long axis, double neg, double pos);
 int _stdcall esp_get_soft_limits(long axis, double *neg, double *pos);
 int _stdcall esp_set_following_error(long Axis,double error);
 int _stdcall esp_get_following_error(long Axis,double *error);
 int _stdcall esp_set_position(long Axis, double Position);
 int _stdcall esp_get_position(long Axis, double *Position);
 int _stdcall esp_set_microstep_factor(long axis, long resolution);
 int _stdcall esp_get_microstep_factor(long axis, long *resolution);
 int _stdcall esp_set_fullstep_resolution(long axis, float fullstep);
 int _stdcall esp_get_fullstep_resolution(long axis, float *fullstep);
 int _stdcall esp_set_motor_current(long Axis,float Current);
 int _stdcall esp_get_motor_current(long Axis,float *Current);
 int _stdcall esp_get_encoder_count(long Axis, long *count);
 int _stdcall esp_set_encoder_count(long Axis, long count);
 int _stdcall esp_set_tachometer_constant(long axis, float tach);
 int _stdcall esp_get_tachometer_constant(long axis, float *tach);
 int _stdcall esp_set_gear_constant(long axis, float gear);
 int _stdcall esp_get_gear_constant(long axis, float *gear);
 int _stdcall esp_get_desired_count(long Axis, long *count);
 int _stdcall esp_set_desired_count(long Axis, long count);
 int _stdcall esp_set_motor_voltage(long Axis,float voltage);
 int _stdcall esp_get_motor_voltage(long Axis,float *voltage);
 int _stdcall esp_get_inst_desired_vel(long Axis, float *velocity);
 int _stdcall esp_get_inst_following_error(long Axis, float *error);
 int _stdcall esp_set_trackball_interval(long interval);
 int _stdcall esp_get_trackball_interval(long *interval);
 int _stdcall esp_set_trackball_velocity_constants(float val1, float val2);
 int _stdcall esp_get_trackball_velocity_constants(float *val1, float *val2);
 int _stdcall esp_set_joystick_enable(long axis, long state);
 int _stdcall esp_get_joystick_enable(long axis, long *state);
 int _stdcall esp_set_joystick_digital_input(long axis, long negBit, long posBit);
 int _stdcall esp_get_joystick_digital_input(long axis, long *negBit, long *posBit);
 int _stdcall esp_set_velocity_interval(long axis, long interval);
 int _stdcall esp_get_velocity_interval(long axis, long *interval);
 int _stdcall esp_get_real_velocity(long axis, long *velocity);

//Servo
 int _stdcall esp_set_kp(long Axis, float kp);
 int _stdcall esp_get_kp(long Axis, float *kp);
 int _stdcall esp_set_ki(long Axis, float ki);
 int _stdcall esp_set_kd(long Axis, float kd);
 int _stdcall esp_get_kd(long Axis, float *kd);
 int _stdcall esp_set_il(long Axis, float il);
 int _stdcall esp_get_il(long Axis, float *il);
 int _stdcall esp_set_vel_feedforward(long Axis,float vff);
 int _stdcall esp_get_vel_feedforward(long Axis,float *vff);
 int _stdcall esp_set_acc_feedforward(long Axis,float aff);
 int _stdcall esp_get_acc_feedforward(long Axis,float *aff);
 int _stdcall esp_get_instant_target(long axis, double *position);
 int _stdcall esp_get_instant_velocity(long Axis, float *velocity);
 int _stdcall esp_get_instant_accel(long Axis, float *accel);
 int _stdcall esp_get_instant_error(long Axis, float *error);

// Data Acquisition
 int _stdcall esp_set_adc_gain(long gain);
 int _stdcall esp_get_adc_gain(long *gain);
 int _stdcall esp_set_adc_range(long range);
 int _stdcall esp_get_adc_range(long *range);
 int _stdcall esp_get_adc(long channel, float *conversion,long *TickCnt );
 int _stdcall esp_get_all_adc(float *channel,long *TickCnt );
 int _stdcall esp_set_daq_mode(long Mode, long Axis, long Adcs,long Feedback,long Rate, long Num);
 int _stdcall esp_get_daq_status(long *count);
 int _stdcall esp_daq_done(void);
 int _stdcall esp_get_daq_data(long *DataArray, long *Num, long *DaqStat);
 int _stdcall esp_enable_daq(void);
 int _stdcall esp_disable_daq(void);

// Digital I/O
 int _stdcall esp_set_portabc_dir(long PortA, long PortB, long PortC);
 int _stdcall esp_get_portabc_dir(long *PortA, long *PortB, long *PortC);
 int _stdcall esp_set_dio_porta(long Data);
 int _stdcall esp_get_dio_porta(long *Data);
 int _stdcall esp_set_dio_portb(long Data);
 int _stdcall esp_get_dio_portb(long *Data);
 int _stdcall esp_set_dio_portc(long Data);
 int _stdcall esp_get_dio_portc(long *Data);
 int _stdcall esp_set_dio_inhibit(long Axis, long State);
 int _stdcall esp_get_dio_inhibit(long Axis, long *State);
 int _stdcall esp_set_dio_inhibit_cfg(long Axis, long BitNum, long Level);
 int _stdcall esp_get_dio_inhibit_cfg(long Axis, long *BitNum, long *Level);
 int _stdcall esp_set_dio_motion(long Axis, long State);
 int _stdcall esp_get_dio_motion(long Axis, long *State);
 int _stdcall esp_set_dio_motion_cfg(long Axis, long BitNum, long Level);
 int _stdcall esp_get_dio_motion_cfg(long Axis, long *BitNum, long *Level);

// System
 int _stdcall esp_get_error_num(int *error, int *ServoTick);
 int _stdcall esp_get_error_string(char *ErrorString, long *error, long *ServoTick);
 int _stdcall esp_get_version(char *FirmVer, char *DllVer);
 int _stdcall esp_send_ascii(LPSTR String);
 int _stdcall esp_read_ascii(char *String);
 int _stdcall esp_send_read_ascii(char *Command, char *Response);
 int _stdcall esp_restore_smart_stage_defaults(long Axis);

 int _stdcall esp_daq_data_to_file (char *Name, long Mode);
 int DLL_host_interrupt_disable(long  target); 
 int DLL_host_interrupt_enable(long  target); 

#ifdef __cplusplus
}
#endif














⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -