/****************************************************************************/
/*  Copyright (c) 1995-2004, ADLink Technology Inc.  All rights reserved.   */
/*                                                                          */
/*  File Name   :   HSL_Motion.H                                            */
/*  Purpose     :   Header file for HSL_Motion.C module                     */
/*  Date        :   09/07/2004                                              */
/*  Revision    :   0.91                                                    */
/*  Programmer  :   Gilbert Yen	                                            */
/****************************************************************************/

#ifndef HSL_MOTION_H
#define HSL_MOTION_H

#ifdef __cplusplus
extern "C" {
#endif

#include "type_def.h"

#define HSL_WINDOWS
//#define HSL_LINUX
//#define HSL_RTX

#if defined ( HSL_WINDOWS ) || defined ( HSL_RTX )
	#define FNTYPE _stdcall
#elif defined ( HSL_LINUX )
	#define FNTYPE
#endif

/****************************************************************************/
/*      Function  Declerations                                              */
/****************************************************************************/

I16 FNTYPE HSL_M_get_version(I16 card_ID, I16 connect_index, I16 M_No, U8 *CPLD_Ver, U32 *Kernel_Ver, U32 *Software_Ver);

// Pulse I/O Configuration
I16 FNTYPE HSL_M_set_pls_outmode(I16 card_ID, I16 connect_index, I16 AxisNo, I16 pls_outmode);
I16 FNTYPE HSL_M_set_pls_iptmode(I16 card_ID, I16 connect_index, I16 AxisNo, I16 pls_iptmode, I16 pls_logic);
I16 FNTYPE HSL_M_set_feedback_src(I16 card_ID, I16 connect_index, I16 AxisNo, I16 Src);

// Velocity Mode motion
I16 FNTYPE HSL_M_tv_move(I16 card_ID, I16 connect_index, I16 AxisNo, F64 StrVel, F64 MaxVel, F64 Tacc);
I16 FNTYPE HSL_M_sv_move(I16 card_ID, I16 connect_index, I16 AxisNo, F64 StrVel, F64 MaxVel, F64 Tacc, F64 SVacc);
I16 FNTYPE HSL_M_v_change(I16 card_ID, I16 connect_index, I16 AxisNo, F64 NewVel, F64 Tacc);
I16 FNTYPE HSL_M_sd_stop(I16 card_ID, I16 connect_index, I16 AxisNo, F64 Tdec);
I16 FNTYPE HSL_M_emg_stop(I16 card_ID, I16 connect_index, I16 AxisNo);
I16 FNTYPE HSL_M_fix_speed_range(I16 card_ID, I16 connect_index, I16 AxisNo, F64 MaxVel);
I16 FNTYPE HSL_M_unfix_speed_range(I16 card_ID, I16 connect_index, I16 AxisNo);
I16 FNTYPE HSL_M_get_current_speed(I16 card_ID, I16 connect_index, I16 AxisNo, F64 *speed);
I16 FNTYPE HSL_M_verify_speed(I16 card_ID, I16 connect_index, I16 M_No, F64 StrVel, F64 MaxVel, F64 *minAccTime, F64 *maxAccT, F64 MaxSpeed);

// Single Axis Motion
I16 FNTYPE HSL_M_start_tr_move(I16 card_ID, I16 connect_index, I16 AxisNo, F64 Dist, F64 StrVel, F64 MaxVel, F64 Tacc, F64 Tdec);
I16 FNTYPE HSL_M_start_ta_move(I16 card_ID, I16 connect_index, I16 AxisNo, F64 Pos, F64 StrVel, F64 MaxVel, F64 Tacc, F64 Tdec);
I16 FNTYPE HSL_M_start_sr_move(I16 card_ID, I16 connect_index, I16 AxisNo, F64 Dist, F64 StrVel, F64 MaxVel, F64 Tacc, F64 Tdec, F64 SVacc, F64 SVdec);
I16 FNTYPE HSL_M_start_sa_move(I16 card_ID, I16 connect_index, I16 AxisNo, F64 Pos, F64 StrVel, F64 MaxVel, F64 Tacc, F64 Tdec, F64 SVacc, F64 SVdec);
I16 FNTYPE HSL_M_set_move_ratio(I16 card_ID, I16 connect_index, I16 AxisNo, F64 move_ratio);
I16 FNTYPE HSL_M_get_move_ratio(I16 card_ID, I16 connect_index, I16 AxisNo, F64 *move_ratio);
I16 FNTYPE HSL_M_p_change(I16 card_ID, I16 connect_index, I16 AxisNo, F64 NewPos);
I16 FNTYPE HSL_M_backlash_comp(I16 card_ID, I16 connect_index, I16 AxisNo, I16 BCompPulse, I16 Mode);
I16 FNTYPE HSL_M_suppress_vibration(I16 card_ID, I16 connect_index, I16 AxisNo, U16 T1, U16 T2);
I16 FNTYPE HSL_M_set_idle_pulse(I16 card_ID, I16 connect_index, I16 AxisNo, I16 idl_pulse);
I16 FNTYPE HSL_M_set_fa_speed(I16 card_ID, I16 connect_index, I16 AxisNo, F64 FA_Speed);

// Point Table
I16 FNTYPE HSL_M_set_point_data(I16 card_ID, I16 connect_index, I16 Dimension, I16 *AxisArray, I16 point_index, I16 cmd_func, F64 *DistArray, F64 MaxVel);
I16 FNTYPE HSL_M_set_arc_data(I16 card_ID, I16 connect_index, I16 *AxisArray, I16 point_index, I16 cmd_func, F64 *CenterArray, F64 *EndArray, I16 DIR, F64 MaxVel);
I16 FNTYPE HSL_M_move_point_range(I16 card_ID, I16 connect_index, I16 Dimension, I16 *AxisArray, I16 start_index, I16 last_index);
I16 FNTYPE HSL_M_move_point_table(I16 card_ID, I16 connect_index, I16 Dimension, I16 *AxisArray, I16 *PointArray, I16 total_points);

// Linear Interpolated Motion
I16 FNTYPE HSL_M_start_tr_move_xy(I16 card_ID, I16 connect_index, I16 M_No, F64 DistX, F64 DistY, F64 StrVel, F64 MaxVel, F64 Tacc, F64 Tdec);
I16 FNTYPE HSL_M_start_ta_move_xy(I16 card_ID, I16 connect_index, I16 M_No, F64 PosX, F64 PosY, F64 StrVel, F64 MaxVel, F64 Tacc, F64 Tdec);
I16 FNTYPE HSL_M_start_sr_move_xy(I16 card_ID, I16 connect_index, I16 M_No, F64 DistX, F64 DistY, F64 StrVel, F64 MaxVel, F64 Tacc, F64 Tdec, F64 SVacc, F64 SVdec);
I16 FNTYPE HSL_M_start_sa_move_xy(I16 card_ID, I16 connect_index, I16 M_No, F64 PosX, F64 PosY, F64 StrVel, F64 MaxVel, F64 Tacc, F64 Tdec, F64 SVacc, F64 SVdec);
I16 FNTYPE HSL_M_start_tr_move_zu(I16 card_ID, I16 connect_index, I16 M_No, F64 DistX, F64 DistY, F64 StrVel, F64 MaxVel, F64 Tacc, F64 Tdec);
I16 FNTYPE HSL_M_start_ta_move_zu(I16 card_ID, I16 connect_index, I16 M_No, F64 PosX, F64 PosY, F64 StrVel, F64 MaxVel, F64 Tacc, F64 Tdec);
I16 FNTYPE HSL_M_start_sr_move_zu(I16 card_ID, I16 connect_index, I16 M_No, F64 DistX, F64 DistY, F64 StrVel, F64 MaxVel, F64 Tacc, F64 Tdec, F64 SVacc, F64 SVdec);
I16 FNTYPE HSL_M_start_sa_move_zu(I16 card_ID, I16 connect_index, I16 M_No, F64 PosX, F64 PosY, F64 StrVel, F64 MaxVel, F64 Tacc, F64 Tdec, F64 SVacc, F64 SVdec);
I16 FNTYPE HSL_M_start_tr_line2(I16 card_ID, I16 connect_index, I16 *AxisArray, F64 DistX, F64 DistY, F64 StrVel, F64 MaxVel, F64 Tacc, F64 Tdec);
I16 FNTYPE HSL_M_start_ta_line2(I16 card_ID, I16 connect_index, I16 *AxisArray, F64 PosX, F64 PosY, F64 StrVel, F64 MaxVel, F64 Tacc, F64 Tdec);
I16 FNTYPE HSL_M_start_sr_line2(I16 card_ID, I16 connect_index, I16 *AxisArray, F64 DistX, F64 DistY, F64 StrVel, F64 MaxVel, F64 Tacc, F64 Tdec, F64 SVacc, F64 SVdec);
I16 FNTYPE HSL_M_start_sa_line2(I16 card_ID, I16 connect_index, I16 *AxisArray, F64 PosX, F64 PosY, F64 StrVel, F64 MaxVel, F64 Tacc, F64 Tdec, F64 SVacc, F64 SVdec);
I16 FNTYPE HSL_M_start_tr_line3(I16 card_ID, I16 connect_index, I16 *AxisArray, F64 DistX, F64 DistY, F64 DistZ, F64 StrVel, F64 MaxVel, F64 Tacc, F64 Tdec);
I16 FNTYPE HSL_M_start_ta_line3(I16 card_ID, I16 connect_index, I16 *AxisArray, F64 PosX, F64 PosY, F64 PosZ, F64 StrVel, F64 MaxVel, F64 Tacc, F64 Tdec);
I16 FNTYPE HSL_M_start_sr_line3(I16 card_ID, I16 connect_index, I16 *AxisArray, F64 DistX, F64 DistY, F64 DistZ, F64 StrVel, F64 MaxVel, F64 Tacc, F64 Tdec, F64 SVacc, F64 SVdec);
I16 FNTYPE HSL_M_start_sa_line3(I16 card_ID, I16 connect_index, I16 *AxisArray, F64 PosX, F64 PosY, F64 PosZ, F64 StrVel, F64 MaxVel, F64 Tacc, F64 Tdec, F64 SVacc, F64 SVdec);
I16 FNTYPE HSL_M_start_tr_line4(I16 card_ID, I16 connect_index, I16 M_No, F64 DistX, F64 DistY, F64 DistZ, F64 DistU, F64 StrVel, F64 MaxVel, F64 Tacc, F64 Tdec);
I16 FNTYPE HSL_M_start_ta_line4(I16 card_ID, I16 connect_index, I16 M_No, F64 PosX, F64 PosY, F64 PosZ, F64 PosU, F64 StrVel, F64 MaxVel, F64 Tacc, F64 Tdec);
I16 FNTYPE HSL_M_start_sr_line4(I16 card_ID, I16 connect_index, I16 M_No, F64 DistX, F64 DistY, F64 DistZ, F64 DistU, F64 StrVel, F64 MaxVel, F64 Tacc, F64 Tdec, F64 SVacc, F64 SVdec);
I16 FNTYPE HSL_M_start_sa_line4(I16 card_ID, I16 connect_index, I16 M_No, F64 PosX, F64 PosY, F64 PosZ, F64 PosU, F64 StrVel, F64 MaxVel, F64 Tacc, F64 Tdec, F64 SVacc, F64 SVdec);

// Circular Interpolation Motion
I16 FNTYPE HSL_M_start_r_arc_xy(I16 card_ID, I16 connect_index, I16 M_No, F64 OffsetCx, F64 OffsetCy, F64 OffsetEx, F64 OffsetEy, I16 DIR, F64 MaxVel);
I16 FNTYPE HSL_M_start_a_arc_xy(I16 card_ID, I16 connect_index, I16 M_No, F64 Cx, F64 Cy, F64 Ex, F64 Ey, I16 DIR, F64 MaxVel);
I16 FNTYPE HSL_M_start_r_arc_zu(I16 card_ID, I16 connect_index, I16 M_No, F64 OffsetCx, F64 OffsetCy, F64 OffsetEx, F64 OffsetEy, I16 DIR, F64 MaxVel);
I16 FNTYPE HSL_M_start_a_arc_zu(I16 card_ID, I16 connect_index, I16 M_No, F64 Cx, F64 Cy, F64 Ex, F64 Ey, I16 DIR, F64 MaxVel);
I16 FNTYPE HSL_M_start_r_arc2(I16 card_ID, I16 connect_index, I16 *AxisArray, F64 OffsetCx, F64 OffsetCy, F64 OffsetEx, F64 OffsetEy, I16 DIR, F64 MaxVel);
I16 FNTYPE HSL_M_start_a_arc2(I16 card_ID, I16 connect_index, I16 *AxisArray, F64 Cx, F64 Cy, F64 Ex, F64 Ey, I16 DIR, F64 MaxVel);
I16 FNTYPE HSL_M_start_tr_arc_xy(I16 card_ID, I16 connect_index, I16 M_No, F64 OffsetCx, F64 OffsetCy, F64 OffsetEx, F64 OffsetEy, I16 DIR, F64 StrVel, F64 MaxVel, F64 Tacc, F64 Tdec);
I16 FNTYPE HSL_M_start_ta_arc_xy(I16 card_ID, I16 connect_index, I16 M_No, F64 Cx, F64 Cy, F64 Ex, F64 Ey, I16 DIR, F64 StrVel, F64 MaxVel, F64 Tacc, F64 Tdec);
I16 FNTYPE HSL_M_start_sr_arc_xy(I16 card_ID, I16 connect_index, I16 M_No, F64 OffsetCx, F64 OffsetCy, F64 OffsetEx, F64 OffsetEy, I16 DIR, F64 StrVel, F64 MaxVel, F64 Tacc, F64 Tdec, F64 SVacc, F64 SVdec);
I16 FNTYPE HSL_M_start_sa_arc_xy(I16 card_ID, I16 connect_index, I16 M_No, F64 Cx, F64 Cy, F64 Ex, F64 Ey, I16 DIR, F64 StrVel, F64 MaxVel, F64 Tacc, F64 Tdec, F64 SVacc, F64 SVdec);
I16 FNTYPE HSL_M_start_tr_arc_zu(I16 card_ID, I16 connect_index, I16 M_No, F64 OffsetCx, F64 OffsetCy, F64 OffsetEx, F64 OffsetEy, I16 DIR, F64 StrVel, F64 MaxVel, F64 Tacc, F64 Tdec);
I16 FNTYPE HSL_M_start_ta_arc_zu(I16 card_ID, I16 connect_index, I16 M_No, F64 Cx, F64 Cy, F64 Ex, F64 Ey, I16 DIR, F64 StrVel, F64 MaxVel, F64 Tacc, F64 Tdec);
I16 FNTYPE HSL_M_start_sr_arc_zu(I16 card_ID, I16 connect_index, I16 M_No, F64 OffsetCx, F64 OffsetCy, F64 OffsetEx, F64 OffsetEy, I16 DIR, F64 StrVel, F64 MaxVel, F64 Tacc, F64 Tdec, F64 SVacc, F64 SVdec);
I16 FNTYPE HSL_M_start_sa_arc_zu(I16 card_ID, I16 connect_index, I16 M_No, F64 Cx, F64 Cy, F64 Ex, F64 Ey, I16 DIR, F64 StrVel, F64 MaxVel, F64 Tacc, F64 Tdec, F64 SVacc, F64 SVdec);
I16 FNTYPE HSL_M_start_tr_arc2(I16 card_ID, I16 connect_index, I16 *AxisArray, F64 OffsetCx, F64 OffsetCy, F64 OffsetEx, F64 OffsetEy, I16 DIR, F64 StrVel, F64 MaxVel, F64 Tacc, F64 Tdec);
I16 FNTYPE HSL_M_start_ta_arc2(I16 card_ID, I16 connect_index, I16 *AxisArray, F64 Cx, F64 Cy, F64 Ex, F64 Ey, I16 DIR, F64 StrVel, F64 MaxVel, F64 Tacc, F64 Tdec);
I16 FNTYPE HSL_M_start_sr_arc2(I16 card_ID, I16 connect_index, I16 *AxisArray, F64 OffsetCx, F64 OffsetCy, F64 OffsetEx, F64 OffsetEy, I16 DIR, F64 StrVel, F64 MaxVel, F64 Tacc, F64 Tdec, F64 SVacc, F64 SVdec);
I16 FNTYPE HSL_M_start_sa_arc2(I16 card_ID, I16 connect_index, I16 *AxisArray, F64 Cx, F64 Cy, F64 Ex, F64 Ey, I16 DIR, F64 StrVel, F64 MaxVel, F64 Tacc, F64 Tdec, F64 SVacc, F64 SVdec);

// Home Return Mode
I16 FNTYPE HSL_M_set_home_config(I16 card_ID, I16 connect_index, I16 AxisNo, I16 home_mode, I16 org_logic, I16 ez_logic, I16 ez_count, I16 erc_out);
I16 FNTYPE HSL_M_set_org_offset(I16 card_ID, I16 connect_index, I16 AxisNo, F64 ORG_ESC_Offset);
I16 FNTYPE HSL_M_home_move(I16 card_ID, I16 connect_index, I16 AxisNo, F64 StrVel, F64 MaxVel, F64 Tacc);
I16 FNTYPE HSL_M_escape_home(I16 card_ID, I16 connect_index, I16 AxisNo, F64 StrVel, F64 MaxVel, F64 Tacc);
I16 FNTYPE HSL_M_home_search(I16 card_ID, I16 connect_index, I16 AxisNo, F64 StrVel, F64 MaxVel, F64 Tacc, F64 ORGOffset);
I16 FNTYPE HSL_M_set_home_move_all(I16 card_ID,  I16 connect_index, I16 TotalAxes, I16 *AxisArray, F64 *StrVelA, F64 *MaxVelA, F64 *TaccA, I16 mode);
I16 FNTYPE HSL_M_start_home_move_all(I16 card_ID, I16 connect_index, I16 FirstAxisNo);
I16 FNTYPE HSL_M_set_home_search_all(I16 card_ID,  I16 connect_index, I16 TotalAxes, I16 *AxisArray, F64 *StrVelA, F64 *MaxVelA, F64 *TaccA, F64 *ORGOffset, I16 mode);
I16 FNTYPE HSL_M_start_home_search_all(I16 card_ID, I16 connect_index, I16 FirstAxisNo);

// Motion Status
I16 FNTYPE HSL_M_motion_done(I16 card_ID, I16 connect_index, I16 AxisNo);
I16 FNTYPE HSL_M_get_abnormal_stop_status(I16 card_ID, I16 connect_index, I16 AxisNo, I32 *status);

// Motion Interface I/O
I16 FNTYPE HSL_M_set_alm(I16 card_ID, I16 connect_index, I16 AxisNo, I16 alm_logic, I16 alm_mode);
I16 FNTYPE HSL_M_set_el(I16 card_ID, I16 connect_index, I16 AxisNo, I16 el_mode);
I16 FNTYPE HSL_M_set_el_logic(I16 card_ID, I16 connect_index, I16 AxisNo, I16 el_logic);
I16 FNTYPE HSL_M_set_inp(I16 card_ID, I16 connect_index, I16 AxisNo, I16 inp_enable, I16 inp_logic);
I16 FNTYPE HSL_M_set_erc(I16 card_ID, I16 connect_index, I16 AxisNo, I16 erc_logic, I16 erc_on_time);
I16 FNTYPE HSL_M_set_servo(I16 card_ID, I16 connect_index, I16 AxisNo, I16 on_off);
I16 FNTYPE HSL_M_set_sd(I16 card_ID, I16 connect_index, I16 AxisNo, I16 enable, I16 sd_logic, I16 sd_latch, I16 sd_mode);

// Motion I/O Monitoring
I16 FNTYPE HSL_M_get_io_status(I16 card_ID, I16 connect_index, I16 AxisNo, U16 *io_sts);

// Position Control and Counters
I16 FNTYPE HSL_M_get_position(I16 card_ID, I16 connect_index, I16 AxisNo, F64 *pos);
I16 FNTYPE HSL_M_set_position(I16 card_ID, I16 connect_index, I16 AxisNo, F64 pos);
I16 FNTYPE HSL_M_get_command(I16 card_ID, I16 connect_index, I16 AxisNo, I32 *cmd);
I16 FNTYPE HSL_M_set_command(I16 card_ID, I16 connect_index, I16 AxisNo, I32 cmd);
I16 FNTYPE HSL_M_get_error_counter(I16 card_ID, I16 connect_index, I16 AxisNo, I16 *error_counter);
I16 FNTYPE HSL_M_reset_error_counter(I16 card_ID, I16 connect_index, I16 AxisNo);
I16 FNTYPE HSL_M_get_general_counter(I16 card_ID, I16 connect_index, I16 AxisNo, F64 *CntValue);
I16 FNTYPE HSL_M_set_general_counter(I16 card_ID, I16 connect_index, I16 AxisNo, I16 CntSrc, F64 CntValue);
I16 FNTYPE HSL_M_get_target_pos(I16 card_ID, I16 connect_index, I16 AxisNo, F64 *pos);
I16 FNTYPE HSL_M_reset_target_pos(I16 card_ID, I16 connect_index, I16 AxisNo, F64 pos);
I16 FNTYPE HSL_M_get_rest_command(I16 card_ID, I16 connect_index, I16 AxisNo, I32 *rest_command);
I16 FNTYPE HSL_M_check_rdp(I16 card_ID, I16 connect_index, I16 AxisNo, I32 *rdp_command);
//Only 7853/4 card & 8ID 4XMO Module use
I16 FNTYPE HSL_M_get_position_ex(I16 card_ID, I16 connect_index, I16 AxisNo, F64 *pos);
I16 FNTYPE HSL_M_get_io_status_ex(I16 card_ID, I16 connect_index, I16 AxisNo, U16 *io_sts);

// Position Compare and Latch
I16 FNTYPE HSL_M_set_ltc_logic(I16 card_ID, I16 connect_index, I16 AxisNo, I16 ltc_logic);
I16 FNTYPE HSL_M_get_latch_data(I16 card_ID, I16 connect_index, I16 AxisNo, I16 LatchNo, F64 *Pos);
I16 FNTYPE HSL_M_set_soft_limit(I16 card_ID, I16 connect_index, I16 AxisNo, I32 PLimit, I32 NLimit);
I16 FNTYPE HSL_M_enable_soft_limit(I16 card_ID, I16 connect_index, I16 AxisNo, I16 Action);
I16 FNTYPE HSL_M_disable_soft_limit(I16 card_ID, I16 connect_index, I16 AxisNo);
I16 FNTYPE HSL_M_set_error_counter_check(I16 card_ID, I16 connect_index, I16 AxisNo, I16 Tolerance, I16 On_Off);
I16 FNTYPE HSL_M_set_general_comparator(I16 card_ID, I16 connect_index, I16 AxisNo, I16 CmpSrc, I16 CmpMethod, I16 CmpAction, F64 Data);
I16 FNTYPE HSL_M_set_trigger_comparator(I16 card_ID, I16 connect_index, I16 AxisNo, I16 CmpSrc, I16 CmpMethod, F64 Data);
I16 FNTYPE HSL_M_set_trigger_logic(I16 card_ID, I16 connect_index, I16 AxisNo, I16 Logic);
I16 FNTYPE HSL_M_check_compare_data(I16 card_ID, I16 connect_index, I16 AxisNo, I16 CompType, F64 *Pos);
I16 FNTYPE HSL_M_check_compare_status(I16 card_ID, I16 connect_index, I16 AxisNo, U16 *cmp_sts);
I16 FNTYPE HSL_M_build_compare_table(I16 card_ID, I16 connect_index, I16 AxisNo, F64 *TableArray, I16 ArraySize);
I16 FNTYPE HSL_M_build_compare_function(I16 card_ID, I16 connect_index, I16 AxisNo, F64 StartPosition, F64 EndPosition, F64 Interval);
I16 FNTYPE HSL_M_set_auto_compare(I16 card_ID, I16 connect_index, I16 AxisNo, I16 Enable);
I16 FNTYPE HSL_M_set_compare_dir(I16 card_ID, I16 connect_index, I16 AxisNo, I16 Inverse);
//I16 FNTYPE HSL_M_set_compare_output_type(I16 card_ID, I16 connect_index, I16 AxisNo, I16 Normal_High_or_Low);
  
// Multiple Axes Simultaneous Operation
I16 FNTYPE HSL_M_set_tr_move_all(I16 card_ID, I16 connect_index, I16 TotalAxes, I16 *AxisArray, F64 *DistA, F64 *StrVelA, F64 *MaxVelA, F64 *TaccA, F64 *TdecA);
I16 FNTYPE HSL_M_set_ta_move_all(I16 card_ID, I16 connect_index, I16 TotalAxes, I16 *AxisArray, F64 *PosA, F64 *StrVelA, F64 *MaxVelA, F64 *TaccA, F64 *TdecA);
I16 FNTYPE HSL_M_set_sa_move_all(I16 card_ID, I16 connect_index, I16 TotalAxes, I16 *AxisArray, F64 *PosA, F64 *StrVelA, F64 *MaxVelA, F64 *TaccA, F64 *TdecA, F64 *SVaccA, F64 *SVdecA);
I16 FNTYPE HSL_M_set_sr_move_all(I16 card_ID, I16 connect_index, I16 TotalAxes, I16 *AxisArray, F64 *DistA, F64 *StrVelA, F64 *MaxVelA, F64 *TaccA, F64 *TdecA, F64 *SVaccA, F64 *SVdecA);
I16 FNTYPE HSL_M_start_move_all(I16 card_ID, I16 connect_index, I16 FirstAxisNo);
I16 FNTYPE HSL_M_stop_move_all(I16 card_ID, I16 connect_index, I16 FirstAxisNo);
I16 FNTYPE HSL_M_set_sync_option(I16 card_ID, I16 connect_index, I16 AxisNo, I16 sync_stop_on, I16 cstop_output_on, I16 sync_option1, I16 sync_option2);
I16 FNTYPE HSL_M_set_sync_stop_mode(I16 card_ID, I16 connect_index, I16 AxisNo, I16 stop_mode);

// General-purposed DIO
I16 FNTYPE HSL_M_write_do(I16 card_ID, I16 connect_index, I16 AxisNo, U16 value);
U16 FNTYPE HSL_M_read_di(I16 card_ID, I16 connect_index, I16 AxisNo);

// G code based function
I16 FNTYPE HSL_M_load_G_code(I16 card_ID, I16 connect_index, I16 M_No, char *filename);
I16 FNTYPE HSL_M_run_G_code(I16 card_ID, I16 connect_index, I16 M_No, I16 start_line_num);
I16 FNTYPE HSL_M_stop_G_code (I16 card_ID, I16 connect_index, I16 M_No);
I16 FNTYPE HSL_M_pause_G_code (I16 card_ID, I16 connect_index, I16 M_No, I16 pause_line_num);
I16 FNTYPE HSL_M_resume_G_code (I16 card_ID, I16 connect_index, I16 M_No);
I16 FNTYPE HSL_M_get_current_G_line (I16 card_ID, I16 connect_index, I16 M_No, I16 *current_line);
I16 FNTYPE HSL_M_map_G_code(I16 card_ID, I16 connect_index, I16 M_No, I16 G_Function, I16 *AxisArray, I16 Motion_Function);

//ODM Gantry function
I16 FNTYPE HSL_M_GTY_config( I16 card_ID, I16 connect_index, I16 M_No, I16 AxesGroup, I16 LinearAxis, I16 enable );

I16 FNTYPE HSL_M_GTY_tr_move( I16 card_ID, I16 connect_index, I16 M_No, F64 Dist, F64 StrVel, F64 MaxVel, F64 Tacc, F64 Tdec );
I16 FNTYPE HSL_M_GTY_ta_move( I16 card_ID, I16 connect_index, I16 M_No, F64 Pos, F64 StrVel, F64 MaxVel, F64 Tacc, F64 Tdec );
I16 FNTYPE HSL_M_GTY_sr_move( I16 card_ID, I16 connect_index, I16 M_No, F64 Dist, F64 StrVel, F64 MaxVel, F64 Tacc, F64 Tdec, F64 SVacc, F64 SVdec );
I16 FNTYPE HSL_M_GTY_sa_move( I16 card_ID, I16 connect_index, I16 M_No, F64 Pos, F64 StrVel, F64 MaxVel, F64 Tacc, F64 Tdec, F64 SVacc, F64 SVdec );

I16 FNTYPE HSL_M_GTY_tv_move( I16 card_ID, I16 connect_index, I16 M_No, F64 StrVel, F64 MaxVel, F64 Tacc );
I16 FNTYPE HSL_M_GTY_sv_move( I16 card_ID, I16 connect_index, I16 M_No, F64 StrVel, F64 MaxVel, F64 Tacc, F64 SVacc );
I16 FNTYPE HSL_M_GTY_stop_move( I16 card_ID, I16 connect_index, I16 M_No );

I16 FNTYPE HSL_M_GTY_tr_linear_move( I16 card_ID, I16 connect_index, I16 M_No, F64 DistG, F64 DistL, F64 StrVel, F64 MaxVel, F64 Tacc, F64 Tdec );
I16 FNTYPE HSL_M_GTY_ta_linear_move( I16 card_ID, I16 connect_index, I16 M_No, F64 PosG, F64 PosL, F64 StrVel, F64 MaxVel, F64 Tacc, F64 Tdec );
I16 FNTYPE HSL_M_GTY_sr_linear_move( I16 card_ID, I16 connect_index, I16 M_No, F64 DistG, F64 DistL, F64 StrVel, F64 MaxVel, F64 Tacc, F64 Tdec , F64 SVacc, F64 SVdec );
I16 FNTYPE HSL_M_GTY_sa_linear_move( I16 card_ID, I16 connect_index, I16 M_No, F64 PosG, F64 PosL, F64 StrVel, F64 MaxVel, F64 Tacc, F64 Tdec , F64 SVacc, F64 SVdec );

I16 FNTYPE HSL_M_GTY_home_config( I16 card_ID, I16 connect_index, I16 M_No, I16 home_mode, I16 org_logic, I16 ez_logic, I16 ez_count, I16 erc_out);
I16 FNTYPE HSL_M_GTY_home_move( I16 card_ID, I16 connect_index, I16 M_No, F64 StrVel, F64 MaxVel, F64 Tacc);
I16 FNTYPE HSL_M_GTY_home_search( I16 card_ID, I16 connect_index, I16 M_No, F64 StrVel, F64 MaxVel, F64 Tacc, F64 ORGOffset);

I16 FNTYPE HSL_M_GTY_get_errcmd( I16 card_ID, I16 connect_index, I16 M_No, I32 *errcmd );
I16 FNTYPE HSL_M_GTY_get_errpos( I16 card_ID, I16 connect_index, I16 M_No, I32 *errpos );
I16 FNTYPE HSL_M_GTY_get_maxerrcmd( I16 card_ID, I16 connect_index, I16 M_No, I32 *maxerrcmd );
I16 FNTYPE HSL_M_GTY_get_maxerrpos( I16 card_ID, I16 connect_index, I16 M_No, I32 *maxerrpos );
I16 FNTYPE HSL_M_GTY_reset_maxerrcmd( I16 card_ID, I16 connect_index, I16 M_No );
I16 FNTYPE HSL_M_GTY_reset_maxerrpos( I16 card_ID, I16 connect_index, I16 M_No );
I16 FNTYPE HSL_M_GTY_set_deviation( I16 card_ID, I16 connect_index, I16 M_No, I32 deviation );
I16 FNTYPE HSL_M_GTY_get_deviation( I16 card_ID, I16 connect_index, I16 M_No, I32 *deviation );

/****************************************************************************/
/*      Simplified Function  for HSL communication                          */
/****************************************************************************/

// Parameter Setting
I16 FNTYPE HSL_M_set_str_velocity(I16 card_ID, I16 connect_index, I16 AxisNo, F64 StrVel);
I16 FNTYPE HSL_M_set_max_velocity(I16 card_ID, I16 connect_index, I16 AxisNo, F64 MaxVel);
I16 FNTYPE HSL_M_set_arc_velocity(I16 card_ID, I16 connect_index, I16 AxisNo, F64 Arc_MaxVel);
I16 FNTYPE HSL_M_set_Tacc(I16 card_ID, I16 connect_index, I16 AxisNo, F64 Tacc);
I16 FNTYPE HSL_M_set_Tdec(I16 card_ID, I16 connect_index, I16 AxisNo, F64 Tdec);
I16 FNTYPE HSL_M_set_SVacc(I16 card_ID, I16 connect_index, I16 AxisNo, F64 SVacc);
I16 FNTYPE HSL_M_set_SVdec(I16 card_ID, I16 connect_index, I16 AxisNo, F64 SVdec);

// Single Axis Motion
I16 FNTYPE HSL_M_move_t_distance(I16 card_ID, I16 connect_index, I16 AxisNo, F64 Dist);
I16 FNTYPE HSL_M_move_t_position(I16 card_ID, I16 connect_index, I16 AxisNo, F64 Pos);
I16 FNTYPE HSL_M_move_s_distance(I16 card_ID, I16 connect_index, I16 AxisNo, F64 Dist);
I16 FNTYPE HSL_M_move_s_position(I16 card_ID, I16 connect_index, I16 AxisNo, F64 Pos);

// Linear Interpolated Motion
I16 FNTYPE HSL_M_move_t_distance2(I16 card_ID, I16 connect_index, I16 *AxisArray, F64 DistX, F64 DistY);
I16 FNTYPE HSL_M_move_t_position2(I16 card_ID, I16 connect_index, I16 *AxisArray, F64 PosX, F64 PosY);
I16 FNTYPE HSL_M_move_s_distance2(I16 card_ID, I16 connect_index, I16 *AxisArray, F64 DistX, F64 DistY);
I16 FNTYPE HSL_M_move_s_position2(I16 card_ID, I16 connect_index, I16 *AxisArray, F64 PosX, F64 PosY);

// Circular Interpolation Motion
I16 FNTYPE HSL_M_move_t_arc2_distance(I16 card_ID, I16 connect_index, I16 *AxisArray, F64 OffsetCx, F64 OffsetCy, F64 OffsetEx, F64 OffsetEy, I16 DIR);
I16 FNTYPE HSL_M_move_t_arc2_position(I16 card_ID, I16 connect_index, I16 *AxisArray, F64 Cx, F64 Cy, F64 Ex, F64 Ey, I16 DIR);
I16 FNTYPE HSL_M_move_s_arc2_distance(I16 card_ID, I16 connect_index, I16 *AxisArray, F64 OffsetCx, F64 OffsetCy, F64 OffsetEx, F64 OffsetEy, I16 DIR);
I16 FNTYPE HSL_M_move_s_arc2_position(I16 card_ID, I16 connect_index, I16 *AxisArray, F64 Cx, F64 Cy, F64 Ex, F64 Ey, I16 DIR);

#ifdef __cplusplus
}
#endif

#endif
