using System;
using System.Text;
using System.Runtime.InteropServices;

namespace i8196F
{

    public enum ePOWER_ON_SETTING:int
    {
	    DEFAULT_POWER_ON_SETTING   =0,   // factory default settings
	    SAVED_POWER_ON_SETTING     =1    //loads configuration settings stored in the FRAM
    };

    public enum eSINGLE_AXIS:int
    {
	    AXIS_0		=0x01,
	    AXIS_1		=0x02,
	    AXIS_2		=0x04,
	    AXIS_3		=0x08,
	    AXIS_4		=0x10,
	    AXIS_5		=0x20
    };

    public enum ePULSE_MODE:int
    {
	    PULSE_MODE_PULSE_DIRECTION	=0x0,
	    PULSE_MODE_CW_CCW			=0x1,
	    PULSE_MODE_AB_DIVID_4		=0x2,  	// Quadrature pulse input
	    PULSE_MODE_AB_DIVID_2		=0x3,
	    PULSE_MODE_AB				=0x4
    };

    public enum ePULSE_LOGIC:int
    {
	    PULSE_LOGIC_ACTIVE_HIGH		=0x0,
	    PULSE_LOGIC_ACTIVE_LOW		=0x1
    };

    public enum eFORWARD_ACTIVE:int
    {
	    PULSE_FORWARD_ACTIVE_HIGH	=0x0,
	    PULSE_FORWARD_ACTIVE_LOW	=0x1
    };

    public enum eENCODER_MODE:int
    {
	    ENCODER_MODE_CW_CCW			=0x1,	// Up/Down pulse input
	    ENCODER_MODE_AB_DIVID_4		=0x2,  // Quadrature pulse input
	    ENCODER_MODE_AB_DIVID_2		=0x3,
	    ENCODER_MODE_AB				=0x4
    };

    public enum eLOGIC_ACTIVE_LEVEL:int     //polarity
    {
	    LOGIC_ACTIVE_LOW  = 0x0000,
	    LOGIC_ACTIVE_HIGH = 0x0001
    };

    public enum eSTOP_MODE:int
    {
	    STOP_NONE				=0,
	    STOP_SLOWDOWN			=1,
	    STOP_SUDDEN			    =2
    };

    public enum eFEEDBACK_SRC:int
    {
	    FEEDBACK_SRC_DDA_ENC         =0,	// Theoretical Command with one cycle delay
	    FEEDBACK_SRC_ENC             =1,	// Real Closed Loop form Encoder
	    FEEDBACK_SRC_DDA             =2,	// Internal Loop back from DDA
	    FEEDBACK_SRC_ADC             =3,	// Real Closed Loop form ADC, for speed feedback only
	    FEEDBACK_SRC_DAC             =4	    // Internal Loop back from DAC, for speed feedback only
    };

    public enum eHOME_DIR:int
    {
	    AUTO_HOME_FORWARD					=0x0001, 
	    AUTO_HOME_REVERSE					=0x0000
    };

    public enum eSYNCHRONIZATION_MODE:int
    {
	    ENABLE_BLOCK_OPERATION				=(1),
	    DISABLE_BLOCK_OPERATION				=(0)
    };

    public enum eCHANNEL_STATE:int
    {
	    OFF					=0x0,
	    ON					=0x1
    };

    public enum eENABLE_DISABLE:int
    {
	    DISABLE = 0x0,
	    ENABLE  = 0x1
    };

    public enum eTRIG_PULSE_WIDTH:int
    {
	    TRIG_PULSE_WIDTH_ACTUAL_PULSE			=0x0000,
	    TRIG_PULSE_WIDTH_160nsTo320ns			=0x0001,
	    TRIG_PULSE_WIDTH_320nsTo640ns			=0x0002,
	    TRIG_PULSE_WIDTH_640nsTo1p28us			=0x0003,
	    TRIG_PULSE_WIDTH_1p28usTo2p56us			=0x0004,
	    TRIG_PULSE_WIDTH_2p56usTo5p12us			=0x0005,
	    TRIG_PULSE_WIDTH_5p12usTo10p24us		=0x0006,
	    TRIG_PULSE_WIDTH_10p24usTo20p48us		=0x0007,
	    TRIG_PULSE_WIDTH_20p48usTo40p96us		=0x0008,
	    TRIG_PULSE_WIDTH_40p96usTo81p92us		=0x0009,
	    TRIG_PULSE_WIDTH_81p92usTo163p84us		=0x000A,
	    TRIG_PULSE_WIDTH_163p84usTo327p68us		=0x000B,
	    TRIG_PULSE_WIDTH_327p68usTo655p36us		=0x000C,
	    TRIG_PULSE_WIDTH_655p36usTo1p31072ms	=0x000D,
	    TRIG_PULSE_WIDTH_1p31072msTo2p62144ms	=0x000E,
	    TRIG_PULSE_WIDTH_2p62144msTo5p24288ms	=0x000F
    };

    public enum eMOVE_DIRECTION:int
    {
	    MOVE_DIRECTION_FORWARD	=	1,
	    MOVE_DIRECTION_REVERSE	=	0
    };

    public enum eCMP_TRIG_MOVE_DIR:int
    {
	    CMPTRIG_FORWARD_MOVE				=1,
	    CMPTRIG_REVERSE_MOVE				=0
    };

    public enum eINTERP_CONFIG:int
    {
	    CANCEL_INTERP_CONFIG            =0x0000,
	    START_INTERP_CONFIG             =0x0001
    };

    public enum eINTERPOLATION_MODE:int
    {
	    GENERAL_INTERP_CONFIG			= 0x0,  //start stop mode
	    CONTI_INTERP_CONFIG				= 0x1,
	    CONTI_FIFO_BUFFER_MODE          = 0x2   //commands will first be stored in an internal FIFO buffer of this DLL. To execute the FIFO buffer commands call "i8196f_conti_interp_start_all()"
    };

    public enum eARC_DIR:int
    {
	    ARC_DIR_CW		= 0x0000,    //cw      //INTERP_ARC_DIRECTION_FORWARD
	    ARC_DIR_CCW  	= 0x0001     //ccw     //INTERP_ARC_DIRECTION_REVERSE
    };

    public enum eACC_DEC_CURVE:int
    {
	    I8196F_ACC_DEC_T_CURVE	= 0x6565,
	    I8196F_ACC_DEC_S_CURVE	= 0x6666
    };

    public enum eFRNET_SPEED:int
    {
	    FRNET_SPEED_1M	    =	1,
	    FRNET_SPEED_250K	=	0
    };

    public enum eFRNET_DI_ADDR:int
    {
	    FRNET_SA8	= 0x8,
	    FRNET_SA9	= 0x9,
	    FRNET_SA10	= 0xA,
	    FRNET_SA11	= 0xB,
	    FRNET_SA12	= 0xC,
	    FRNET_SA13	= 0xD,
	    FRNET_SA14	= 0xE,
	    FRNET_SA15	= 0xF
    };
    
    public enum eFRNET_DO_ADDR:int
    {
	    FRNET_RA0	= 0x0,
	    FRNET_RA1	= 0x1,
	    FRNET_RA2	= 0x2,
	    FRNET_RA3	= 0x3,
	    FRNET_RA4	= 0x4,
	    FRNET_RA5	= 0x5,
	    FRNET_RA6	= 0x6,
	    FRNET_RA7	= 0x7
    };

    public enum eGENERAL_DI:int
    {
	    DI_EMG_CH			=(15),	//
	    DI_MPG_EMG_CH		=(14),	//
	    DI_MPG_A_CH			=(13),	//
	    DI_MPG_B_CH			=(12),	//
	    DI_GDI11_CH			=(11),	//
	    DI_GDI10_CH			=(10),	//
	    DI_GDI9_CH			=(9),		//
	    DI_GDI8_CH			=(8),		//
	    DI_GDI7_CH			=(7),		//
	    DI_GDI6_CH			=(6),		//
	    DI_GDI5_CH			=(5),		//
	    DI_GDI4_CH			=(4),		//
	    DI_GDI3_CH			=(3),		//
	    DI_GDI2_CH			=(2),		//
	    DI_GDI1_CH			=(1),		//
	    DI_GDI0_CH	  		=(0)		//
    };

    public enum eGENERAL_DO:int
    {
	    DO_GDO2_CH			=(2),		//
	    DO_GDO1_CH			=(1),		//
	    DO_GDO0_CH			=(0)		//
    };

	public class C96F
	{
        //*** initial system
       [DllImport("i8196F.dll", EntryPoint = "i8196f_registration")]
       public static extern short i8196f_registration( byte bSlotNo);

       [DllImport("i8196F.dll", EntryPoint = "i8196f_check_card_in_slot")]
       public static extern short i8196f_check_card_in_slot( byte bSlotNo);
     
       [DllImport("i8196F.dll", EntryPoint = "i8196f_get_card_version")]
       public static extern short i8196f_get_card_version( byte bSlotNo, ref ushort pwPCBVersion, ref ushort pwPLDVersion);

       [DllImport("i8196F.dll", EntryPoint = "i8196f_get_fpga_version")]
       public static extern short i8196f_get_fpga_version( byte bSlotNo, ref ushort pwFpgaVers);

       [DllImport("i8196F.dll", EntryPoint = "i8196f_get_dsp_firmware_version")]
       public static extern short i8196f_get_dsp_firmware_version( byte bSlotNo, ref ushort pwDspFirmwareVers);

       [DllImport("i8196F.dll", EntryPoint = "i8196f_get_dll_version")]
       public static extern short i8196f_get_dll_version(ref ushort pwDllVers);

       [DllImport("i8196F.dll", EntryPoint = "i8196f_load_power_on_cfg")]
       public static extern short i8196f_load_power_on_cfg( byte bSlotNo, ePOWER_ON_SETTING eCfgSource);

       [DllImport("i8196F.dll", EntryPoint = "i8196f_save_power_on_cfg")]
       public static extern short i8196f_save_power_on_cfg( byte bSlotNo);

       [DllImport("i8196F.dll", EntryPoint = "i8196f_get_motion_done")]
       public static extern short i8196f_get_motion_done( byte bSlotNo, eSINGLE_AXIS eSingleAxis, ref byte pbDone, ref ushort pwStopStatus);

       [DllImport("i8196F.dll", EntryPoint = "i8196f_get_cmdcounter")]
       public static extern short i8196f_get_cmdcounter( byte bSlotNo, eSINGLE_AXIS eSingleAxis, ref int plLogicPosCount);

       [DllImport("i8196F.dll", EntryPoint = "i8196f_get_enccounter")]
       public static extern short i8196f_get_enccounter( byte bSlotNo, eSINGLE_AXIS eSingleAxis, ref int plEncoderPosCount);

       [DllImport("i8196F.dll", EntryPoint = "i8196f_get_max_speed")]
       public static extern short i8196f_get_max_speed(byte bSlotNo, eSINGLE_AXIS eSingleAxis, ref uint pdwMaxSpeed);

       [DllImport("i8196F.dll", EntryPoint = "i8196f_get_speed")]
       public static extern short i8196f_get_speed( byte bSlotNo, eSINGLE_AXIS eSingleAxis, ref int plSpeed );

       [DllImport("i8196F.dll", EntryPoint = "i8196f_get_acc")]
       public static extern short i8196f_get_acc( byte bSlotNo, eSINGLE_AXIS eSingleAxis, ref int plAcc);

       [DllImport("i8196F.dll", EntryPoint = "i8196f_set_pls_cfg")]
       public static extern short i8196f_set_pls_cfg( byte bSlotNo, eSINGLE_AXIS eSingleAxis, ePULSE_MODE ePulseMode,  ePULSE_LOGIC ePulseLogic, eFORWARD_ACTIVE eDirectionLogic);

       [DllImport("i8196F.dll", EntryPoint = "i8196f_set_enc_cfg")]
       public static extern short i8196f_set_enc_cfg( byte bSlotNo, eSINGLE_AXIS eSingleAxis, eENCODER_MODE eEncoderMode);
 
       [DllImport("i8196F.dll", EntryPoint = "i8196f_set_limit")]
       public static extern short i8196f_set_limit( byte bSlotNo, eSINGLE_AXIS eSingleAxis, eLOGIC_ACTIVE_LEVEL eLimitLogic, eSTOP_MODE eStopMode);

       [DllImport("i8196F.dll", EntryPoint = "i8196f_set_softlimit")]
       public static extern short i8196f_set_softlimit( byte bSlotNo, eSINGLE_AXIS eSingleAxis, eSTOP_MODE eStopMode, eFEEDBACK_SRC eFeedbackSrc, int lLimitPositive, int lLimitNegative);

       [DllImport("i8196F.dll", EntryPoint = "i8196f_set_softlimit_disable")]
       public static extern short i8196f_set_softlimit_disable(byte bSlotNo, eSINGLE_AXIS eSingleAxis);

       [DllImport("i8196F.dll", EntryPoint = "i8196f_set_max_speed")]
       public static extern short i8196f_set_max_speed(byte bSlotNo, eSINGLE_AXIS eSingleAxis, uint dwMaxSpeed);

       [DllImport("i8196F.dll", EntryPoint = "i8196f_set_home_cfg")]
       public static extern short i8196f_set_home_cfg( byte bSlotNo, eSINGLE_AXIS eSingleAxis, eLOGIC_ACTIVE_LEVEL eHomeLogic, eLOGIC_ACTIVE_LEVEL eNHomeLogic,	  
									                   eLOGIC_ACTIVE_LEVEL eIndexLogic, byte bHomeSteps, int lStep4Offset);

       [DllImport("i8196F.dll", EntryPoint = "i8196f_home_start")]
       public static extern short i8196f_home_start( byte bSlotNo, eSINGLE_AXIS eSingleAxis, uint dwStartSpeed, uint dwAcceleration, uint dwDeceleration,		
	                                                uint dwNHomeSearchSpeed, uint dwHomeSearchSpeed, eHOME_DIR eHomingDirection);

       [DllImport("i8196F.dll", EntryPoint = "i8196f_set_servo_on")]
       public static extern short i8196f_set_servo_on( byte bSlotNo, eSINGLE_AXIS eSingleAxis, eCHANNEL_STATE eServoOnOff);

       [DllImport("i8196F.dll", EntryPoint = "i8196f_set_erc")]
       public static extern short i8196f_set_erc( byte bSlotNo, eSINGLE_AXIS eSingleAxis, eCHANNEL_STATE eErcOnOff);
  
       [DllImport("i8196F.dll", EntryPoint = "i8196f_set_alarm_reset")]
       public static extern short i8196f_set_alarm_reset( byte bSlotNo, eSINGLE_AXIS eSingleAxis, eCHANNEL_STATE eAlmRstOnOff);

       [DllImport("i8196F.dll", EntryPoint = "i8196f_set_alarm")]
       public static extern short i8196f_set_alarm( byte bSlotNo,  eSINGLE_AXIS eSingleAxis, eENABLE_DISABLE eEnableDisable, eLOGIC_ACTIVE_LEVEL eTrigLevel);

       [DllImport("i8196F.dll", EntryPoint = "i8196f_set_inp")]
       public static extern short i8196f_set_inp( byte bSlotNo, eSINGLE_AXIS eSingleAxis, eENABLE_DISABLE eEnableDisable, eLOGIC_ACTIVE_LEVEL eINPLogic);

       [DllImport("i8196F.dll", EntryPoint = "i8196f_set_ready")]
       public static extern short i8196f_set_ready( byte bSlotNo, eSINGLE_AXIS eSingleAxis, eENABLE_DISABLE eEnableDisable, eLOGIC_ACTIVE_LEVEL eRdyLogic);

       [DllImport("i8196F.dll", EntryPoint = "i8196f_set_cmdcounter")]
       public static extern short i8196f_set_cmdcounter( byte bSlotNo, eSINGLE_AXIS eSingleAxis, int lLogicPos);

       [DllImport("i8196F.dll", EntryPoint = "i8196f_set_enccounter")]
       public static extern short i8196f_set_enccounter( byte bSlotNo, eSINGLE_AXIS eSingleAxis, int lEncPos);

       [DllImport("i8196F.dll", EntryPoint = "i8196f_set_vring_counter")]
       public static extern short i8196f_set_vring_counter(byte bSlotNo, eSINGLE_AXIS eSingleAxis, uint dwRingValue);

       [DllImport("i8196F.dll", EntryPoint = "i8196f_get_vring_counter")]
       public static extern short i8196f_get_vring_counter(byte bSlotNo, eSINGLE_AXIS eSingleAxis, ref uint pdwRingValue);

       [DllImport("i8196F.dll", EntryPoint = "i8196f_disable_vring_counter")]
       public static extern short i8196f_disable_vring_counter(byte bSlotNo, eSINGLE_AXIS eSingleAxis);

       [DllImport("i8196F.dll", EntryPoint = "i8196f_set_compare_trig_cfg")]
       public static extern short i8196f_set_compare_trig_cfg( byte bSlotNo, eSINGLE_AXIS eSingleAxis, eENABLE_DISABLE eCmpTrigEnable, eLOGIC_ACTIVE_LEVEL eOutputLogic,
                                                               eTRIG_PULSE_WIDTH  ePulseWidth,	eCMP_TRIG_MOVE_DIR	eMoveDirection,
                                                               eENABLE_DISABLE	 eCmpIncEnable, ushort wConstPitch, uint dwCmpData);

       [DllImport("i8196F.dll", EntryPoint = "i8196f_set_conti_interp_cfg")]
       public static extern short i8196f_set_conti_interp_cfg( byte bSlotNo, eINTERP_CONFIG eCfgEnable, ushort wGroupIndex0, ushort wGroupIndex1, ushort wGroupIndex2);

       [DllImport("i8196F.dll", EntryPoint = "i8196f_velocity_move")]
       public static extern short i8196f_velocity_move( byte bSlotNo, eSINGLE_AXIS eBitSingleAxis, uint dwStartSpeed, uint dwDriveSpeed, uint dwAcceleration, eMOVE_DIRECTION eDirection);

       [DllImport("i8196F.dll", EntryPoint = "i8196f_t_move")]
       public static extern short i8196f_t_move( byte bSlotNo, eSINGLE_AXIS eBitSingleAxis, uint dwStartSpeed, uint dwDriveSpeed, uint dwEndSpeed,
                                                 uint dwAcceleration, uint dwDeceleration, int FixedPulse);

       [DllImport("i8196F.dll", EntryPoint = "i8196f_abs_t_move")]
       public static extern short i8196f_abs_t_move(byte bSlotNo, eSINGLE_AXIS eBitSingleAxis, uint dwStartSpeed, uint dwDriveSpeed, uint dwEndSpeed,
                                                 uint dwAcceleration, uint dwDeceleration, int FixedPulse);

       [DllImport("i8196F.dll", EntryPoint = "i8196f_s_move")]
       public static extern short i8196f_s_move(byte bSlotNo, eSINGLE_AXIS eBitSingleAxis, uint dwStartSpeed, uint dwDriveSpeed, uint dwEndSpeed,
                                                 uint dwAcceleration, uint dwDeceleration, int FixedPulse);

       [DllImport("i8196F.dll", EntryPoint = "i8196f_abs_s_move")]
       public static extern short i8196f_abs_s_move(byte bSlotNo, eSINGLE_AXIS eBitSingleAxis, uint dwStartSpeed, uint dwDriveSpeed, uint dwEndSpeed,
                                                 uint dwAcceleration, uint dwDeceleration, int FixedPulse);

       [DllImport("i8196F.dll", EntryPoint = "i8196f_t_line2_move")]
       public static extern short i8196f_t_line2_move( byte bSlotNo, eSINGLE_AXIS eMainAxis, eSINGLE_AXIS eSlaveAxis,
                                           uint dwStartSpeed, uint dwDriveSpeed, uint dwEndSpeed, uint dwAcceleration, uint dwDeceleration,		
	                                       int lMainAxisRelDist, int lSlaveAxisRelDist,	
	                                       eINTERPOLATION_MODE eInterpMode );

       [DllImport("i8196F.dll", EntryPoint = "i8196f_abs_t_line2_move")]
       public static extern short i8196f_abs_t_line2_move( byte bSlotNo, eSINGLE_AXIS eMainAxis, eSINGLE_AXIS eSlaveAxis,
                                           uint dwStartSpeed, uint dwDriveSpeed, uint dwEndSpeed, uint dwAcceleration, uint dwDeceleration,		
	                                       int lMainAxisFinishPoint, int lSlaveAxisFinishPoint,	
	                                       eINTERPOLATION_MODE eInterpMode );

       [DllImport("i8196F.dll", EntryPoint = "i8196f_s_line2_move")]
       public static extern short i8196f_s_line2_move( byte bSlotNo, eSINGLE_AXIS eMainAxis, eSINGLE_AXIS eSlaveAxis,
                                           uint dwStartSpeed, uint dwDriveSpeed, uint dwEndSpeed, uint dwAcceleration, uint dwDeceleration,		
	                                       int lMainAxisRelDist, int lSlaveAxisRelDist,	
	                                       eINTERPOLATION_MODE eInterpMode );

       [DllImport("i8196F.dll", EntryPoint = "i8196f_abs_s_line2_move")]
       public static extern short i8196f_abs_s_line2_move( byte bSlotNo, eSINGLE_AXIS eMainAxis, eSINGLE_AXIS eSlaveAxis,
                                           uint dwStartSpeed, uint dwDriveSpeed, uint dwEndSpeed, uint dwAcceleration, uint dwDeceleration,		
	                                       int lMainAxisFinishPoint, int lSlaveAxisFinishPoint,	
	                                       eINTERPOLATION_MODE eInterpMode );

       [DllImport("i8196F.dll", EntryPoint = "i8196f_t_line3_move")]
       public static extern short i8196f_t_line3_move( byte bSlotNo, eSINGLE_AXIS eMainAxis, eSINGLE_AXIS eSecondAxis, eSINGLE_AXIS eThirdAxis,
                                           uint dwStartSpeed, uint dwDriveSpeed, uint dwEndSpeed, uint dwAcceleration, uint dwDeceleration,		
                                           int lMainAxisRelDist, int lSecondAxisRelDist, int lThirdAxisRelDist,	
                                           eINTERPOLATION_MODE eInterpMode );

       [DllImport("i8196F.dll", EntryPoint = "i8196f_abs_t_line3_move")]
       public static extern short i8196f_abs_t_line3_move( byte bSlotNo, eSINGLE_AXIS eMainAxis, eSINGLE_AXIS eSecondAxis, eSINGLE_AXIS eThirdAxis,
                                           uint dwStartSpeed, uint dwDriveSpeed, uint dwEndSpeed, uint dwAcceleration, uint dwDeceleration,		
                                           int lMainAxisFinishPoint, int lSecondAxisFinishPoint, int lThirdAxisFinishPoint,	
                                           eINTERPOLATION_MODE eInterpMode );

       [DllImport("i8196F.dll", EntryPoint = "i8196f_s_line3_move")]
       public static extern short i8196f_s_line3_move( byte bSlotNo, eSINGLE_AXIS eMainAxis, eSINGLE_AXIS eSecondAxis, eSINGLE_AXIS eThirdAxis,
                                           uint dwStartSpeed, uint dwDriveSpeed, uint dwEndSpeed, uint dwAcceleration, uint dwDeceleration,		
                                           int lMainAxisRelDist, int lSecondAxisRelDist, int lThirdAxisRelDist,	
                                           eINTERPOLATION_MODE eInterpMode );

       [DllImport("i8196F.dll", EntryPoint = "i8196f_abs_s_line3_move")]
       public static extern short i8196f_abs_s_line3_move( byte bSlotNo, eSINGLE_AXIS eMainAxis, eSINGLE_AXIS eSecondAxis, eSINGLE_AXIS eThirdAxis,
                                           uint dwStartSpeed, uint dwDriveSpeed, uint dwEndSpeed, uint dwAcceleration, uint dwDeceleration,		
                                           int lMainAxisFinishPoint, int lSecondAxisFinishPoint, int lThirdAxisFinishPoint,	
                                           eINTERPOLATION_MODE eInterpMode );

       [DllImport("i8196F.dll", EntryPoint = "i8196f_t_arc2_move")]
       public static extern short i8196f_t_arc2_move( byte bSlotNo, eSINGLE_AXIS eMainAxis, eSINGLE_AXIS eSlaveAxis,
                                          uint dwStartSpeed, uint dwDriveSpeed, uint dwEndSpeed, uint dwAcceleration, uint dwDeceleration, eARC_DIR eArcDirection,			    
	                                      int lMainAxisCenterPoint, int lSlaveAxisCenterPoint, int lMainAxisFinishPoint, int lSlaveAxisFinishPoint,	        
	                                      eINTERPOLATION_MODE eInterpMode );

       [DllImport("i8196F.dll", EntryPoint = "i8196f_abs_t_arc2_move")]
       public static extern short i8196f_abs_t_arc2_move( byte bSlotNo, eSINGLE_AXIS eMainAxis, eSINGLE_AXIS eSlaveAxis,
                                          uint dwStartSpeed, uint dwDriveSpeed, uint dwEndSpeed, uint dwAcceleration, uint dwDeceleration, eARC_DIR eArcDirection,			    
	                                      int lMainAxisCenterPoint, int lSlaveAxisCenterPoint, int lMainAxisFinishPoint, int lSlaveAxisFinishPoint,	        
	                                      eINTERPOLATION_MODE eInterpMode );

       [DllImport("i8196F.dll", EntryPoint = "i8196f_t_helical_move")]
       public static extern short i8196f_t_helical_move( byte bSlotNo, eSINGLE_AXIS eAxis0,	eSINGLE_AXIS eAxis1, eSINGLE_AXIS eAxis2,
                                             uint dwStartSpeed, uint dwDriveSpeed, uint dwEndSpeed, uint dwAcceleration, uint dwDeceleration,		        
	                                         int lCenterPoint0,	int lCenterPoint1, int lCenterPoint2,	                
	                                         int lNormalDir0, int lNormalDir1, int lNormalDir2,
	                                         float fAngle, float fPitch, eINTERPOLATION_MODE eInterpMode);

       [DllImport("i8196F.dll", EntryPoint = "i8196f_abs_t_helical_move")]
       public static extern short i8196f_abs_t_helical_move( byte bSlotNo, eSINGLE_AXIS eAxis0,	eSINGLE_AXIS eAxis1, eSINGLE_AXIS eAxis2,
                                             uint dwStartSpeed, uint dwDriveSpeed, uint dwEndSpeed, uint dwAcceleration, uint dwDeceleration,		        
	                                         int lCenterPoint0,	int lCenterPoint1, int lCenterPoint2,	                
	                                         int lNormalDir0, int lNormalDir1, int lNormalDir2,
	                                         float fAngle, float fPitch, eINTERPOLATION_MODE eInterpMode);
   
       [DllImport("i8196F.dll", EntryPoint = "i8196f_lines_move")]
       public static extern short i8196f_lines_move( byte bSlotNo, ushort wAxes, eACC_DEC_CURVE eAccDecMode,
                                          uint dwStartSpeed, uint dwDriveSpeed, uint dwEndSpeed, uint dwAcceleration, uint dwDeceleration,		        
	                                      int[] lRelativeDistance, eINTERPOLATION_MODE eInterpMode);

       [DllImport("i8196F.dll", EntryPoint = "i8196f_abs_lines_move")]
       public static extern short i8196f_abs_lines_move( byte bSlotNo, ushort wAxes, eACC_DEC_CURVE eAccDecMode,
                                          uint dwStartSpeed, uint dwDriveSpeed, uint dwEndSpeed, uint dwAcceleration, uint dwDeceleration,		        
	                                      int[] lAbsolutePosition, eINTERPOLATION_MODE eInterpMode);

       [DllImport("i8196F.dll", EntryPoint = "i8196f_set_frnet_speed")]
       public static extern short i8196f_set_frnet_speed( byte bSlotNo, eFRNET_SPEED eFRnetSpeed);
     
       [DllImport("i8196F.dll", EntryPoint = "i8196f_save_frnet_speed")]
       public static extern short i8196f_save_frnet_speed( byte bSlotNo);

       [DllImport("i8196F.dll", EntryPoint = "i8196f_scan_frnet_di")]
       public static extern short i8196f_scan_frnet_di( byte bSlotNo, ref ushort pwDIModules);

       [DllImport("i8196F.dll", EntryPoint = "i8196f_get_frnet_di")]
       public static extern short i8196f_get_frnet_di( byte bSlotNo, eFRNET_DI_ADDR eSA, byte bDiChannelNo, ref eCHANNEL_STATE peOnOff);

       [DllImport("i8196F.dll", EntryPoint = "i8196f_get_frnet_group_di")]
       public static extern short i8196f_get_frnet_group_di( byte bSlotNo, eFRNET_DI_ADDR eSA, ref ushort pwStatus);

       [DllImport("i8196F.dll", EntryPoint = "i8196f_set_frnet_group_do")]
       public static extern short i8196f_set_frnet_group_do( byte bSlotNo, eFRNET_DO_ADDR eRA, ushort wDOData );

       [DllImport("i8196F.dll", EntryPoint = "i8196f_get_frnet_group_do")]
       public static extern short i8196f_get_frnet_group_do( byte bSlotNo, eFRNET_DO_ADDR eRA, ref ushort pwStatus);

       [DllImport("i8196F.dll", EntryPoint = "i8196f_drv_hold")]
       public static extern short i8196f_drv_hold( byte bSlotNo, ushort wBitMultiAxes);

       [DllImport("i8196F.dll", EntryPoint = "i8196f_drv_start")]
       public static extern short i8196f_drv_start( byte bSlotNo, ushort wBitMultiAxes);

       [DllImport("i8196F.dll", EntryPoint = "i8196f_stop_move")]
       public static extern short i8196f_stop_move( byte bSlotNo, eSINGLE_AXIS eSingleAxis, eSTOP_MODE eStopMode);

       [DllImport("i8196F.dll", EntryPoint = "i8196f_reset")]
       public static extern short i8196f_reset( byte bSlotNo );

       [DllImport("i8196F.dll", EntryPoint = "i8196f_set_latch_cfg")]
       public static extern short i8196f_set_latch_cfg( byte bSlotNo, eSINGLE_AXIS eSingleAxis, eENABLE_DISABLE eLatchEnable, eLOGIC_ACTIVE_LEVEL eLatchLogic);

       [DllImport("i8196F.dll", EntryPoint = "i8196f_get_latch")]
       public static extern short i8196f_get_latch( byte bSlotNo, eSINGLE_AXIS eSingleAxis, ref int plLatchData);

       [DllImport("i8196F.dll", EntryPoint = "i8196f_get_mdi_status")]
       public static extern short i8196f_get_mdi_status( byte bSlotNo, eSINGLE_AXIS eSingleAxis, ref ushort pwDIStatus );

       [DllImport("i8196F.dll", EntryPoint = "i8196f_get_servo_on_status")]
       public static extern short i8196f_get_servo_on_status( byte bSlotNo, eSINGLE_AXIS eSingleAxis, ref eCHANNEL_STATE peServoOn);

       [DllImport("i8196F.dll", EntryPoint = "i8196f_get_servo_erc_status")]
       public static extern short i8196f_get_servo_erc_status( byte bSlotNo, eSINGLE_AXIS eSingleAxis, ref eCHANNEL_STATE peServoErc);

       [DllImport("i8196F.dll", EntryPoint = "i8196f_get_servo_almrst_status")]
       public static extern short i8196f_get_servo_almrst_status( byte bSlotNo, eSINGLE_AXIS eSingleAxis, ref eCHANNEL_STATE peServoAlarm);

       [DllImport("i8196F.dll", EntryPoint = "i8196f_get_general_di")]
       public static extern short i8196f_get_general_di( byte bSlotNo, eGENERAL_DI eDiChannelNo, ref eCHANNEL_STATE peOnOff);

       [DllImport("i8196F.dll", EntryPoint = "i8196f_set_general_do")]
       public static extern short i8196f_set_general_do( byte bSlotNo, eGENERAL_DO eDoChannelNo, eCHANNEL_STATE eOnOff );

       [DllImport("i8196F.dll", EntryPoint = "i8196f_get_general_do")]
       public static extern short i8196f_get_general_do( byte bSlotNo, eGENERAL_DO eDoChannelNo, ref eCHANNEL_STATE peOnOff);

       [DllImport("i8196F.dll", EntryPoint = "i8196f_get_all_general_di")]
       public static extern short i8196f_get_all_general_di( byte bSlotNo, ref ushort pwMultiGdiStatus);

       [DllImport("i8196F.dll", EntryPoint = "i8196f_set_all_general_do")]
       public static extern short i8196f_set_all_general_do(byte bSlotNo, ushort wMultiGdoStatus);

       [DllImport("i8196F.dll", EntryPoint = "i8196f_get_all_general_do")]
       public static extern short i8196f_get_all_general_do( byte bSlotNo, ref ushort pwMultiGdoStatus);


    }	
}