# PCI-8372+/8366+ cPCI-8312H

# SSCNET Motion Control Card Function Library

Manual Rev. 2.02

Revision Date: June 13, 2008

Part No: 50-1H002-1020

![The image displays the universal recycling symbol. It features three stylized white arrows arranged in a triangular loop against a solid black circular background. The arrows point in a clockwise direction and have a segmented, track-like appearance along their outer edges. There is no text in the image.](.sscnet-function-library-50-1h002-1020-202/e2ea1f414127ff423eae631efcbb31781451a3ba4eb9f00d0177bbc1f5786ab2.jpg)
Recycled Paper

Copyright 2008 ADLINK TECHNOLOGY INC.

All Rights Reserved.

The information in this document is subject to change without prior notice in order to improve reliability, design, and function and does not represent a commitment on the part of the manufacturer.

In no event will the manufacturer be liable for direct, indirect, special, incidental, or consequential damages arising out of the use or inability to use the product or documentation, even if advised of the possibility of such damages.

This document contains proprietary information protected by copyright. All rights are reserved. No part of this manual may be reproduced by any mechanical, electronic, or other means in any form without prior written permission of the manufacturer.

# Trademarks

Product names mentioned herein are used for identification purposes only and may be trademarks and/or registered trademarks of their respective companies.

# Getting Service from ADLINK

Customer Satisfaction is top priority for ADLINK Technology Inc. Please contact us should you require any service or assistance.

# ADLINK TECHNOLOGY INC.

Web Site: http://www.adlinktech.com

Sales & Service: Service@adlinktech.com

TEL: +886-2-82265877

FAX: +886-2-82265717

Address: 9F, No. 166, Jian Yi Road, Chungho City,

Taipei, 235 Taiwan

Please email or FAX this completed service form for prompt and satisfactory service.

<table><tr><td colspan="2">Company Information</td></tr><tr><td>Company/Organization</td><td></td></tr><tr><td>Contact Person</td><td></td></tr><tr><td>E-mail Address</td><td></td></tr><tr><td>Address</td><td></td></tr><tr><td>Country</td><td></td></tr><tr><td>TEL</td><td>FAX:</td></tr><tr><td>Web Site</td><td></td></tr><tr><td colspan="2">Product Information</td></tr><tr><td>Product Model</td><td></td></tr><tr><td>Environment</td><td>OS:M/B: CPU:Chipset: Bios:</td></tr></table>

Please give a detailed description of the problem(s):

# Table of Contents

# Table of Contents...... i

# List of Tables...... iii

# 1 SSCNET Function Library .... 1

1.1 SSCNET Function List.... 2
1.2 C/C++ Programming Library 7

Data Type 7
Card Indexing 8
Axis Indexing 9

1.3 System Functions 10
1.4 Motion Functions 16

Single Motion - Single axis velocity move 16
Single Motion - Single axis P to P motion 19
Single Motion - Multi axes velocity move 25
Single Motion - Multi axes P to P motion 29
Single Motion - Speed Change on the fly 36
Single Motion - Multi axes linear interpolation 42
Single Motion - Multi axes circular interpolation ..... 49
Home Move 56
Continuous Motion - Start/End motion list 59
Continuous Motion - Add linear trajectory 62
Continuous Motion - Add arc trajectory 68
Continuous Motion - Add dwell 80
Continuous Motion - Smooth trajectory 82
Continuous Motion - Start/Stop command 84

1.5 Motion Related I/O Function 86

Position control and feedback 86
Velocity Feedback 91
Motion DIO Status 93
Software Limit 98
Motion Status 101
Frame Management 105

1.6 General-purposed IO Function 107

Encoder 107
DIO 112
DA 116
AD 119

Analog Auto Calibration 121

1.7 Driver Management Function.... 126

Driver Parameter 126

Data Monitoring 131

Servo information 141

Servo ON 143

Driver information 145

Alarm reset 148

1.8 Control Gain Tuning.... 150

1.9 Interrupt Control Function 159

1.10 Position Compare Function.... 166

1.11 Interlock Function.... 172

1.12 Absolute Position System 175

1.13 Pulse Output Control.... 179

1.14 Sequence Motion Control 181

1.15 Auto Stop Protection Function 188

2 Appendix.... 191

2.1 MR-J2S-B Alarm List 191

2.2 MR-J2S-B Warning List 193

2.3 Driver parameter List 194

2.4 Function Response Time 196

Warranty Policy 201

# List of Tables

Table 1-1: SSCNET Function List .... 2

Table 1-2: Data Types 7

Table 1-3: Axis Index 9

Table 1-4: Motion Status 102

Table 1-5: Axis Status 102

Table 1-6: IPT Modes 109

Table 1-7: Channel\_# Definitions 132

Table 1-8: set\_monitor\_config Settings 134

Table 1-9: Mode Values 151

Table 1-10: RSP Tuning Settings 153

Table 1-11: Notch Depth 154

Table 1-12: IntFactor Bits for Source 0-11 160

Table 1-13: IntFactor Bits for Source 12 160

Table 1-14: IntFactor Bits for Source 13 161

Table 2-1: MR-J2S-B Alarm List 191

Table 2-2: MR-J2S-B Warning List 193

Table 2-3: Driver parameter List 194

Table 2-4: Function Response Time 196

# 1 SSCNET Function Library

This chapter describes the software functions in detail for the SSCNET Series cards. Users can use these functions to develop application programs in C, Visual Basic or C++ programming languages. If Delphi is used as the programming environment, it is necessary to transform the header file, MDSP.h, manually.

# 1.1 SSCNET Function List

<table><tr><td>Category</td><td>Section</td><td>Function</td></tr><tr><td rowspan="8">System Function</td><td rowspan="8">1.3</td><td>error_msg(ErrorNo, *ErrorMsg)</td></tr><tr><td>MDSP_initial(CardIDType,CardNo)</td></tr><tr><td>MDSP_close(CardID)</td></tr><tr><td>MDSP_reset(CardID)</td></tr><tr><td>get_base_addr(CardID, *BaseAddr)</td></tr><tr><td>get_irq_number(CardID, *IrqNo)</td></tr><tr><td>understand_mdsp(CardID, *Version, *Date)</td></tr><tr><td>get_version_info(CardID, *Hardware, *Software_DLL, *Software_Driver</td></tr></table>

Table 1-1: SSCNET Function List

<table><tr><td colspan="3">Category</td><td>Section</td><td>Function</td></tr><tr><td rowspan="45">Motion Command</td><td rowspan="25">Single motion</td><td rowspan="2">Single axis velocity move</td><td rowspan="45">1.4</td><td>tv_move(Axis, StrVel, MaxVel, Tacc)</td></tr><tr><td>sv_move(Axis, StrVel, MaxVel, Tacc, Tlacc)</td></tr><tr><td rowspan="4">Single axis P to P motion</td><td>start_tr_move(Axis, Dist, StrVel, MaxVel, FinVel, Tacc, Tdec)</td></tr><tr><td>start_sr_move(Axis, Dist, StrVel, MaxVel, FinVel, Tacc, Tdec, Tlacc, Tldec)</td></tr><tr><td>start_ta_move(Axis, Pos, StrVel, MaxVel, FinVel, Tacc, Tdec)</td></tr><tr><td>start_sa_move(Axis, Pos, StrVel, MaxVel, FinVel, Tacc, Tdec, Tlacc, Tldec)</td></tr><tr><td rowspan="2">Multi axes velocity move</td><td>tv_move_all(Length, *Axis, *StrVel, *MaxVel, *Tacc)</td></tr><tr><td>sv_move_all(Length, *Axis, *StrVel, *MaxVel, *Tacc, *Tlacc)</td></tr><tr><td rowspan="4">Multi axes P to P</td><td>start_tr_move_all(Length, *Axis, *Dist, *StrVel, *MaxVel, *FinVel, *Tacc, *Tdec)</td></tr><tr><td>start_sr_move_all(Length, *Axis, *Dist, *StrVel, *MaxVel, *FinVel, *Tacc, *Tdec, *Tlacc, *Tldec)</td></tr><tr><td>start_ta_move_all(Length, *Axis, *Pos, *StrVel, *MaxVel, *FinVel, *Tacc, *Tdec)</td></tr><tr><td>start_sa_move_all(Length, *Axis, *Pos, *StrVel, *MaxVel, *FinVel, *Tacc, *Tdec, *Tlacc, *Tldec)</td></tr><tr><td></td><td>tv_change(Axis, SpeedFactor, Tacc)</td></tr><tr><td></td><td>sv_change(Axis, SpeedFactor, Tacc.)</td></tr><tr><td></td><td>tv_stop(Axis, Tdec)</td></tr><tr><td></td><td>sv_stop(Axis, Tdec)</td></tr><tr><td></td><td>emg_stop(Axis)</td></tr><tr><td rowspan="4">Multi axes linear interpolation</td><td>start_line_tr_move(Length, *AxisArray, *DistArray, StrVel, MaxVel, FinVel, Tacc, Tdec)</td></tr><tr><td>start_line_sr_move(Length, *AxisArray, *DistArray, StrVel, MaxVel, FinVel, Tacc, Tdec, Tlacc, Tldec)</td></tr><tr><td>start_line_ta_move(Length, *AxisArray, *PosArray, StrVel, MaxVel, FinVel, Tacc, Tdec)</td></tr><tr><td>start_line_sa_move(Length, *AxisArray, *PosArray, StrVel, MaxVel, FinVel, Tacc, Tdec, Tlacc, Tldec)</td></tr><tr><td rowspan="4">Circular interpolation</td><td>start_arct_tr_move(*AxisArray, *CenterArray, Angle, StrVel, MaxVel, FinVel, Tacc, Tdec)</td></tr><tr><td>start_arct_sr_move(*AxisArray, *CenterArray, Angle, StrVel, MaxVel, FinVel, Tacc, Tdec, Tlacc, Tldec)</td></tr><tr><td>start_arct_ta_move(*AxisArray, *CenterArray, Angle, StrVel, MaxVel, FinVel, Tacc, Tdec)</td></tr><tr><td>start_arct_sa_move(*AxisArray, *CenterArray, Angle, StrVel, MaxVel, FinVel, Tacc, Tdec, Tlacc, Tldec)</td></tr><tr><td rowspan="2" colspan="2">Home move</td><td>home_move(Axis, StrVel, MaxVel, Tacc)</td></tr><tr><td>set_home_mode(Axis, HomeMode)</td></tr><tr><td rowspan="18">Continuous motion</td><td rowspan="3">Start / End motion list</td><td>start_motion_list(Length, *AxisArray)</td></tr><tr><td>end_motion_list(void)</td></tr><tr><td>repeat_last_move(Axis)</td></tr><tr><td rowspan="4">Add linear trajectory</td><td>add_line_tr_move(*DistArray, StrVel, MaxVel, FinVel, Tacc, Tdec)</td></tr><tr><td>add_line_sr_move(*DistArray, StrVel, MaxVel, FinVel, Tacc, Tdec, Tlacc, Tldec)</td></tr><tr><td>add_line_ta_move(*PosArray, StrVel, MaxVel, FinVel, Tacc, Tdec)</td></tr><tr><td>add_line_sa_move(*PosArray, StrVel, MaxVel, FinVel, Tacc, Tdec, Tlacc, Tldec)</td></tr><tr><td rowspan="8">Add arc trajectory</td><td>add_arct_tr_move(*CenterArray, Angle, StrVel, MaxVel, FinVel, Tacc, Tdec)</td></tr><tr><td>add_arct_sr_move(*CenterArray, Angle, StrVel, MaxVel, FinVel, Tacc, Tdec, Tlacc, Tldec)</td></tr><tr><td>add_arct_ta_move(*CenterArray, Angle, StrVel, MaxVel, FinVel, Tacc, Tdec)</td></tr><tr><td>add_arct_sa_move(*CenterArray, Angle, StrVel, MaxVel, FinVel, Tacc, Tdec, Tlacc, Tldec)</td></tr><tr><td>add_arct2_sa_move(*AxisArray, *CenterPosArray, Angle, StrVel, MaxVel, FinVel, Tacc, Tlacc, Tdec, Tldec)</td></tr><tr><td>add_arct2_sr_move(*AxisArray, *CenterDistArray, Angle, StrVel, MaxVel, FinVel, Tacc, Tlacc, Tdec, Tldec);</td></tr><tr><td>add_arct2_ta_move(*AxisArray, *CenterPosArray, Angle, StrVel, MaxVel, FinVel, Tacc, Tdec);</td></tr><tr><td>add_arct2_tr_move(*AxisArray, *CenterDistArray, Angle, StrVel, MaxVel, FinVel, Tacc, Tdec);</td></tr><tr><td>Dwell</td><td>add_dwell(Sec)</td></tr><tr><td>Smooth Trajectory</td><td>smooth_enable(Flag, R)</td></tr><tr><td>Start/Sop command</td><td>start_cont_move(Void)</td></tr></table>

Table 1-1: SSCNET Function List

<table><tr><td colspan="3">Category</td><td>Section</td><td>Function</td></tr><tr><td rowspan="23">Motion related I/O</td><td rowspan="7" colspan="2">Position control and feedback</td><td rowspan="23">1.5</td><td>get_position(Axis, *Pos_F, *Pos_C)</td></tr><tr><td>set_position(Axis, Pos)</td></tr><tr><td>get_fb_position(Axis, *Pos_F)</td></tr><tr><td>get_target_pos(Axis, *TargetPos)</td></tr><tr><td>get_move_ratio(Axis, *PulsePerMM)</td></tr><tr><td>set_move_ratio(Axis, PulsePerMM)</td></tr><tr><td>shift_position(AxisNo, shiftMM)</td></tr><tr><td rowspan="2" colspan="2">Velocity feedback</td><td>get_velocity(Axis, *Vel_F, *Vel_C)</td></tr><tr><td>get_cnt_speed(CardId, EncNo, *PPS)</td></tr><tr><td rowspan="8" colspan="2">Motion DIO status</td><td>set_PEL_config(Axis, Logic, mode)</td></tr><tr><td>set_MEL_config(Axis, Logic, mode)</td></tr><tr><td>set_ORG_config(Axis, Logic)</td></tr><tr><td>set_EMG_config(CardID, Logic)</td></tr><tr><td>get_PEL_status(Axis, *status)</td></tr><tr><td>get_MEL_status(Axis, *status)</td></tr><tr><td>get_ORG_status(Axis, *status)</td></tr><tr><td>get_EMG_status(CardID, *status)</td></tr><tr><td rowspan="2" colspan="2">Software Limit</td><td>set_soft_limit(Axis, PLimit, Mlimit, ON_OFF)</td></tr><tr><td>get_soft_limit(Axis, *PLimit, *Mlimit, *ON_OFF)</td></tr><tr><td rowspan="3" colspan="2">Motion status</td><td>motion_status(Axis, *MotionStatus)</td></tr><tr><td>axis_status(Axis, *AxisStatus)</td></tr><tr><td>motion_done(Axis)</td></tr><tr><td></td><td></td><td>frame_to_execute(Axis, *Len)</td></tr><tr><td rowspan="20">General Purpose IO</td><td rowspan="6" colspan="2">Encoder</td><td rowspan="20">1.6</td><td>set_cnt_iptmode(CardID, EncNo, IptMode)</td></tr><tr><td>set_cnt_to_axis(CardID, EncNo, Axis, Resolution)</td></tr><tr><td>set_cnt_value(CardID, EncNo, Value)</td></tr><tr><td>get_cnt_value(CardID, EncNo, *Value)</td></tr><tr><td>get_ring_counter(CardID, ExtCntNo, *RingValue)</td></tr><tr><td>set_ring_counter(CardID, ExtCntNo, RingValue)</td></tr><tr><td rowspan="4" colspan="2">DIO</td><td>get_di_status(CardID, ChNo, *Sts)</td></tr><tr><td>set_do_value(CardID, ChNo, Value)</td></tr><tr><td>set_di_mode(CardID, DI_Channel, DI_Mode, ActiveL)</td></tr><tr><td>set_mio_mode(CardID, DI_Ch, Mode)</td></tr><tr><td rowspan="2" colspan="2">DA</td><td>set_da_config(CardID, ChNo, Cfg)</td></tr><tr><td>set_da_value(CardID, ChNo, Value)</td></tr><tr><td rowspan="2" colspan="2">AD</td><td>set_ad_function(CardID, Enable, AD_Gain, AD_Last, AD2_SRC)</td></tr><tr><td>get_ad_value(CardID, ChNo, *Value)</td></tr><tr><td rowspan="6" colspan="2">Analog auto calibration</td><td>tune_ref_5v(CardID, Value)</td></tr><tr><td>save_auto_k_value(Cardid, Channel, Value)</td></tr><tr><td>get_auto_k_value(Cardid, Channel, *Value)</td></tr><tr><td>tune_ad_offset_gain(Cardid, Step, Value)</td></tr><tr><td>tune_da_offset(Cardid, Step, Value)</td></tr><tr><td>reload_auto_k_setting(CardID)</td></tr></table>

Table 1-1: SSCNET Function List

<table><tr><td colspan="2">Category</td><td>Section</td><td>Function</td></tr><tr><td rowspan="18">Driver Management</td><td rowspan="6">Driver parameters</td><td rowspan="18">1.7</td><td>get_servo_para(Axis, ParaNo,*Value)</td></tr><tr><td>set_servo_para(Axis, ParaNo, Value)</td></tr><tr><td>get_servo_para_all(Axis, *Value)</td></tr><tr><td>set_servo_para_all(Axis, *Value)</td></tr><tr><td>save_servo_para(Axis)</td></tr><tr><td>set_servo_para_default(Axis)</td></tr><tr><td rowspan="6">Data Monitoring</td><td>get_monitor_data(Axis, *Data)</td></tr><tr><td>get_instant_monitor_data(Axis,*Data_0,*Data_1,*Data_2, *Data_3)</td></tr><tr><td>start_monitor(Axis)</td></tr><tr><td>check_monitor_ready(Axis, *status)</td></tr><tr><td>set_monitor_channel(Axis, Channel_0, Channel_1, Channel_2, Channel_3)</td></tr><tr><td>set_monitor_config(Axis, Trigger_Select, Trigger_Level, SamplePeriod, PreTriggerSampleNo, Sample-Number)</td></tr><tr><td>Servo information</td><td>get_servo_info(Axis,*Servolinfo)</td></tr><tr><td>Servo ON</td><td>set_servo_on(Axis,ON_OFF)</td></tr><tr><td rowspan="2">Driver information</td><td>understand_driver(I16 Axis, U16 *Class_Code)</td></tr><tr><td>understand_motor(Axis, *MotorType, *Capacity, *RateRPM, *RateCurrent, *MaxRPM, *MaxTorq, *PPR, *ENCInfo, *OptionalInfor)</td></tr><tr><td rowspan="2">Alarm</td><td>Get_alarm_no(Axis,*AlarmNo)</td></tr><tr><td>alarm_reset(Axis)</td></tr><tr><td rowspan="8" colspan="2">Control Gain Tuning</td><td rowspan="8">1.8</td><td>set_auto_tune(Axis, Mode, RSP, GD2)</td></tr><tr><td>get_auto_tune(Axis, *Mode, *RSP, *GD2)</td></tr><tr><td>set_control_gain(Axis, PG1, VG1, VIC,PG2, VG2, FFC)</td></tr><tr><td>get_control_gain(Axis, *PG1, *VG1, *VIC, *PG2, *VG2, *FFC)</td></tr><tr><td>set_notch_filter(Axis, Mode, NotchFrequency, NotchDepth)</td></tr><tr><td>get_notch_filter(Axis, *Mode, *NotchFrequency, *NotchDepth)</td></tr><tr><td>set_LP_filter(Axis,ON_OFF)</td></tr><tr><td>get_LP_filter(Axis,*ON_OFF)</td></tr><tr><td rowspan="7" colspan="2">Interrupt Control</td><td rowspan="7">1.9</td><td>int_control(CardID, Flag)</td></tr><tr><td>set_int_factor(CardID, Source, IntFactor)</td></tr><tr><td>get_int_status(CardID, Source, *IntStatus)</td></tr><tr><td>set_int_event(CardID,*HEvent)</td></tr><tr><td>link_interrupt(CardID, *callbackAddr )</td></tr><tr><td>clear_tlc_int(Axis)</td></tr><tr><td>set_timer_interval(CardID, Sec)</td></tr><tr><td rowspan="9" colspan="2">Position Compare</td><td rowspan="9">1.10</td><td>set_compare(Axis,CMP1Pos,CMP1Dir,CMP2Pos,CMP2Dir)</td></tr><tr><td>check_compare(Axis, *status)</td></tr><tr><td>set_single_compare(Axis,Channel,CMP_Pos)</td></tr><tr><td>map_dout_andComparator(CardID,DOut_Ch,AxisNo, CompNo, DOut_mode)</td></tr><tr><td>set_compare_table_dir(CardID, Table_ChNo, Dir)</td></tr><tr><td>link_dout_and_compare_table(CardID, DO_ChNo, StartI, EndI, *TableData)</td></tr><tr><td>set_ext_encoder_compare_method(CardID, EncNo, Mode)</td></tr><tr><td>set_ext_encoder_compare_value(CardID, EncNo,CompareValue)</td></tr><tr><td>set_compare_source</td></tr><tr><td rowspan="2" colspan="2">Inter Lock Function</td><td rowspan="2">1.11</td><td>set_interlock(CardID,Enable, Axis_X, Axis_Y, X1, X2, Y1, Y2)</td></tr><tr><td>get_interlock(CardID, *Enable, *Axis_X, *Axis_Y, *X1, *X2, *Y1, *Y2)</td></tr><tr><td rowspan="3" colspan="2">Absolute Position Control</td><td rowspan="3">1.12</td><td>get_abs_position(Axis, *ABS_Pos)</td></tr><tr><td>save_abs_position(Axis)</td></tr><tr><td>clear_abs_data_on_flash(CardID)</td></tr><tr><td colspan="2">Pulse Output Control</td><td>1.13</td><td>set_pulse_output_control(Axis, Enable, PulseCH, Mode)</td></tr></table>

Table 1-1: SSCNET Function List

<table><tr><td>Category</td><td>Section</td><td>Function</td></tr><tr><td rowspan="15">Sequence Motion Control</td><td rowspan="15">1.14</td><td>add_frame_ta_move(Axis,StartFrameNo,StartPos,EndPos,StartVel,MaxVel,FinVel,Tacc,Tdec);</td></tr><tr><td>add_frame_dwell(Axis,StartFrameNo, DTime);</td></tr><tr><td>get_pattern(CardID,PatternNo,*FirstFrame,*TotalFrame,*SyncAxes);</td></tr><tr><td>insert_pattern_to_seq_buffer</td></tr><tr><td>set_pattern(CardID,PatternNo,FirstFrame,TotalFrame,SyncAxes);</td></tr><tr><td>insert_pattern_to_seq_buffer(CardID,SeqNo,PatternNo,StartCondition,SyncAxes);</td></tr><tr><td>check_seq_buffer(CardID,SeqNo,*Begin,*End);</td></tr><tr><td>start_seq_move(CardID,SeqNo);</td></tr><tr><td>reset_seq_buffer(CardID,SeqNo);</td></tr><tr><td>pause_seq_move(CardID,SeqNo,Dec_Time);</td></tr><tr><td>resume_seq_move(CardID,SeqNo,Acc_Time);</td></tr><tr><td>end_seq_move</td></tr><tr><td>set_seq_sync_pause</td></tr><tr><td>check_seq_buffer_index</td></tr><tr><td>check_seq_buffer_empty_count</td></tr><tr><td>Auto Stop Function</td><td>1.15</td><td>set_pos_diff_stop(CardID,Enable,PosDiffCheckSetNo_0_To_5,Axis_X,Axis_Y,UpperLimit,LowerLimit)</td></tr></table>

Table 1-1: SSCNET Function List

# 1.2 C/C++ Programming Library

# 1.2.1 Data Type

This section gives details of all the functions. The function prototypes and some common data types are declared in MDSP.h. These data types are used by the PCI-83XX Series library. We suggest you to use these data types in your application programs. The following table shows the data type names and their range.

<table><tr><td>Type Name</td><td>Description</td><td>Range</td></tr><tr><td>U8</td><td>8-bit ASCII character</td><td>0 to 255</td></tr><tr><td>I16</td><td>16-bit signed integer</td><td>-32768 to 32767</td></tr><tr><td>U16</td><td>16-bit unsigned integer</td><td>0 to 65535</td></tr><tr><td>I32</td><td>32-bit signed long integer</td><td>-2147483648 to 2147483647</td></tr><tr><td>U32</td><td>32-bit unsigned long integer</td><td>0 to 4294967295</td></tr><tr><td>F32</td><td>32-bit single-precision floating-point</td><td>-3.402823E38 to 3.402823E38</td></tr><tr><td>F64</td><td>64-bit double-precision floating-point</td><td>-1.797683134862315E308 to 1.797683134862315E309</td></tr><tr><td>Boolean</td><td>Boolean logic value</td><td>TRUE, FALSE</td></tr></table>

Table 1-2: Data Types

# 1.2.2 Card Indexing

MDSP\_initial() is used to initialize the SSCNET motion control card and register it to the system. Users must give this function a card type and card number parameters. The card type could be any of SSCNet model name. The card number is indexing from 0. This function will return a signed 16-bit integer. If the return value is negative, it means an error happens. Please lookup the error code table to understand it. If it is a non-negative value, it contents two pieces of information inside this value. The lower 8-bit is "CardID", which represents this card and the upper 8-bit is total axes found on this card.

The range of “CardID” is from 0 to 31. Each physical card has its own “CardID”. Many functions need this “CardID” as the input parameter.

# 1.2.3 Axis Indexing

Axis index is according to the "CardID" and card type. Each card type has its maximum amount of axes to be connected. For example, PCI-8372+ can be connected up to 12 axes and PCI-8366+ can be connected up to 6 axes. If the PCI-8372+ gets CardID=0, the axis indexing range is from 0 to 11. If the PCI-8372+ gets CardID=1, the axis index range is from 12 to 23. No matter if there is an axis connected, the axis index will be occupied. The CardID's indexing order depends on the calling order of MDSP\_initial() in user's program. For example, we have 3 PCI-8372+ and 2 PCI-8366+ on the system and users place an initialization sequence as followings.

```txt
MDSP_initial(PCI_8372+, 0); // CardID=0
MDSP_initial(PCI_8366+, 0); // CardID=1
MDSP_initial(PCI_8372+, 1); // CardID=2
MDSP_initial(PCI_8372+, 2); // CardID=3
MDSP_initial(PCI_8366+, 1); // CardID=4
```

Then the card index and axis index would be:

<table><tr><td>Card Type</td><td>MDSP_initial() Card Number</td><td>MDSP_initial() Card ID Return</td><td>Maximum axes per card</td><td>Axis index in this system</td></tr><tr><td>PCI-8372+</td><td>0</td><td>0</td><td>12</td><td>0-11</td></tr><tr><td>PCI-8366+</td><td>0</td><td>1</td><td>6</td><td>12-17</td></tr><tr><td>PCI-8372+</td><td>1</td><td>2</td><td>12</td><td>18-29</td></tr><tr><td>PCI-8372+</td><td>2</td><td>3</td><td>12</td><td>30-41</td></tr><tr><td>PCI-8366+</td><td>1</td><td>4</td><td>6</td><td>42-47</td></tr></table>

Table 1-3: Axis Index

Note: The Card number is PCI slot dependent.

# 1.3 System Functions

# @ Name

error\_msg(ErrorNo, \*ErrorMsg) - Copy error message to buffer

MDSP\_initial(CardType, CardNo) - Card Initialization

MDSP\_close(CardID) - Card Close

MDSP\_reset(CardType, CardNo) - Software reset

config\_from\_file(\*Filename) - Configure card according to configuration file

get\_base\_addr(CardID, \*BaseAddr) - Get the base address of this card

get\_irq\_number(CardID, \*IrqNo) - Get the IRQ number of this card

understand\_mdsp(CardID, \*Version, \*Date) - Get on board DSP kernel code's version information

get\_version\_info(CardID, \*Hardware, \*Software\_DLL, \*Software\_Driver)

# @ Description

error\_msg:

This function copy error message of specified error number into buffer.

MDSP\_initial:

This function is used to initialize SSCNet series card. Every application program must call this before any other functions can be used. If the initialization is executed successfully, it returns a positive value. The lower 8-bit is the 'CardID' for this card, which will be used for thereafter function calls. The upper 8-bit is the total axis number found in this board.

MDSP\_close:

This function is used to release all resource used by this card. This function is only to be used when users' program ends. After calling this function. The LEDs on the panel will be turn off. If the card is not closed properly, the LEDs will flash continuously. If users try to re-initial this card by MDSP\_initial(), the axes could not be found.

# MDSP\_reset:

By calling this function, the will be reset just as system is powered on.

# config\_from\_file:

This function is used to load the configuration file created by Motion Creator utility. This file will be saved automatically into Windows' system directory and the file name is MDSP.INI.

# get\_base\_addr:

This function is used to get the card's base address.

# get\_irq\_number:

This function is used to get the card's IRQ number.

# understand\_mdsp:

This function is used to get the version number and the built date on board DSP kernel firmware.

# get\_version\_info:

This function is used to get the board's version information

# @ Syntax

# C/C++ (Windows)

```csv
I16 error_msg(I16 ErrorNo, char *ErrorMsg)
I16 MDSP_initial(I16 CardType, CardNo)
I16 MDSP_close(I16 Card)
I16 MDSP_reset(I16 CardType, I16 CardNo)
I16 config_from_file(char *Filename)
I16 get_base_addr(I16 Card, U16 *BaseAddr)
I16 get_irq_number(I16 Card, U16 *IrqNo)
I16 understand_mdsp(I16 Card, U32 *Version, U32 *Date)
I16 get_version_info(I16 CardID, I32 *hardware, I32 *Software_DLL, I32* Software_driver)
```

Visual Basic (Windows)
```txt
error_msg (ByVal ErrorNo As Integer, ErrorMsg As Byte) As Integer
MDSP_initial (ByVal CardType As Integer, ByVal CardNo As Integer) As Integer
MDSP_close (ByVal Card As Integer) As Integer
MDSP_reset (ByVal CardType As Integer, ByVal Card As Integer) As Integer
config_from_file(ByVal Filename as String) As Integer
get_base_addr (ByVal Card As Integer, BaseAddr As Integer) As Integer
get_irq_number (ByVal Card As Integer, IrqNo As Integer) As Integer
understand_mdsp (ByVal Card As Integer, Version As Long, BuiltDate As Long) As Integer
get_version_info(ByVal CardID As Integer, hardware As Long, Software_DLL As Long, Software_driver As Long) As Integer
```

# @ Arguments

AxisNo: AxisNo of system

ErrorNo: Error number

\*ErrorMsg: Error message string

CardID: The SSCNet series card index number.

\*DSP: The data structure that carry environment information of PCI-83XX Series card.

\*IrqNo: Irq number of specified PCI-83XX Series card.

\*BaseAddr: base address of specified PCI-83XX Series card

\*Filename: The specified filename recording the configuration of PCI-83XX Series. This file must be created by Motion Creator of PCI-83XX Series.

\*Version: The version number of PCI-83XX Series firmware.

\*Date: The built date of PCI-83XX Series firmware.

\*hardware: Hardware version of this board

\*Software\_DLL: Running DLL version

\*Software\_Driver: Running device driver version

# @ Return Code

```txt
ERROR_NoError
ERROR_Dll_Opened_By_Other_Process
ERROR_Card_Not_Ready
ERROR_Card_Not_Initial
ERROR_PCIBios_Not_Exist
ERROR_Card_Reinitialized
ERROR_Card_Not_Exist
ERROR_Card_Not_Accessible
ERROR_Card_Not_Ready
ERROR_DSP_Not_Ready
ERROR_DSP_Initial_Time_Out
```

Note: The return code of MDSP\_initial: If the return code is equal or greater than 0, it contents the information of total axes found while initializing. The total axis number is placed in upper 8-bit. Users can get this information from the upper 8 bits of the return code. The lower 8-bit is the CardID.

# @ Example

```txt
&lt;C/C++&gt;
```

error\_msg
```txt
char buff[255];
I16 RetCode;
RetCode = MDSP_83XX_initial(0)
error_msg(RetCode, buff);
```
MDSP\_initial

```c
I16 CardID;
for(int j = 0 ; j&lt;12; j++)
    CardID = MDSP_initial(PCI_83XX, j);
```
MDSP\_close

```txt
I16 RetCode;
RetCode = MDSP_close(0);
```
MDSP\_reset

```txt
I16 RetCode;
RetCode = MDSP_reset(0);
```

```txt
config_from_file
```

```txt
I16 RetCode;
RetCode =
    config_from_file("c:\windows\system32\mdsp.ini");
```

get\_base\_addr
```txt
I16 RetCode;
U16 Addr;
RetCode = get_base_addr(0, &Addr);
```
get\_irq\_number

```txt
I16 RetCode;
U16 Irq;
RetCode = get_irq_number(0, &Irq);
```
understand\_mdsp

```txt
I16 RetCode;
U32 Version, Date;
RetCode = understand_mdsp(0, &Version, &Date);
```
&lt;Visual Basic&gt;

error\_msg
```txt
Dim i As Integer
Dim ErrorMsg(0 To 255) As Byte
Dim MsgString As String
error_msg ReturnCode, ErrorMsg(0) ' Get error message
For i = 0 To 255
MsgString = MsgString + Chr(ErrorMsg(i))
If ErrorMsg(i) = 0 Then Exit For
Next i
MsgBox MsgString
```

MDSP\_initial
```txt
Dim RetCode As Integer
Dim i As Integer
For i = 0 To 11
RetCode = MDSP_initial(PCI_83XX, j)
If RetCode <> 0 Then Exit For
Next i
```

MDSP\_close
```txt
Dim RetCode As Integer
```

```autoit
RetCode = MDSP_close(0)
```
MDSP\_reset

```txt
Dim RetCode As Integer
```

```txt
RetCode = MDSP_reset(0)
```
config\_from\_file

```txt
Dim RetCode As Integer
```

```txt
Dim FileStream As String
```

```powershell
FileString = "c:\windows\system32\mdsp.ini"
```

```txt
RetCode = config_from_file(FileString)
```
get\_base\_addr

```txt
Dim RetCode As Integer
```

```txt
Dim Addr As Integer
```

```python
RetCode = get_base_addr(0, Addr)
```

get\_irq\_number
```txt
Dim RetCode As Integer
```

```txt
Dim IrqNo As Integer
```

```txt
RetCode = get_irq_number(0, IrqNo)
```
understand\_mdsp

```txt
Dim RetCode As Integer
```

```txt
Dim Version As Long, Date1 As Long
```

```autohotkey
RetCode = understand_mdsp(0, Version, Date1)
```

# 1.4 Motion Functions

# 1.4.1 Single Motion - Single axis velocity move

# @ Name

tv\_move(Axis, StrVel, MaxVel, Tacc) – Accelerate an axis to a constant velocity with trapezoidal profile

sv\_move(Axis, StrVel, MaxVel, Tacc, Tlacc) -Accelerate an axis to a constant velocity with S-curve profile

# @ Description

tv\_move :

This function is to accelerate an axis to the specified constant velocity with trapezoidal profile. The axis will continue to travel at a constant velocity until the velocity is changed or the axis is commanded to stop. The sign of velocity parameter determines the direction.

sv\_move:

This function is to accelerate an axis to the specified constant velocity with S-curve profile. The axis will continue to travel at a constant velocity until the velocity is changed or the axis is commanded to stop. The sign of velocity parameter determines the direction.

# @ Syntax

# C/C++ (Windows)

I16 tv\_move(I16 Axis, F64 StrVel, F64 MaxVel, F64 Tacc)

I16 sv\_move(I16 Axis, F64 StrVel, F64 MaxVel, F64 Tacc)

# Visual Basic (Windows)

tv\_move (ByVal Axis As Integer, ByVal StartVel As Double, ByVal MaxVel As Double, ByVal Tacc As Double) As Integer
sv\_move (ByVal Axis As Integer, ByVal StartVel As Double, ByVal MaxVel As Double, ByVal Tacc As Double, ByVal Tlacc As Double) As Integer

# @ Arguments

Axis: Axis index designated to move.

StrVel: starting velocity in unit of mm per second

MaxVel: maximum velocity in unit of mm per second

Tacc: specified total acceleration time in unit of second

Tlacc: specified linear acceleration time in unit of second

# @ Return Code

```csv
ERROR_NoError
ERROR_Dll_Opened_By_Other_Process
ERROR_Wrong_Axis_Number
ERROR_Card_Not_Ready
ERROR_Card_Not_Initial
ERROR_DSP_Not_Ready
ERROR_Axis_Not_In_Control
ERROR_Axis_Servo_Alarm
ERROR_Axis_Is_Not_Ready_ON
ERROR_Axis_Is_Not_Servo_ON
ERROR_Invalid_MaxVelocity
ERROR_Axis_Hand_Shake_Failed
ERROR_Axis_Not_Response
ERROR_Axis_Prepare_For_Motion
ERROR_Axis_Busy_For_Motion
ERROR_Axis_In_EMG_ON
```

# @ Example

```txt
&lt;C/C++&gt;
```

```txt
tv_move
```

```javascript
I16 RetCode;
F64 StartVel=0.0;
F64 MaxVel=10.0;
F64 Tacc = 0.5;
RetCode = tv_move(0, StartVel, MaxVel, Tacc);
```

```txt
sv_move
```

```javascript
I16 RetCode;
F64 StartVel=0.0;
F64 MaxVel=10.0;
```

```txt
F64 Tacc = 0.5;
F64 Tlacc = 0.1;
RetCode = sv_move(0, StartVel, MaxVel, Tacc, Tlacc);
```

# &lt;Visual Basic&gt;

tv\_move
```autohotkey
Dim RetCode As Integer
Dim StartVel As Double, MaxVel As Double, Tacc As Double
StartVel = 0#
MaxVel = 10#
Tacc = 0.5
RetCode = tv_move(0, StartVel, MaxVel, Tacc)
```

sv\_move
```vba
Dim RetCode As Integer
Dim StartVel As Double, MaxVel As Double, Tacc As Double
Dim Tacc As Double
StartVel = 0#
MaxVel = 10#
Tacc = 0.5
Tlacc = 0.1
RetCode = sv_move(0, StartVel, MaxVel, Tacc, Tlacc)
```

# 1.4.2 Single Motion - Single axis P to P motion

# @ Name

start\_tr\_move(Axis, Dist, StrVel, MaxVel, FinVel, Tacc, Tdec) – Begin a relative trapezoidal profile move

start\_sr\_move(Axis, Dist, StrVel, MaxVel, FinVel, Tacc, Tdec, Tlacc, Tldec) – Begin a relative S-curve profile move

start\_ta\_move(Axis, Pos, StrVel, MaxVel, FinVel, Tacc, Tdec) - Begin an absolute trapezoidal profile move

start\_sa\_move(Axis, Pos, StrVel, MaxVel, FinVel, Tacc, Tdec, Tlacc, Tldec) - Begin an absolute S-curve profile move

# @ Description

General: The sign of Pos or Dist parameter determines the moving direction. If the moving distance is too short to reach the specified maximum velocity, the controller will automatically lower the MaxVel, and the Tacc, Tdec, will also become shorter while the StrVel, FinVel, dV/dt (acceleration / deceleration) or d(dV/dt)/dt (jerk) keep unchanged.

# start\_tr\_move:

This function causes the axis to accelerate from a starting velocity, slew at constant velocity, and decelerate to stop at the relative distance with trapezoidal profile. The acceleration and deceleration time is specified independently. It won't let the program wait for motion completion but immediately return control to the program.

# start\_sr\_move:

This function causes the axis to accelerate from a starting velocity, slew at constant velocity, and decelerate to stop at the relative distance with S-curve profile. The acceleration and deceleration time is specified independently. It won't let the program wait for motion completion but immediately return control to the program.

# start\_ta\_move:

This function causes the axis to accelerate from a starting velocity, slew at constant velocity, and decelerate to stop at the specified absolute position with trapezoidal profile. The acceleration and deceleration time is specified independently. It won't let the program wait for motion completion but immediately return control to the program.

# start\_sa\_move:

This function causes the axis to accelerate from a starting velocity, slew at constant velocity, and decelerate to stop at the specified absolute position with S-curve profile. The acceleration and deceleration time is specified independently. It won't let the program wait for motion completion but immediately return control to the program.

# @ Syntax

C/C++ (Windows)
```csv
I16 start_tr_move(I16 Axis, F64 Dist, F64 StrVel, F64 MaxVel, F64 FinVel, F64 Tacc, F64 Tdec)
I16 start_sr_move(I16 Axis, F64 Dist, F64 StrVel, F64 MaxVel, F64 FinVel, F64 Tacc, F64 Tdec, F64 Tlacc, F64 Tldec)
I16 start_ta_move(I16 Axis, F64 Pos, F64 StrVel, F64 MaxVel, F64 FinVel, F64 Tacc, F64 Tdec)
I16 start_sa_move(I16 Axis, F64 Pos, F64 StrVel, F64 MaxVel, F64 FinVel, F64 Tacc, F64 Tdec, F64 Tlacc, F64 Tldec)
```
Visual Basic (Windows)

```txt
start_tr_move (ByVal Axis As Integer, ByVal Dist As Double, ByVal StartVel As Double, ByVal MaxVel As Double, ByVal FinVel As Double, ByVal Tacc As Double, ByVal Tdec As Double) As Integer
start_sr_move (ByVal Axis As Integer, ByVal Dist As Double, ByVal StartVel As Double, ByVal MaxVel As Double, ByVal FinVel As Double, ByVal Tacc As Double, ByVal Tdec As Double, ByVal Tlacc As Double, ByVal Tldec As Double) As Integer
```

```csv
start_ta_move (ByVal Axis As Integer, ByVal pos As Double, ByVal StartVel As Double, ByVal MaxVel As Double, ByVal FinVel As Double, ByVal Tacc As Double, ByVal Tdec As Double) As Integer
start_sa_move (ByVal Axis As Integer, ByVal pos As Double, ByVal StartVel As Double, ByVal MaxVel As Double, ByVal FinVel As Double, ByVal Tacc As Double, ByVal Tdec As Double, ByVal Tlacc As Double, ByVal Tldec As Double) As Integer
```

# @ Arguments

Axis: axis index designated to move or change position.

Dist: specified relative distance to move in unit of mm.

Pos: specified absolute position to move in unit of mm.

StrVel: starting velocity, in unit of mm per second.

MaxVel: maximum velocity, in unit of mm per second.

FinVel: final velocity, in unit of mm per second.

Tacc: specified total acceleration time in unit of second

Tlacc: specified linear acceleration time in unit of second

Tdec: specified deceleration time in unit of second.

T1dec: specified linear deceleration time in unit of second.

# @ Return Code

```txt
ERROR_NoError
ERROR_Dll_Opened_By_Other_Process
ERROR_Wrong_Axis_Number
ERROR_Card_Not_Ready
ERROR_Card_Not_Initial
ERROR_DSP_Not_Ready
ERROR_Axis_Not_In_Control
ERROR_Axis_Servo_Alarm
ERROR_Axis_Is_Not_Ready_ON
ERROR_Axis_Is_Not_Servo_ON
ERROR_Invalid_MaxVelocity
ERROR_Axis_Hand_Shake_Failed
```

```txt
ERROR_Axis_Not_Response
ERROR_Axis_Prepare_For_Motion
ERROR_Axis_Busy_For_Motion
ERROR_Axis_In_EMG_ON
```

@ Example
```txt
&lt;C/C++&gt;
```

start\_tr\_move
```matlab
I16 RetCode;
F64 Dist = 20.0;
F64 StrVel=1.0;
F64 MaxVel=10.0;
F64 FinVel =0.0;
F64 Tacc = 0.5;
F64 Tdec = 0.1;
RetCode = start_tr_move(0, Dist, StrVel, MaxVel, FinVel, Tacc, Tdec);
```

start\_sr\_move
```matlab
I16 RetCode;
F64 Dist = 20.0;
F64 StrVel=1.0;
F64 MaxVel=10.0;
F64 FinVel =0.0;
F64 Tacc = 0.5;
F64 Tdec = 0.1;
F64 Tlacc = 0.2;
F64 Tldec = 0.0;
RetCode = start_sr_move(0, Dist, StrVel, MaxVel, FinVel, Tacc, Tdec, Tlacc, Tldec);
```

start\_ta\_move
```txt
I16 RetCode;
F64 Pos = 10.0;
F64 StrVel=1.0;
F64 MaxVel=10.0;
F64 FinVel =0.0;
F64 Tacc = 0.5;
F64 Tdec = 0.1;
RetCode = start_ta_move(0, Pos, StrVel, MaxVel, FinVel, Tacc, Tdec);
```

start\_sa\_move
```matlab
I16 RetCode;
F64 Pos = 20.0;
F64 StrVel=1.0;
F64 MaxVel=10.0;
F64 FinVel =0.0;
F64 Tacc = 0.5;
F64 Tdec = 0.1;
F64 Tlacc = 0.2;
F64 Tldec = 0.0;
RetCode = start_sa_move(0, Pos, StrVel, MaxVel, FinVel, Tacc, Tdec, Tlacc, Tldec);
```
&lt;Visual Basic&gt;

start\_tr\_move
```txt
Dim RetCode As Integer
Dim Dist As Double, StrVel As Double, MaxVel As Double
Dim FinVel As Double, Tacc As Double, Tdec As Double
Dist = 20#
StrVel = 1#
MaxVel = 10#
FinVel = 0#
Tacc = 0.5
Tdec = 0.1
RetCode = start_tr_move(0, Dist, StrVel, MaxVel, FinVel, Tacc, Tdec)
```

start\_sr\_move
```txt
Dim RetCode As Integer
Dim Dist As Double, StrVel As Double, MaxVel As Double
Dim FinVel As Double, Tacc As Double, Tdec As Double
Dim Tlacc As Double, Tldec As Double
Dist = 20#
StrVel = 1#
MaxVel = 10#
FinVel = 0#
Tacc = 0.5
Tdec = 0.1
```

```txt
Tlacc = 0.2
Tldec = 0#
RetCode = start_sr_move(0, Dist, StrVel, MaxVel, FinVel, Tacc, Tdec, Tlacc, Tldec)
```
start\_ta\_move

```txt
Dim RetCode As Integer
Dim Pos As Double, StrVel As Double, MaxVel As Double
Dim FinVel As Double, Tacc As Double, Tdec As Double
Pos = 20#
StrVel = 1#
MaxVel = 10#
FinVel = 0#
Tacc = 0.5
Tdec = 0.1
RetCode = start_ta_move(0, Pos, StrVel, MaxVel, FinVel, Tacc, Tdec)
```

start\_sa\_move
```txt
Dim RetCode As Integer
Dim Pos As Double, StrVel As Double, MaxVel As Double
Dim FinVel As Double, Tacc As Double, Tdec As Double
Dim Tlacc As Double, Tldec As Double
Pos = 20#
StrVel = 1#
MaxVel = 10#
FinVel = 0#
Tacc = 0.5
Tdec = 0.1
Tlacc = 0.2
Tldec = 0#
RetCode = start_sa_move(0, Pos, StrVel, MaxVel, FinVel, Tacc, Tdec, Tlacc, Tldec)
```

# 1.4.3 Single Motion - Multi axes velocity move

# @ Name

tv\_move\_all(Length, \*Axis, \*StrVel, \*MaxVel, \*Tacc) – Accelerate all specified axes to an individually specified velocity with trapezoidal profile

sv\_move\_all(Length, \*Axis, \*StrVel, \*MaxVel, \*Tacc, \*Tlacc) – Accelerate all specified axes to an individually specified velocity with S-curve profile

# @ Description

tv\_move\_all:

The tv\_move\_all is a multi-axis-version tv\_move. That is tv\_move\_all causes all specified axes to do tv\_move. The only constrain is that all axes specified in the \*Axis array must be of the same card. Each axis defines its velocity and acceleration time independently. Axes will keep moving until tv\_change, sv\_change, sv\_stop, tv\_stop, or emg\_stop command is applied.

Note: tv\_move\_all only guarantees all specified axes start moving at the same time. These axes are not necessary to stop at the same time, in other words, user must apply tv\_stop, sv\_stop command to every axis.

sv\_move\_all:

The sv\_move\_all is a multi-axis-version sv\_move. Refer to the description of tv\_move\_all above.

# @ Syntax

C/C++ (Windows)

```csv
I16 tv_move_all(I16 Length, I16 *Axis, F64
*StrVel, F64 *MaxVel, F64 *Tacc)
I16 sv_move_all(I16 Length, I16 *Axis, F64
*StrVel, F64 *MaxVel, F64 *Tacc, F64 *Tlacc)
```

# Visual Basic (Windows)

```txt
tv_move_all (ByVal length As Integer, AxisArray
    As Integer, StartVelArray As Double,
    MaxVelArray As Double, TaccArray As Double)
    As Integer
```

sv\_move\_all (ByVal length As Integer, AxisArray As Integer, StartVelArray As Double, MaxVelArray As Double, TaccArray As Double, TlaccArray As Double) As Integer

# @ Arguments

Length: the total number of axis to apply move.

\*Axis: array of axis index designated to move.

\*StrVel: array of starting velocity in unit of mm per second

\*MaxVel: array of maximum velocity in unit of mm per second

\*Tacc: array of specified acceleration time in unit of second

\*Tlacc: array of specified linear acceleration time in unit of second

# @ Return Code

```txt
ERROR_NoError
ERROR_Dll_Opened_By_Other_Process
ERROR_Wrong_Axis_Number
ERROR_Invalid_Length_Of_Axes
ERROR_Card_Not_Ready
ERROR_Card_Not_Initial
ERROR_DSP_Not_Ready
ERROR_Axis_Not_In_Control
ERROR_Axis_Servo_Alarm
ERROR_Axis_Is_Not_Ready_ON
ERROR_Axis_Is_Not_Servo_ON
ERROR_Invalid_MaxVelocity
ERROR_Axis_Hand_Shake_Failed
ERROR_Axis_Not_Response
ERROR_Axis_Prepare_For_Motion
ERROR_Axis_Busy_For_Motion
ERROR_Axis_In_EMG_ON
```

# @ Example

```txt
&lt;C/C++&gt;
```

```txt
tv_move_all
```

I16 RetCode;

```txt
I16 Length = 3;
I16 Axis[3] = {0, 1, 2};
F64 StrVel[3] = {0.0, 0.0, 0.0};
F64 MaxVel[3] = {10.0, 6.0, 5.0};
F64 Tacc[3] = {0.1, 0.1, 0.2};
RetCode = tv_move_all(Length, Axis, StrVel, MaxVel, Tacc);
```
sv\_move\_all

```c
I16 RetCode;
I16 Length = 3;
I16 Axis[3] = {0, 1, 2};
F64 StrVel[3] = {0.0, 0.0, 0.0};
F64 MaxVel[3] = {10.0, 6.0, 5.0};
F64 Tacc[3] = {0.1, 0.1, 0.2};
F64 Tlacc[3] = {0.1, 0.05, 0.0};
RetCode = sv_move_all(Length, Axis, StrVel, MaxVel, Tacc, Tlacc);
```
&lt;Visual Basic&gt;

tv\_move\_all
```txt
Dim RetCode As Integer
Dim Length As Integer
Dim Axis(0 To 2) As Integer, StrVel(0 To 2) As Double
Dim MaxVel(0 To 2) As Double, Tacc(0 To 2) As Double
For Length = 0 To 2
    Axis(Length) = Length
    StrVel(Length) = 0#
MaxVel(Length) = Length * 10
Tacc(Length) = Length * 0.1 + 0.1
Next Length
Length = 3
RetCode = tv_move_all(Length, Axis(0), StrVel(0), MaxVel(0), Tacc(0))
```

sv\_move\_all
```txt
Dim RetCode As Integer
Dim Length As Integer
Dim Axis(0 To 2) As Integer, StrVel(0 To 2) As Double
```

```vba
Dim MaxVel(0 To 2) As Double, Tacc(0 To 2) As Double
Dim Tlacc(0 To 2) As Double
For Length = 0 To 2
    Axis(Length) = Length
    StrVel(Length) = 0#
MaxVel(Length) = Length * 10
Tacc(Length) = Length * 0.1 + 0.1
Tlacc(Length) = Length * 0.1
Next Length
Length = 3
RetCode = sv_move_all(Length, Axis(0), StrVel(0), MaxVel(0), Tacc(0), Tlacc(0))
```

# 1.4.4 Single Motion - Multi axes P to P motion

# @ Name

start\_tr\_move\_all(Length, \*Axis, \*Dist, \*StrVel, \*MaxVel, \*FinVel, \*Tacc, \*Tdec) – cause all specified axes to do relative trapezoidal profile move

start\_sr\_move\_all(Length, \*Axis, \*Dist, \*StrVel, \*MaxVel, \*FinVel, \*Tacc, \*Tdec, \*Tlacc, \*Tldec) - cause all specified axes to do relative S-curve profile move

start\_ta\_move\_all(Length, \*Axis, \*Pos, \*StrVel, \*MaxVel, \*FinVel, \*Tacc, \*Tdec) - cause all specified axes to do absolute trapezoidal profile move

start\_sa\_move\_all(Length, \*Axis, \*Pos, \*StrVel, \*MaxVel, \*FinVel, \*Tacc, \*Tdec, \*Tlacc, \*Tldec) - cause all specified axes to do absolute S-curve profile move

# @ Description

start\_tr\_move\_all:

This function causes all specified axes to perform srart\_tr\_move. Every axis must define its own parameters, ie, StrVel, MaxVel, FinVel, Tacc, Tdec. Note: start\_tr\_move\_all only guarantees all specified axes start moving at the same time. These axes are not necessary to stop at the same time. The duration of motion of each axis is independently defined.

start\_sr\_move\_all:

Refer to description of start\_tr\_move\_all above.

start\_ta\_move\_all:

Refer to description of start\_tr\_move\_all above.

start\_sa\_move\_all:

Refer to description of start\_tr\_move\_all above.

# @ Syntax

# C/C++ (Windows)

```csv
I16 start_tr_move_all(I16 Length, I16 *Axis, F64 *Dist, F64 *StrVel, F64 *MaxVel, F64 *FinVel, F64 *Tacc, F64 *Tdec)
I16 start_sr_move_all(I16 Length, I16 *Axis, F64 *Dist, F64 *StrVel, F64 *MaxVel, F64 *FinVel, F64 *Tacc, F64 *Tdec, F64 *Tlacc, F64 *Tldec)
I16 start_ta_move_all(I16 Length, I16 *Axis, F64 *Pos, F64 *StrVel, F64 *MaxVel, F64 *FinVel, F64 *Tacc, F64 *Tdec)
I16 start_sa_move_all(I16 Length, I16 *Axis, F64 *Pos, F64 *StrVel, F64 *MaxVel, F64 *FinVel, F64 *Tacc, F64 *Tdec, F64 *Tlacc, F64 *Tldec)
```

# Visual Basic (Windows)

```csv
start_tr_move_all (ByVal length As Integer, AxisArray As Integer, DistArray As Double, StartVelArray As Double, MaxVelArray As Double, FinVelArray As Double, TaccArray As Double, TdecArray As Double) As Integer
start_sr_move_all (ByVal length As Integer, AxisArray As Integer, DistArray As Double, StartVelArray As Double, MaxVelArray As Double, FinVelArray As Double, TaccArray As Double, TdecArray As Double, TlaccArray As Double, TldecArray As Double) As Integer
start_ta_move_all (ByVal length As Integer, AxisArray As Integer, posarray As Double, StartVelArray As Double, MaxVelArray As Double, FinVelArray As Double, TaccArray As Double, TdecArray As Double) As Integer
start_sa_move_all (ByVal length As Integer, AxisArray As Integer, posarray As Double, StartVelArray As Double, MaxVelArray As Double, FinVelArray As Double, TaccArray As Double, TdecArray As Double, TlaccArray As Double, TldecArray As Double) As Integer
```

# @ Arguments

Length: the total number of axis to apply move.

\*Axis: array of axis index designated to move.

\*Dist: array of specified relative distance to move in unit of mm.

\*Pos: array of specified absolute position to move in unit of mm.

\*StrVel: array of starting velocity, in unit of mm per second.

\*MaxVel: array of maximum velocity, in unit of mm per second.

\*FinVel: array of final velocity, in unit of mm per second.

\*Tacc: array of specified acceleration time in unit of second.

\*Tdec: array of specified deceleration time in unit of second.

\*Tlacc: array of specified linear acceleration time in unit of second.

\*Tldec: array of specified linear deceleration time in unit of second.

# @ Return Code

```txt
ERROR_NoError
ERROR_Dll_Opened_By_Other_Process
ERROR_Wrong_Axis_Number
ERROR_Invalid_Length_Of_Axes
ERROR_Card_Not_Ready
ERROR_Card_Not_Initial
ERROR_DSP_Not_Ready
ERROR_Axis_Not_In_Control
ERROR_Axis_Servo_Alarm
ERROR_Axis_Is_Not_Ready_ON
ERROR_Axis_Is_Not_Servo_ON
ERROR_Invalid_MaxVelocity
ERROR_Axis_Hand_Shake_Failed
ERROR_Axis_Not_Response
ERROR_Axis_Prepare_For_Motion
ERROR_Axis_Busy_For_Motion
ERROR_Axis_In_EMG_ON
```

# @ Example

```txt
&lt;C/C++&gt;
```

start\_tr\_move\_all
```c
I16 RetCode;
I16 Length = 2;
I16 Axis[2] = {0, 2};
F64 Dist[2] = {20.0, 20.0};
F64 StrVel[2] = {0.0, 0.0};
F64 MaxVel[2] = {10.0, 5.0};
F64 FinVel[2] = {0.0, 0.0};
F64 Tacc[2] = {0.2, 0.1};
F64 Tdec[2] = {0.1, 0.2};
RetCode = start_tr_move_all(Length, Axis, Dist, StrVel, MaxVel, FinVel, Tacc, Tdec);
```

start\_sr\_move\_all
```c
I16 RetCode;
I16 Length = 2;
I16 Axis[2] = {0, 2};
F64 Dist[2] = {20.0, 20.0};
F64 StrVel[2] = {0.0, 0.0};
F64 MaxVel[2] = {10.0, 5.0};
F64 FinVel[2] = {0.0, 0.0};
F64 Tacc[2] = {0.2, 0.1};
F64 Tdec[2] = {0.1, 0.2};
F64 Tlacc[2] = {0.1, 0.0};
F64 Tldec[2] = {0.0, 0.2};
RetCode = start_sr_move_all(Length, Axis, Dist, StrVel, MaxVel, FinVel, Tacc, Tdec, Tlacc, Tldec);
```

start\_ta\_move\_all
```c
I16 RetCode;
I16 Length = 2;
I16 Axis[2] = {0, 2};
F64 Pos[2] = {50.0, 40.0};
F64 StrVel[2] = {0.0, 0.0};
F64 MaxVel[2] = {10.0, 5.0};
F64 FinVel[2] = {0.0, 0.0};
F64 Tacc[2] = {0.2, 0.1};
F64 Tdec[2] = {0.1, 0.2};
RetCode = start_ta_move_all(Length, Axis, Pos, StrVel, MaxVel, FinVel, Tacc, Tdec);
```
start\_sa\_move\_all

```c
I16 RetCode;
I16 Length = 2;
I16 Axis[2] = {0, 2};
F64 Pos[2] = {50.0, 30.0};
F64 StrVel[2] = {0.0, 0.0};
F64 MaxVel[2] = {10.0, 5.0};
F64 FinVel[2] = {0.0, 0.0};
F64 Tacc[2] = {0.2, 0.1};
F64 Tdec[2] = {0.1, 0.2};
F64 Tlacc[2] = {0.1, 0.0};
F64 Tldec[2] = {0.0, 0.2};
RetCode = start_sa_move_all(Length, Axis, Pos, StrVel, MaxVel, FinVel, Tacc, Tdec, Tlacc, Tldec);
```

# &lt;Visual Basic&gt;

start\_tr\_move\_all
```prolog
Dim RetCode As Integer
Dim Length As Integer
Dim Axis(0 To 1) As Integer, Dist(0 To 1) As Double
Dim StrVel(0 To 1) As Double, MaxVel(0 To 1) As Double
Dim FinVel(0 To 1) As Double
Dim Tacc(0 To 1) As Double, Tdec(0 To 1) as Double
For Length = 0 To 1
    Axis(Length) = Length
Dist(Length) = Length*10
StrVel(Length) = 0#
MaxVel(Length) = Length * 10
FinVel(Length) = 0#
Tacc(Length) = Length * 0.1 + 0.1
Tdec(Length) = Length * 0.2 + 0.1
Next Length
Length = 2
RetCode = start_tr_move_all(Length, Axis(0), Dist(0), StrVel(0), MaxVel(0), FinVel(0), Tacc(0), Tdec(0))
```

start\_sr\_move\_all
```txt
Dim RetCode As Integer
Dim Length As Integer
```

```txt
Dim Axis(0 To 1) As Integer, Dist(0 To 1) As Double
Dim StrVel(0 To 1) As Double, MaxVel(0 To 1) As Double
Dim FinVel(0 To 1) As Double
Dim Tacc(0 To 1) As Double, Tdec(0 To 1) as Double
Dim Tlacc(0 To 1) As Double, Tldec(0 To 1) as Double
For Length = 0 To 1
    Axis(Length) = Length
Dist(Length) = Length*10
StrVel(Length) = 0#
MaxVel(Length) = Length * 10
FinVel(Length) = 0#
Tacc(Length) = Length * 0.1 + 0.1
Tdec(Length) = Length * 0.2 + 0.1
Tlacc(Length) = 0#
Tldec(Length) = Length * 0.2 + 0.1
Next Length
Length = 2
RetCode = start_sr_move_all(Length, Axis(0), Dist(0), StrVel(0), MaxVel(0), FinVel(0), Tacc(0), Tdec(0), Tlacc(0), Tldec(0))
```

start\_ta\_move\_all
```vba
Dim RetCode As Integer
Dim Length As Integer
Dim Axis(0 To 1) As Integer, Pos(0 To 1) As Double
Dim StrVel(0 To 1) As Double, MaxVel(0 To 1) As Double
Dim FinVel(0 To 1) As Double
Dim Tacc(0 To 1) As Double, Tdec(0 To 1) as Double
For Length = 0 To 1
    Axis(Length) = Length
Pos(Length) = Length*10
StrVel(Length) = 0#
MaxVel(Length) = Length * 10
FinVel(Length) = 0#
Tacc(Length) = Length * 0.1 + 0.1
Tdec(Length) = Length * 0.2 + 0.1
```

```txt
Next Length
Length = 2
RetCode = start_ta_move_all(Length, Axis(0),
    Pos(0), StrVel(0), MaxVel(0), FinVel(0),
    Tacc(0), Tdec(0))
```
start\_sa\_move\_all

```vba
Dim RetCode As Integer
Dim Length As Integer
Dim Axis(0 To 1) As Integer, Pos(0 To 1) As Double
Dim StrVel(0 To 1) As Double, MaxVel(0 To 1) As Double
Dim FinVel(0 To 1) As Double
Dim Tacc(0 To 1) As Double, Tdec(0 To 1) as Double
Dim Tlacc(0 To 1) As Double, Tldec(0 To 1) as Double
For Length = 0 To 1
    Axis(Length) = Length
Pos(Length) = Length*10
StrVel(Length) = 0#
MaxVel(Length) = Length * 10
FinVel(Length) = 0#
Tacc(Length) = Length * 0.1 + 0.1
Tdec(Length) = Length * 0.2 + 0.1
Tlacc(Length) = 0#
Tldec(Length) = Length * 0.2 + 0.1
Next Length
Length = 2
RetCode = start_sa_move_all(Length, Axis(0), Pos(0), StrVel(0), MaxVel(0), FinVel(0), Tacc(0), Tdec(0), Tlacc(0), Tldec(0))
```

# 1.4.5 Single Motion - Speed Change on the fly

# @ Name

tv\_change(Axis, SpeedFactor, Tacc) – Change velocity on the fly with trapezoidal profile

sv\_change(Axis, SpeedFactor, Tacc) – Change position on the fly with S-curve profile

tv\_stop(Axis, Tdec) – Stop axis with trapezoidal profile

sv\_stop(Axis, Tdec) - Stop axis with S-curve trapezoidal profile

emg\_stop(Axis) - immediately stop axis.

# @ Description

tv\_change:

This function is used to change axis velocity on the fly with trapezoidal profile. Note: the new velocity is defined by giving a multiplier, "SpeedFactor", to current maximum velocity.

For example:

A tv\_move(0, 1.0, 20.0, 0.5) command causes axis 0 accelerate from speed 1.0 mm/sec to 20.0 mm/sec in 0.5 sec. When it slew at 20.0mm/sec, tv\_change(0, 2.0, 1.0) is executed. It cause axis 0 start accelerating with trapezoidal profile to 40.0 mm/ser in 1.0 sec.

sv\_change:

This function is used to change axis velocity on the fly with S-curve profile. Note: the new velocity is defined by giving a multiplier, "SpeedFactor", to current maximum velocity.

For example:

A sv\_move(0, 1.0, 20.0, 0.5) command causes axis 0 accelerate from speed 1.0 mm/sec to 20.0 mm/sec in 0.5 sec. When it slew at 20.0mm/sec, sv\_change(0, 2.0, 1.0) is executed. It cause axis 0 start accelerating with S-curve profile to 40.0 mm/sec in 1.0 sec.

tv\_stop, sv\_stop:

These functions will stop the specified axis. The deceleration time is defined by Tdec.

emg\_stop:

This function will stop specified axis immediately.

# @ Syntax

C/C++ (DOS, Windows)
```txt
I16 tv_change(I16 Axis, F64 SpeedFactor, F64 Tacc)
I16 sv_change(I16 Axis, F64 SpeedFactor, F64 Tacc)
I16 tv_stop(I16 Axis, F64 Tdec)
I16 sv_stop(I16 Axis, F64 Tdec)
I16 emg_stop(I16 Axis)
```
Visual Basic (Windows)

```txt
tv_change (ByVal Axis As Integer, ByVal
    SpeedFactor As Single, ByVal Tdec As Double)
    As Integer

sv_change (ByVal Axis As Integer, ByVal
    SpeedFactor As Single, ByVal Tdec As Double)
    As Integer

tv_stop (ByVal Axis As Integer, ByVal Tdec As
    Double) As Integer

sv_stop (ByVal Axis As Integer, ByVal Tdec As
    Double) As Integer

emg_stop (ByVal Axis As Integer) As Integer
```

# @ Arguments

Axis: axis index designated to move

SpeedFactor: This parameter is used to define new max velocity. The new max velocity is equal to old max velocity multiply SpeedFactor.

Tacc: specified acceleration time in unit of second.

Tdec: specified deceleration time in unit of second.

# @ Return Code

```txt
ERROR_NoError
ERROR_Dll_Opened_By_Other_Process
```

```txt
ERROR_Wrong_Axis_Number
ERROR_Card_Not_Ready
ERROR_Card_Not_Initial
ERROR_DSP_Not_Ready
ERROR_Axis_Not_In_Control
ERROR_Axis_Servo_Alarm
ERROR_Axis_Is_Not_Ready_ON
ERROR_Axis_Is_Not_Servo_ON
ERROR_Axis_Is_Not_In_Motion
ERROR_Axis_Is_In_V_Change
ERROR_Can_Not_Apply_P_Change
```

# @ Example

```txt
&lt;C/C++&gt;
```

tv\_change
```javascript
I16 RetCode;
F64 StartVel=0.0;
F64 MaxVel=10.0;
F64 Tacc = 0.5;
RetCode = tv_move(0, StartVel, MaxVel, Tacc);
Sleep(1000);
F64 NewVel = 15.0;
F64 SpeedFactor = NewVel / MaxVel;
Tacc = 0.1;
RetCode = tv_change(0, SpeedFactor, Tacc);
```

sv\_change
```javascript
I16 RetCode;
F64 StartVel=0.0;
F64 MaxVel=10.0;
F64 Tacc = 0.5;
RetCode = tv_move(0, StartVel, MaxVel, Tacc);
Sleep(1000);
F64 NewVel = 15.0;
F64 SpeedFactor = NewVel / MaxVel;
Tacc = 0.1;
RetCode = sv_change(0, SpeedFactor, Tacc);
```

tv\_stop
```txt
I16 RetCode;
F64 Pos = 20.0;
F64 StrVel=1.0;
```

```txt
F64 MaxVel=10.0;
F64 FinVel =0.0;
F64 Tacc = 0.5;
F64 Tdec = 0.1;
F64 Tlacc = 0.2;
F64 Tldec = 0.0;
RetCode = start_sa_move(0, Pos, StrVel, MaxVel, FinVel, Tacc, Tdec, Tlacc, Tldec);
Sleep(1000);
Tdec = 0.3;
RetCode = tv_stop(0, Tdec);
```

sv\_stop
```txt
I16 RetCode;
F64 StartVel=0.0;
F64 MaxVel=10.0;
F64 Tacc = 0.5;
RetCode = tv_move(0, StartVel, MaxVel, Tacc);
Sleep(1000);
F64 Tdec = 1.0;
RetCode = sv_stop(0, Tdec);
```
emg\_stop

```matlab
I16 RetCode;
F64 Pos = 20.0;
F64 StrVel=1.0;
F64 MaxVel=10.0;
F64 FinVel =0.0;
F64 Tacc = 0.5;
F64 Tdec = 0.1;
F64 Tlacc = 0.2;
F64 Tldec = 0.0;
RetCode = start_sa_move(0, Pos, StrVel, MaxVel, FinVel, Tacc, Tdec, Tlacc, Tldec);
Sleep(1000);
RetCode = emg_stop(0);
```
&lt;Visual Basic&gt;

tv\_change
```vba
Dim RetCode As Integer
Dim StartVel As Double, MaxVel As Double, Tacc As Double
StartVel = 0#
```

```txt
MaxVel = 10#
Tacc = 0.5
RetCode = tv_move(0, StartVel, MaxVel, Tacc)
Sleep (1000)
Dim NewVel As Double
NewVel = 15#
Dim SpeedFactor As Double
SpeedFactor = NewVel / MaxVel
Tacc = 0.1
RetCode = tv_change(0, SpeedFactor, Tacc)
```
sv\_change

```txt
Dim RetCode As Integer
Dim StartVel As Double, MaxVel As Double, Tacc As Double
StartVel = 0#
MaxVel = 10#
Tacc = 0.5
RetCode = tv_move(0, StartVel, MaxVel, Tacc)
Sleep (1000)
Dim NewVel As Double
NewVel = 15#
Dim SpeedFactor As Double
SpeedFactor = NewVel / MaxVel
Tacc = 0.1
RetCode = sv_change(0, SpeedFactor, Tacc)
```

tv\_stop
```vba
Dim RetCode As Integer
Dim Pos As Double, StrVel As Double, MaxVel As Double
Dim FinVel As Double, Tacc As Double, Tdec As Double
Dim Tlacc As Double, Tldec As Double
Pos = 20#
StrVel = 1#
MaxVel = 10#
FinVel = 0#
Tacc = 0.5
Tdec = 0.1
Tlacc = 0.2
Tldec = 0#
```

```autohotkey
RetCode = start_sa_move(0, Pos, StrVel, MaxVel, FinVel, Tacc, Tdec, Tlacc, Tldec)
Sleep (1000)
Tdec = 0.3
RetCode = tv_stop(0, Tdec)
```

sv\_stop
```vba
Dim RetCode As Integer
Dim StartVel As Double, MaxVel As Double, Tacc As Double
StartVel = 0#
MaxVel = 10#
Tacc = 0.5
RetCode = tv_move(0, StartVel, MaxVel, Tacc)
Sleep (1000)
F64 Tdec = 1#
RetCode = sv_stop(0, Tdec)
```

emg\_stop
```txt
Dim RetCode As Integer
Dim Pos As Double, StrVel As Double, MaxVel As Double
Dim FinVel As Double, Tacc As Double, Tdec As Double
Dim Tlacc As Double, Tldec As Double
Pos = 20#
StrVel = 1#
MaxVel = 10#
FinVel = 0#
Tacc = 0.5
Tdec = 0.1
Tlacc = 0.2
Tldec = 0#
RetCode = start_sa_move(0, Pos, StrVel, MaxVel, FinVel, Tacc, Tdec, Tlacc, Tldec)
Sleep (1000)
RetCode = emg_stop(0)
```

# 1.4.6 Single Motion - Multi axes linear interpolation

# @ Name

start\_line\_tr\_move(Length, \*AxisArray, \*DistArray, StrVel, MaxVel, FinVel, Tacc, Tdec) - Begin a relative n-axis linear interpolation, with trapezoidal profile

start\_line\_sr\_move(Length, \*AxisArray, \*DistArray, StrVel, MaxVel, FinVel, Tacc, Tdec, Tlacc, Tldec) – Begin a relative n-axis linear interpolation, with S-curve profile

start\_line\_ta\_move(Length, \*AxisArray, \*PosArray, StrVel, MaxVel, FinVel, Tacc, Tdec) -Begin a absolute n-axis linear interpolation, with trapezoidal profile

start\_line\_sa\_move(Length, \*AxisArray, \*PosArray, StrVel, MaxVel, FinVel, Tacc, Tdec, Tlacc, Tldec) - Begin a absolute n-axis linear interpolation, with S-curve profile

# @ Description

start\_line\_tr\_move:

This function performs a relative n-axis linear interpolation with trapezoidal profile. Interpolation means all axes start out at the same time and arrive destination at the same time. The specified start, max and final velocity are tangential velocity.

Note: All axes must be of the same card.

start\_line\_sr\_move:

This function performs a relative n-axis linear interpolation with S-curve profile. Interpolation means all axes start out at the same time and arrive destination at the same time. The start, max and final velocity are the tangential velocity.

Note: All axes must be of the same card.

start\_line\_ta\_move:

This function performs a absolute n-axis linear interpolation with trapezoidal profile. Interpolation means all axes start out at the same time and arrive destination at the same time. The start, max and final velocity are the tangential velocity.

Note: All axes must be of the same card.

start\_line\_sa\_move:

This function performs a absolute n-axis linear interpolation with S-curve profile. Interpolation means all axes start out at the same time and arrive destination at the same time. The start, max and final velocity are the tangential velocity.

Note: All axes must be of the same card.

# @ Syntax

# C/C++ (DOS, Windows)

```csv
I16 start_line_tr_move(I16 Length, I16
    *AxisArray, F64 *DistArray, F64 StrVel, F64
    MaxVel, F64 FinVel, F64 Tacc, F64 Tdec)
I16 start_line_sr_move(I16 Length, I16
    *AxisArray, F64 *DistArray, F64 StrVel, F64
    MaxVel, F64 FinVel, F64 Tacc, F64 Tdec, F64
    Tlacc, F64 Tldec)
I16 start_line_ta_move(I16 Length, I16
    *AxisArray, F64 *PosArray, F64 StrVel, F64
    MaxVel, F64 FinVel, F64 Tacc, F64 Tdec)
I16 start_line_sa_move(I16 Length, I16
    *AxisArray, F64 *PosArray, F64 StrVel, F64
    MaxVel, F64 FinVel, F64 Tacc, F64 Tdec, F64
    Tlacc, F64 Tldec)
```

# Visual Basic (Windows)

```txt
start_line_tr_move (ByVal length As Integer,
    AxisArray As Integer, DistArray As Double,
    ByVal StartVel As Double, ByVal MaxVel As
    Double, ByVal FinVel As Double, ByVal Tacc
    As Double, ByVal Tdec As Double) As Integer
start_line_sr_move (ByVal length As Integer,
    AxisArray As Integer, DistArray As Double,
    ByVal StartVel As Double, ByVal MaxVel As
    Double, ByVal FinVel As Double, ByVal Tacc
    As Double, ByVal Tdec As Double, ByVal Tlacc
    As Double, ByVal Tldec As Double) As Integer
start_line_ta_move (ByVal length As Integer,
    AxisArray As Integer, PosArray As Double,
```

ByVal StartVel As Double, ByVal MaxVel As Double, ByVal FinVel As Double, ByVal Tacc As Double, ByVal Tdec As Double) As Integer start\_line\_sa\_move (ByVal length As Integer, AxisArray As Integer, PosArray As Double, ByVal StartVel As Double, ByVal MaxVel As Double, ByVal FinVel As Double, ByVal Tacc As Double, ByVal Tdec As Double, ByVal Tlacc As Double, ByVal Tldec As Double) As Integer

# @ Arguments

Length: the total number of axis to apply move.

\*AxisArray: array of axis number designated to move.

\*DistArray: array of specified relative distance to move in unit of mm.

\*PosArray: array of specified absolute position to move in unit of mm.

StrVel: starting tangential velocity, in unit of mm per second.

MaxVel: maximum tangential velocity, in unit of mm per second.

FinVel: final tangential velocity, in unit of mm per second.

Tacc: specified acceleration time in unit of second.

Tdec: specified deceleration time in unit of second.

Tlacc: specified linear acceleration time in unit of second.

T1dec: specified linear deceleration time in unit of second.

# @ Return Code

```txt
ERROR_NoError
ERROR_Dll_Opened_By_Other_Process
ERROR_Wrong_Axis_Number
ERROR_Invalid_Length_Of_Axes
ERROR_Card_Not_Ready
ERROR_Card_Not_Initial
ERROR_DSP_Not_Ready
ERROR_Axis_Not_In_Control
ERROR_Axis_Servo_Alarm
ERROR_Axis_Is_Not_Ready_ON
ERROR_Axis_Is_Not_Servo_ON
```

```txt
ERROR_Invalid_MaxVelocity
ERROR_Axis_Hand_Shake_Failed
ERROR_Axis_Not_Response
ERROR_Axis_Prepare_For_Motion
ERROR_Axis_Busy_For_Motion
ERROR_Axis_In_EMG_ON
```

@ Example
```txt
&lt;C/C++&gt;
start_line_tr_move
    I16 RetCode;
    I16 Length = 2;
    I16 Axis[2] = {0, 2};
    F64 Dist[2] = {10.0, 20.0};
    F64 StrVel = 0.0;
    F64 MaxVel = 15.0;
    F64 FinVel = 0.0;
    F64 Tacc = 0.1;
    F64 Tdec = 0.2;
    RetCode = start_line_tr_move(Length, Axis, Dist, StrVel, MaxVel, FinVel, Tacc, Tdec);
```

```txt
start_line_sr_move
I16 RetCode;
I16 Length = 2;
I16 Axis[2] = {0, 2};
F64 Dist[2] = {20.0, 20.0};
F64 StrVel = 0.0;
F64 MaxVel = 5.0;
F64 FinVel = 0.0;
F64 Tacc = 0.3;
F64 Tdec = 0.2;
F64 Tlacc = 0.3;
F64 Tldec = 0.0;
RetCode = start_line_sr_move(Length, Axis, Dist, StrVel, MaxVel, FinVel, Tacc, Tdec, Tlacc, Tldec);
```
start\_line\_ta\_move

```txt
I16 RetCode;
I16 Length = 2;
I16 Axis[2] = {0, 2};
```

```matlab
F64 Pos[2] = {50.0, 40.0};
F64 StrVel = 0.0;
F64 MaxVel = 25.0;
F64 FinVel = 0.0;
F64 Tacc = 0.2;
F64 Tdec = 0.1;
RetCode = start_line_ta_move(Length, Axis, Pos, StrVel, MaxVel, FinVel, Tacc, Tdec);
```

start\_line\_sa\_move
```txt
I16 RetCode;
I16 Length = 2;
I16 Axis[2] = {0, 2};
F64 Pos[2] = {50.0, 30.0};
F64 StrVel = 0.0;
F64 MaxVel = 25;
F64 FinVel = 0.0;
F64 Tacc = 0.2;
F64 Tdec = 0.2;
F64 Tlacc = 0.1;
F64 Tldec = 0.0;
RetCode = start_line_sa_move(Length, Axis, Pos, StrVel, MaxVel, FinVel, Tacc, Tdec, Tlacc, Tldec);
```
&lt;Visual Basic&gt;

start\_line\_tr\_move
```vba
Dim RetCode As Integer
Dim Length As Integer
Dim Axis(0 To 1) As Integer, Dist(0 To 1) As Double
Dim StrVel As Double, MaxVel As Double, FinVel As Double,
Dim Tacc As Double, Tdec as Double
For Length = 0 To 1
    Axis(Length) = Length
Dist(Length) = Length*10+5
Next Length
StrVel = 0#
MaxVel = 10
FinVel = 0#
Tacc = 0.1
Tdec = 0.2
```

```julia
Length = 2
RetCode = start_line_tr_move(Length, Axis(0), Dist(0), StrVel, MaxVel, FinVel, Tacc, Tdec)
```
start\_line\_sr\_move

```txt
Dim RetCode As Integer
Dim Length As Integer
Dim Axis(0 To 1) As Integer, Dist(0 To 1) As Double
Dim StrVel As Double, MaxVel As Double, FinVel As Double,
Dim Tacc As Double, Tdec as Double
Dim Tlacc As Double, Tldec as Double
For Length = 0 To 1
Axis(Length) = Length
Dist(Length) = Length*10+5
Next Length
StrVel = 0#
MaxVel = 10
FinVel = 0#
Tacc = 0.1
Tdec = 0.2
Length = 2
RetCode = start_line_sr_move(Length, Axis(0), Dist(0), StrVel, MaxVel, FinVel, Tacc, Tdec, Tlacc, Tldec)
```

start\_line\_ta\_move
```txt
Dim RetCode As Integer
Dim Length As Integer
Dim Axis(0 To 1) As Integer, Pos(0 To 1) As Double
Dim StrVel As Double, MaxVel As Double, FinVel As Double,
Dim Tacc As Double, Tdec as Double
For Length = 0 To 1
    Axis(Length) = Length
Pos(Length) = Length*10+5
Next Length
StrVel = 0#
MaxVel = 10
FinVel = 0#
Tacc = 0.1
```

```erlang
Tdec = 0.2
Length = 2
RetCode = start_line_ta_move(Length, Axis(0),
    Pos(0), StrVel, MaxVel, FinVel, Tacc, Tdec)
```
start\_line\_sa\_move

```txt
Dim RetCode As Integer
Dim Length As Integer
Dim Axis(0 To 1) As Integer, Pos(0 To 1) As Double
Dim StrVel As Double, MaxVel As Double, FinVel As Double,
Dim Tacc As Double, Tdec as Double
Dim Tlacc As Double, Tldec as Double
For Length = 0 To 1
    Axis(Length) = Length
Pos(Length) = Length*10+5
Next Length
StrVel = 0#
MaxVel = 10
FinVel = 0#
Tacc = 0.1
Tdec = 0.2
Tlacc = 0.1
Tldec = 0.2
Length = 2
RetCode = start_line_sa_move(Length, Axis(0), Pos(0), StrVel, MaxVel, FinVel, Tacc, Tdec, Tlacc, Tldec)
```

# 1.4.7 Single Motion - Multi axes circular interpolation

# @ Name

start\_arc\_tr\_move(\*AxisArray, \*CenterArray, Angle, StrVel, MaxVel, FinVel, Tacc, Tdec) -Begin a relative 2-axis circular interpolation, with trapezoidal profile

start\_arc\_sr\_move(\*AxisArray, \*CenterArray, Angle, StrVel, MaxVel, FinVel, Tacc, Tdec, Tlacc, Tldec) -Begin a relative 2-axis circular interpolation, with S-curve profile

start\_arc\_ta\_move(\*AxisArray, \*CenterArray, Angle, StrVel, MaxVel, FinVel, Tacc, Tdec) -Begin a absolute 2-axis circular interpolation, with trapezoidal profile

start\_arc\_sa\_move(\*AxisArray, \*CenterArray, Angle, StrVel, MaxVel, FinVel, Tacc, Tdec, Tlacc, Tldec) -Begin a absolute 2-axis circular interpolation, with S-curve profile

# @ Description

start\_arc\_tr\_move:

This function performs a relative 2-axis circular interpolation with trapezoidal angular velocity profile. The specified start, max and final velocity are tangential velocity.

Note: The 2 axes specified in AxisArray must be of the same card.

start\_arc\_sr\_move:

This function performs a relative 2-axis circular interpolation with S-curve angular velocity profile. The specified start, max and final velocity is tangential velocity.

Note: The 2 axes specified in AxisArray must be of the same card.

start\_arc\_ta\_move:

This function performs a absolute 2-axis circular interpolation with trapezoidal angular velocity profile. The specified start, max and final velocity are tangential velocity.

Note: The 2 axes specified in AxisArray must be of the same card.

start\_arc\_sa\_move:

This function performs absolute 2-axis circular interpolation with S-curve angular velocity profile. The specified start, max and final velocity are tangential velocity.

Note: The 2 axes specified in AxisArray must be of the same card.

# @ Syntax

# C/C++ (DOS, Windows)

```txt
I16 start_arc_tr_move(I16 *AxisArray, F64
    *CenterArray, F64 Angle, F64 StrVel, F64
    MaxVel, F64 FinVel, F64 Tacc, F64 Tdec)
I16 start_arc_sr_move(I16 *AxisArray, F64
    *CenterArray, F64 Angle, F64 StrVel, F64
    MaxVel, F64 FinVel, F64 Tacc, F64 Tdec, F64
    Tlacc, F64 Tldec)
I16 start_arc_ta_move(I16 *AxisArray, F64
    *CenterArray, F64 Angle, F64 StrVel, F64
    MaxVel, F64 FinVel, F64 Tacc, F64 Tdec)
I16 start_arc_sa_move(I16 *AxisArray, F64
    *CenterArray, F64 Angle, F64 StrVel, F64
    MaxVel, F64 FinVel, F64 Tacc, F64 Tdec, F64
    Tlacc, F64 Tldec)
```

# Visual Basic (Windows)

```txt
start_arc_tr_move (AxisArray As Integer,
    CenterArray As Double, ByVal Angle As
    Double, ByVal StartVel As Double, ByVal
    MaxVel As Double, ByVal FinVel As Double,
    ByVal Tacc As Double, ByVal Tdec As Double)
    As Integer

start_arc_sr_move (AxisArray As Integer,
    CenterArray As Double, ByVal Angle As
    Double, ByVal StartVel As Double, ByVal
    MaxVel As Double, ByVal FinVel As Double,
    ByVal Tacc As Double, ByVal Tdec As Double,
    ByVal Tlacc As Double, ByVal Tldec As
    Double) As Integer

start_arc_ta_move (AxisArray As Integer,
    CenterArray As Double, ByVal Angle As
    Double, ByVal StartVel As Double, ByVal
    MaxVel As Double, ByVal FinVel As Double,
```

```txt
ByVal Tacc As Double, ByVal Tdec As Double)
As Integer
start_arc_sa_move (AxisArray As Integer,
    CenterArray As Double, ByVal Angle As
    Double, ByVal StartVel As Double, ByVal
    MaxVel As Double, ByVal FinVel As Double,
    ByVal Tacc As Double, ByVal Tdec As Double,
    ByVal Tlacc As Double, ByVal Tldec As
    Double) As Integer
```

# @ Arguments

\*AxisArray: the number of specified 2 axes.

\*CenterArray: the coordinate of arc center in unit of mm.

Angle: specified moving angle in unit of degree.

StrVel: starting tangential velocity, in unit of mm per second.

MaxVel: maximum tangential velocity, in unit of mm per second.

FinVel: final tangential velocity, in unit of mm per second.

Tacc: specified acceleration time in unit of second.

Tdec: specified deceleration time in unit of second.

Tlacc: specified linear acceleration time in unit of second.

T1dec: specified linear deceleration time in unit of second.

# @ Return Code

```txt
ERROR_NoError
ERROR_Dll_Opened_By_Other_Process
ERROR_Wrong_Axis_Number
ERROR_Invalid_Length_Of_Axes
ERROR_Card_Not_Ready
ERROR_Card_Not_Initial
ERROR_DSP_Not_Ready
ERROR_Axis_Not_In_Control
ERROR_Axis_Servo_Alarm
ERROR_Axis_Is_Not_Ready_ON
ERROR_Axis_Is_Not_Servo_ON
ERROR_Invalid_MaxVelocity
ERROR_Axis_Hand_Shake_Failed
ERROR_Axis_Not_Response
```

```txt
ERROR_Axis_Prepare_For_Motion
ERROR_Axis_Busy_For_Motion
ERROR_Axis_In_EMG_ON
```

@ Example
```txt
&lt;C/C++&gt;
```

start\_arc\_tr\_move
```c
I16 RetCode;
I16 Axis[2] = {0, 2};
F64 CenterArray [2] = {10.0, 20.0};
F64 Angle = 90;
F64 StrVel = 0.0;
F64 MaxVel = 15.0;
F64 FinVel = 0.0;
F64 Tacc = 0.1;
F64 Tdec = 0.2;
RetCode = start_arc_tr_move(Axis, CenterArray, Angle, StrVel, MaxVel, FinVel, Tacc, Tdec);
```
start\_arc\_sr\_move

```txt
I16 RetCode;
I16 Axis[2] = {0, 2};
F64 CenterArray [2] = {20.0, 20.0};
F64 Angle = 180;
F64 StrVel = 0.0;
F64 MaxVel = 5.0;
F64 FinVel = 0.0;
F64 Tacc = 0.3
F64 Tdec = 0.2
F64 Tlacc = 0.3;
F64 Tldec = 0.0;
RetCode = start_arc_sr_move(Axis, CenterArray, Angle, StrVel, MaxVel, FinVel, Tacc, Tdec, Tlacc, Tldec);
```

start\_arc\_ta\_move
```javascript
I16 RetCode;
I16 Axis[2] = {0, 2};
F64 CenterArray [2] = {50.0, 40.0};
F64 Angle= 270;
F64 StrVel= 0.0;
F64 MaxVel= 25.0;
```

```txt
F64 FinVel= 0.0;
F64 Tacc = 0.2;
F64 Tdec = 0.1;
RetCode = start_arc_ta_move(Axis, CenterArray, Angle, StrVel, MaxVel, FinVel, Tacc, Tdec);
```
start\_arc\_sa\_move

```txt
I16 RetCode;
I16 Axis[2] = {0, 2};
F64 CenterArray[2] = {50.0, 30.0};
F64 Angle= 360;
F64 StrVel= 0.0;
F64 MaxVel= 25;
F64 FinVel= 0.0;
F64 Tacc = 0.2;
F64 Tdec = 0.2;
F64 Tlacc = 0.1;
F64 Tldec = 0.0;
RetCode = start_arc_sa_move(Axis, CenterArray, Angle, StrVel, MaxVel, FinVel, Tacc, Tdec, Tlacc, Tldec);
```
&lt;Visual Basic&gt;

start\_arc\_tr\_move
```vba
Dim RetCode As Integer
Dim i As Integer
Dim Axis(0 To 1) As Integer, CenterArray (0 To 1)
As Double
Dim Angle As Integer
Dim StrVel As Double, MaxVel As Double, FinVel As Double,
Dim Tacc As Double, Tdec as Double
For i = 0 To 1
Axis(i) = i
CenterArray (i) = i*10+5
Next I
Angle = 90
StrVel = 0#
MaxVel = 10
FinVel = 0#
Tacc = 0.1
Tdec = 0.2
```

```python
RetCode = start_arc_tr_move(Axis(0), CenterArray(0), Angle, StrVel, MaxVel, FinVel, Tacc, Tdec)
```

start\_arc\_sr\_move
```vba
Dim RetCode As Integer
Dim i As Integer
Dim Axis(0 To 1) As Integer, CenterArray (0 To 1)
As Double
Dim Angle As Integer
Dim StrVel As Double, MaxVel As Double, FinVel As Double,
Dim Tacc As Double, Tdec as Double
Dim Tlacc As Double, Tldec as Double
For i = 0 To 1
Axis(i) = i
CenterArray (i) = i*10+5
Next I
Angle = 180
StrVel = 0#
MaxVel = 10
FinVel = 0#
Tacc = 0.1
Tdec = 0.2
RetCode = start_arc_sr_move(Axis(0), CenterArray (0), Angle, StrVel, MaxVel, FinVel, Tacc, Tdec, Tlacc, Tldec)
```

start\_arc\_ta\_move
```txt
Dim RetCode As Integer
Dim i As Integer
Dim Axis(0 To 1) As Integer, CenterArray (0 To 1)
As Double
Dim Angle As Integer
Dim StrVel As Double, MaxVel As Double, FinVel As Double,
Dim Tacc As Double, Tdec as Double
For i = 0 To 1
Axis(i) = i
CenterArray (i) = i*10+5
Next I
Angle = 270
StrVel = 0#
```

```txt
MaxVel = 10
FinVel = 0#
Tacc = 0.1
Tdec = 0.2
RetCode = start_arc_ta_move(Axis(0), CenterArray(0), Angle, StrVel, MaxVel, FinVel, Tacc, Tdec)
```

start\_arc\_sa\_move
```vba
Dim RetCode As Integer
Dim i As Integer
Dim Axis(0 To 1) As Integer, CenterArray (0 To 1)
As Double
Dim Angle As Integer
Dim StrVel As Double, MaxVel As Double, FinVel As Double,
Dim Tacc As Double, Tdec as Double
Dim Tlacc As Double, Tldec as Double
For i = 0 To 1
Axis(i) = i
CenterArray (i) = i*10+5
Next I
Angle = 360
StrVel = 0#
MaxVel = 10
FinVel = 0#
Tacc = 0.1
Tdec = 0.2
Tlacc = 0.1
Tldec = 0.2
RetCode = start_arc_sa_move(Axis(0), CenterArray (0), Angle, StrVel, MaxVel, FinVel, Tacc, Tdec, Tlacc, Tldec)
```

# 1.4.8 Home Move

# @ Name

set\_home\_mode(Axis, HomeMode) - Set home return mode.

home\_move(Axis, StartVel, MaxVel, FinVel, Tacc) - Perform a home return move.

# @ Description

set\_home\_mode:

Configure the home return mode. Refer to chapter 4 for descriptions of different home return modes.

home\_move:

This function will cause the axis to perform a home return move according to the setting of the set\_home\_mode() function. The direction of moving is determined by the sign of velocity parameter (StrVel, MaxVel). Since the stopping condition of this function is determined by home\_mode setting, user should take care to select the initial moving direction. Or user should take care to handle the condition when limit switch is touched or other conditions that is possible causing the axis to stop. Executing tv\_stop(), sv\_stop() or emg\_stop() function during home\_move() can also cause the axis to stop.

# @ Syntax

C/C++ (DOS, Windows)

```csv
I16 set_home_mode(I16 Axis, I16 HomeMode)
I16 home_move(I16 Axis, F64 StartVel, F64 MaxVel, F64 FinVel, F64 Tacc)
```

Visual Basic (Windows)

```txt
set_home_mode (ByVal Axis As Integer, ByVal HomeMode As Integer) As Integer
home_move (ByVal Axis As Integer, ByVal StartVel As Double, ByVal MaxVel As Double, ByVal FinVel As Double, ByVal Tacc As Double) As Integer
```

# @ Arguments

Axis: axis index designated to configure and perform home returning

StrVel: starting velocity in unit of mm per second

MaxVel: maximum velocity in unit of mm per second

FinVel: final velocity in unit of mm per second

Tacc: specified acceleration time in unit of second

HomeMode: modes for home return

# @ Return Code

```csv
ERROR_NoError
ERROR_Dll_Opened_By_Other_Process
ERROR_Wrong_Axis_Number
ERROR_Card_Not_Ready
ERROR_Card_Not_Initial
ERROR_DSP_Not_Ready
ERROR_Axis_Not_In_Control
ERROR_Axis_Servo_Alarm
ERROR_Axis_Is_Not_Ready_ON
ERROR_Axis_Is_Not_Servo_ON
ERROR_Invalid_MaxVelocity
ERROR_Axis_Hand_Shake_Failed
ERROR_Axis_Not_Response
ERROR_Axis_Prepare_For_Motion
ERROR_Axis_Busy_For_Motion
ERROR_Axis_In_EMG_ON
```

# @ Example

```txt
&lt;C/C++&gt;
```

```txt
set_home_mode
```

```txt
I16 RetCode;
I16 Axis = 2;
I16 HomeMode = 0;
RetCode = set_home_mode(Axis, HomeMode);
```

```txt
home_move
```

```javascript
I16 RetCode;
I16 Axis = 2;
```

```txt
F64 StrVel= 0.0;
F64 MaxVel= 5.0;
F64 FinVel= 0.2;
F64 Tacc = 0.3;
RetCode = home_move(Axis, StrVel, MaxVel, FinVel, Tacc);
```

# &lt;Visual Basic&gt;

set\_home\_mode
```vba
Dim RetCode As Integer, Axis As Integer, HomeMode
As Integer
Axis = 2
HomeMode = 0
RetCode = set_home_mode(Axis, HomeMode)
home_move -
Dim RetCode As Integer, Axis As Integer
Dim StrVel As Double, MaxVel As Double, FinVel As Double
Dim Tacc As Double
StrVel = 0
MaxVel = 5.0
FinVel = 0.2
Tacc = 0.3
RetCode = home_move(Axis, StrVel, MaxVel, FinVel, Tacc)
```

# 1.4.9 Continuous Motion - Start/End motion list

# @ Name

start\_motion\_list(Length, \*AxisArray) – declare of begin of list of continuous motion trajectory

end\_motion\_list(void) – declare of end of list of continuous motion trajectory

repeat\_last\_move(Axis) - Repeat last motion list move

# @ Description

start\_motion\_list:

This function is used to declare the starting of a trajectory list. User must call this before building his continuous motion trajectory. Also, this function declares the axes applying continuous motion. Once your program has called this function, remember to call end\_motion\_list() to exit trajectory list. Otherwise, not only the built trajectory list won't work, but also a second start\_motion\_list() will fail.

end\_motion\_list:

This function is used to declare the end of a trajectory list for continuous motion. User must call this function, so that start\_cont\_move() can be successfully executed.

repeat\_last\_move:

This function is used to restart the move created by previous motion list.

# @ Syntax

C/C++ (DOS, Windows)

```txt
I16 start_motion_list(I16 Length, I16 *AxisArray)
I16 end_motion_list(void)
I16 repeat_last_move(I16 Axis)
```

# Visual Basic (Windows)

```txt
start_motion_list (ByVal length As Integer, AxisArray As Integer) As Integer
end_motion_list () As Integer
```

repeat\_last\_move(ByVal Axis As Integer) As Integer

# @ Arguments

Length: the total number of axis to apply move.

\*AxisArray: array of axis number designated to move.

Axis: The first axis of motion list

# @ Return Code

```txt
ERROR_NoError
ERROR_Dll_Opened_By_Other_Process
ERROR_Wrong_Axis_Number
ERROR_Invalid_Length_Of_Axes
ERROR_Card_Not_Ready
ERROR_Card_Not_Initial
ERROR_DSP_Not_Ready
ERROR_Axis_Not_In_Control
ERROR_Axis_Servo_Alarm
ERROR_Axis_Is_Not_Ready_ON
ERROR_Axis_Is_Not_Servo_ON
ERROR_Axis_Prepare_For_Motion
ERROR_Axis_Busy_For_Motion
ERROR_Axis_In_EMG_ON
```

# @ Example

```txt
&lt;C/C++&gt;
```

start\_motion\_list
```c
I16 RetCode;
I16 Length = 2;
I16 Axis[2] = {0, 3};
RetCode = start_motion_list(Length, Axis);
```

end\_motion\_list
```txt
I16 RetCode;
RetCode = end_motion_list();
```
&lt;Visual Basic&gt;

```txt
start_motion_list
```

```txt
Dim RetCode As Integer, Length As Integer, Axis(0 to 2) As Integer
Length = 2
Axis(0) = 0
Axis(1) = 3
RetCode = start_motion_list(Length, Axis(0))
```
end\_motion\_list

```txt
Dim RetCode As Integer
RetCode = end_motion_list()
```

# 1.4.10 Continuous Motion - Add linear trajectory

# @ Name

add\_line\_tr\_move(\*DistArray, StrVel, MaxVel, FinVel, Tacc, Tdec) – add a relative trapezoidal line into trajectory list

add\_line\_sr\_move(\*DistArray, StrVel, MaxVel, FinVel, Tacc, Tdec) – add a relative S-curve line into trajectory list

add\_line\_ta\_move(\*PosArray, StrVel, MaxVel, FinVel, Tacc, Tdec) – add a absolute trapezoidal line into trajectory list

add\_line\_sa\_move(\*PosArray, StrVel, MaxVel, FinVel, Tacc, Tdec) – add a absolute S-curve line into trajectory list

# @ Description

add\_line\_tr\_move:

This function will add a relative trapezoidal line into trajectory list. The StrVel, MaxVel, FinVel is for tangential velocity.

add\_line\_sr\_move:

This function will add a relative S-curve line into trajectory list. The StrVel, MaxVel, FinVel is for tangential velocity.

add\_line\_ta\_move:

This function will add a absolute trapezoidal line into trajectory list. The StrVel, MaxVel, FinVel is for tangential velocity.

add\_line\_sa\_move:

This function will add a absolute S-curve line into trajectory list. The StrVel, MaxVel, FinVel is for tangential velocity.

# @ Syntax

# C/C++ (DOS, Windows)

I16 add\_line\_tr\_move(I16 \*DistArray, F64 StrVel, F64 MaxVel, F64 FinVel, F64 Tacc, F64 Tdec)

```csv
I16 add_line_sr_move(I16 *DistArray, F64 StrVel, F64 MaxVel, F64 FinVel, F64 Tacc, F64 Tdec)
I16 add_line_ta_move(I16 *PosArray, F64 StrVel, F64 MaxVel, F64 FinVel, F64 Tacc, F64 Tdec)
I16 add_line_sa_move(I16 *PosArray, F64 StrVel, F64 MaxVel, F64 FinVel, F64 Tacc, F64 Tdec)
```

# Visual Basic (Windows)

```txt
add_line_tr_move (DistArray As Double, ByVal StrVel As Double, ByVal MaxVel As Double, ByVal FinVel As Double, ByVal Tacc As Double, ByVal Tdec As Double) As Integer
add_line_sr_move (DistArray As Double, ByVal StrVel As Double, ByVal MaxVel As Double, ByVal FinVel As Double, ByVal Tacc As Double, ByVal Tdec As Double, ByVal Tlacc As Double, ByVal Tldec As Double) As Integer
add_line_ta_move (posarray As Double, ByVal StrVel As Double, ByVal MaxVel As Double, ByVal FinVel As Double, ByVal Tacc As Double, ByVal Tdec As Double) As Integer
add_line_sa_move (posarray As Double, ByVal StrVel As Double, ByVal MaxVel As Double, ByVal FinVel As Double, ByVal Tacc As Double, ByVal Tdec As Double, ByVal Tlacc As Double, ByVal Tldec As Double) As Integer
```

# @ Arguments

\*DistArray: array of specified relative distance to move in unit of mm.
\*PosArray: array of specified absolute position to move in unit of mm.

StrVel: starting tangential velocity, in unit of mm per second.

MaxVel: maximum tangential velocity, in unit of mm per second.

FinVel: final tangential velocity, in unit of mm per second.

Tacc: specified acceleration time in unit of second.

Tdec: specified deceleration time in unit of second.

@ Return Code
```txt
ERROR_NoError
ERROR_Dll_Opened_By_Other_Process
ERROR_Motion_List_Not_Started
ERROR_Invalid_Trajectory
```

@ Example
```txt
&lt;C/C++&gt;
add_line_tr_move-
I16 RetCode;
F64 Dist[2] = {10.0, 20.0};
F64 StrVel = 0.0;
F64 MaxVel = 15.0;
F64 FinVel = 0.0;
F64 Tacc = 0.1;
F64 Tdec = 0.2;
RetCode = add_line_tr_move(Dist, StrVel, MaxVel, FinVel, Tacc, Tdec);
```
add\_line\_sr\_move

```c
I16 RetCode;
F64 Dist[2] = {20.0, 20.0};
F64 StrVel = 0.0;
F64 MaxVel = 5.0;
F64 FinVel = 0.0;
F64 Tacc = 0.3
F64 Tdec = 0.2
F64 Tlacc = 0.3;
F64 Tldec = 0.0;
RetCode = add_line_sr_move(Dist, StrVel, MaxVel, FinVel, Tacc, Tdec, Tlacc, Tldec);
```

add\_line\_ta\_move
```txt
I16 RetCode;
F64 Pos[2] = {50.0, 40.0};
F64 StrVel = 0.0;
F64 MaxVel = 25.0;
F64 FinVel = 0.0;
F64 Tacc = 0.2;
F64 Tdec = 0.1;
```

```txt
RetCode = add_line_ta_move(Pos, StrVel, MaxVel, FinVel, Tacc, Tdec);
```

add\_line\_sa\_move
```txt
I16 RetCode;
F64 Pos[2] = {50.0, 30.0};
F64 StrVel = 0.0;
F64 MaxVel = 25;
F64 FinVel = 0.0;
F64 Tacc = 0.2;
F64 Tdec = 0.2;
F64 Tlacc = 0.1;
F64 Tldec = 0.0;
RetCode = add_line_sa_move(Pos, StrVel, MaxVel, FinVel, Tacc, Tdec, Tlacc, Tldec);
```
&lt;Visual Basic&gt;

add\_line\_tr\_move
```txt
Dim RetCode As Integer
Dim Dist(0 To 1) As Double
Dim StrVel As Double, MaxVel As Double, FinVel As Double,
Dim Tacc As Double, Tdec as Double
Dist(0) = 10
Dist(1) = 20
StrVel = 0#
MaxVel = 10
FinVel = 0#
Tacc = 0.1
Tdec = 0.2
Length = 2
RetCode = add_line_tr_move(Dist(0), StrVel, MaxVel, FinVel, Tacc, Tdec)
```
add\_line\_sr\_move

```vba
Dim RetCode As Integer
Dim Dist(0 To 1) As Double
Dim StrVel As Double, MaxVel As Double, FinVel As Double,
Dim Tacc As Double, Tdec as Double
Dim Tlacc As Double, Tldec as Double
Dist(0) = 10
Dist(1) = 20
```

```txt
StrVel = 0#
MaxVel = 10
FinVel = 0#
Tacc = 0.1
Tdec = 0.2
Length = 2
RetCode = add_line_sr_move(Dist(0), StrVel, MaxVel, FinVel, Tacc, Tdec, Tlacc, Tldec)
```
add\_line\_ta\_move

```txt
Dim RetCode As Integer
Dim Pos(0 To 1) As Double
Dim StrVel As Double, MaxVel As Double, FinVel As Double,
Dim Tacc As Double, Tdec as Double
Pos(0) = 10
Pos(1) = 20
StrVel = 0#
MaxVel = 10
FinVel = 0#
Tacc = 0.1
Tdec = 0.2
Length = 2
RetCode = add_line_ta_move(Pos(0), StrVel, MaxVel, FinVel, Tacc, Tdec)
```
add\_line\_sa\_move

```vba
Dim RetCode As Integer
Dim Pos(0 To 1) As Double
Dim StrVel As Double, MaxVel As Double, FinVel As Double,
Dim Tacc As Double, Tdec as Double
Dim Tlacc As Double, Tldec as Double
Pos(0) = 10
Pos(1) = 20
StrVel = 0#
MaxVel = 10
FinVel = 0#
Tacc = 0.1
Tdec = 0.2
Tlacc = 0.1
Tldec = 0.2
Length = 2
```

RetCode = add\_line\_sa\_move(Pos(0), StrVel, MaxVel, FinVel, Tacc, Tdec, Tlacc, Tldec)

# 1.4.11 Continuous Motion - Add arc trajectory

# @ Name

add\_arc\_tr\_move(\*CenterArray, Angle, StrVel, MaxVel, FinVel, Tacc, Tdec) – add a relative trapezoidal 2D arc into trajectory list

add\_arc\_sr\_move(\*CenterArray, Angle, StrVel, MaxVel, FinVel, Tacc, Tdec) - add a relative S-curve 2D arc into trajectory list

add\_arc\_ta\_move(\*CenterArray, Angle, StrVel, MaxVel, FinVel, Tacc, Tdec) – add a absolute trapezoidal 2D arc into trajectory list

add\_arc\_sa\_move(\*CenterArray, Angle, StrVel, MaxVel, FinVel, Tacc, Tdec) – add a absolute S-curve 2D arc into trajectory list

add\_arc2\_sa\_move(\*AxisArray, \*CenterPosArray, Angle, StrVel, MaxVel, FinVel, Tacc, Tlacc, Tdec, Tldec)

add\_arc2\_sr\_move(\*AxisArray, \*CenterDistArray, Angle, StrVel, MaxVel, FinVel, Tacc, Tlacc, Tdec, Tldec)

add\_arc2\_ta\_move(\*AxisArray, \*CenterPosArray, Angle, StrVel, MaxVel, FinVel, Tacc, Tdec)

add\_arc2\_tr\_move(\*AxisArray, \*CenterDistArray, Angle, StrVel, MaxVel, FinVel, Tacc, Tdec)

# @ Description

add\_arc\_tr\_move:

This function will add a relative trapezoidal 2D arc into continuous motion trajectory. The StrVel, MaxVel, FinVel is for tangential velocity.

Note: This function is useless if Length of start\_motion\_list() is not equal to 2.

add\_arc\_sr\_move:

This function will add a relative S-curve arc into continuous motion trajectory. The StrVel, MaxVel, FinVel is for tangential velocity.

Note: This function is useless if Length of start\_motion\_list() is not equal to 2.

add\_arc\_ta\_move:

This function will add a absolute trapezoidal arc into continuous motion trajectory. The StrVel, MaxVel, FinVel is for tangential velocity.

Note: This function is useless if Length of start\_motion\_list() is not equal to 2.

add\_arc\_sa\_move:

This function will add a absolute S-curve arc into continuous motion trajectory. The StrVel, MaxVel, FinVel is for tangential velocity.

Note: This function is useless if Length of start\_motion\_list() is not equal to 2.

add\_arc2\_tr\_move:

This function will add a relative trapezoidal 2D arc into continuous motion trajectory. The StrVel, MaxVel, FinVel is for tangential velocity.

add\_arc2\_sr\_move:

This function will add a relative S-curve arc into continuous motion trajectory. The StrVel, MaxVel, FinVel is for tangential velocity.

add\_arc2\_ta\_move:

This function will add a absolute trapezoidal arc into continuous motion trajectory. The StrVel, MaxVel, FinVel is for tangential velocity.

add\_arc2\_sa\_move:

This function will add a absolute S-curve arc into continuous motion trajectory. The StrVel, MaxVel, FinVel is for tangential velocity.

# @ Syntax

# C/C++ (DOS, Windows)

I16 add\_arctr\_move(F64 \*CenterArray, F64 Angle, F64 StrVel, F64 MaxVel, F64 FinVel, F64 Tacc, F64 Tdec)
I16 add\_arc\_sr\_move(F64 \*CenterArray, F64 Angle, F64 StrVel, F64 MaxVel, F64 FinVel, F64 Tacc, F64 Tdec)
I16 add\_arc\_ta\_move(F64 \*CenterArray, F64 Angle, F64 StrVel, F64 MaxVel, F64 FinVel, F64 Tacc, F64 Tdec)
I16 add\_arc\_sa\_move(F64 \*CenterArray, F64 Angle, F64 StrVel, F64 MaxVel, F64 FinVel, F64 Tacc, F64 Tdec)
I16 add\_arc2\_sa\_move(I16 \*AxisArray, F64\* CenterPosArray, F64 Angle, F64 StrVel, F64 MaxVel, F64 FinVel, F64 Tacc, F64 Tlacc, F64 Tdec, F64 Tldec)
I16 add\_arc2\_sr\_move(I16 \*AxisArray,F64\* CenterDistArray, F64 Angle,F64 StrVel,F64 MaxVel,F64 FinVel,F64 Tacc,F64 Tlacc,F64 Tdec,F64 Tldec)
I16 add\_arc2\_ta\_move(I16 \*AxisArray, F64\* CenterPosArray, F64 Angle, F64 StrVel, F64 MaxVel, F64 FinVel, F64 Tacc, F64 Tdec)
I16 add\_arc2\_tr\_move(I16 \*AxisArray, F64\* CenterDistArray, F64 Angle, F64 StrVel, F64 MaxVel, F64 FinVel, F64 Tacc, F64 Tdec)

# Visual Basic (Windows)

add\_arc\_tr\_move (CenterDistArray As Double, ByVal Angle As Double, ByVal StrVel As Double, ByVal MaxVel As Double, ByVal FinVel As Double, ByVal Tacc As Double, ByVal Tdec As Double) As Integer
add\_arc\_sr\_move (CenterDistArray As Double, ByVal Angle As Double, ByVal StrVel As Double, ByVal MaxVel As Double, ByVal FinVel As Double, ByVal Tacc As Double, ByVal Tdec As Double, ByVal Tlacc As Double, ByVal Tldec As Double) As Integer

add\_arc\_ta\_move (CenterPosArray As Double, ByVal Angle As Double, ByVal StrVel As Double,

```txt
ByVal MaxVel As Double, ByVal FinVel As Double, ByVal Tacc As Double, ByVal Tdec As Double) As Integer

add_arc_sa_move (CenterPosArray As Double, ByVal Angle As Double, ByVal StrVel As Double, ByVal MaxVel As Double, ByVal FinVel As Double, ByVal Tacc As Double, ByVal Tdec As Double, ByVal Tlacc As Double, ByVal Tldec As Double) As Integer

add_arc2_tr_move (AxisArray As Integer, CenterDistArray As Double, ByVal Angle As Double, ByVal StrVel As Double, ByVal MaxVel As Double, ByVal FinVel As Double, ByVal Tacc As Double, ByVal Tdec As Double) As Integer

add_arc2_sr_move (AxisArray As Integer, CenterDistArray As Double, ByVal Angle As Double, ByVal StrVel As Double, ByVal MaxVel As Double, ByVal FinVel As Double, ByVal Tacc As Double, ByVal Tdec As Double, ByVal Tlacc As Double, ByVal Tldec As Double) As Integer

add_arc2_ta_move (AxisArray As Integer, CenterPosArray As Double, ByVal Angle As Double, ByVal StrVel As Double, ByVal MaxVel As Double, ByVal FinVel As Double, ByVal Tacc As Double, ByVal Tdec As Double) As Integer

add_arc2_sa_move (AxisArray As Integer, CenterPosArray As Double, ByVal Angle As Double, ByVal StrVel As Double, ByVal MaxVel As Double, ByVal FinVel As Double, ByVal Tacc As Double, ByVal Tdec As Double, ByVal Tlacc As Double, ByVal Tldec As Double) As Integer
```

# @ Arguments

\*AxisArray: array of axis number designated to move.

\*CenterArray: the coordinate of arc center in unit of mm.

Angle: specified moving angle in unit of degree.

StrVel: starting tangential velocity, in unit of mm per second.

MaxVel: maximum tangential velocity, in unit of mm per second.

FinVel: final tangential velocity, in unit of mm per second.

\*AxisArray: array of axis number designated to move.

Tacc: specified total acceleration time in unit of second.

Tdec: specified total deceleration time in unit of second.

Tlacc: specified linear acceleration time in unit of second.

T1dec: specified linear deceleration time in unit of second.

# @ Return Code

```txt
ERROR_NoError
ERROR_Dll_Opened_By_Other_Process
ERROR_Motion_List_Not Started
ERROR_Invalid_Trajectory
```

# @ Example

```txt
&lt;C/C++&gt;
```

add\_arc\_tr\_move
```c
I16 RetCode;
F64 CenterArray [2] = {10.0, 20.0};
F64 Angle = 90;
F64 StrVel = 0.0;
F64 MaxVel = 15.0;
F64 FinVel = 0.0;
F64 Tacc = 0.1;
F64 Tdec = 0.2;
RetCode = add_arc_tr_move(CenterArray, Angle, StrVel, MaxVel, FinVel, Tacc, Tdec);
```

add\_arc\_sr\_move
```txt
I16 RetCode;
F64 CenterArray [2] = {20.0, 20.0};
F64 Angle = 180;
F64 StrVel = 0.0;
F64 MaxVel = 5.0;
F64 FinVel = 0.0;
F64 Tacc = 0.3
F64 Tdec = 0.2
F64 Tlacc = 0.3;
```

```txt
F64 Tldec = 0.0;
RetCode = add_arc_sr_move(CenterArray, Angle, StrVel, MaxVel, FinVel, Tacc, Tdec, Tlacc, Tldec);
```

add\_arc\_ta\_move
```txt
I16 RetCode;
F64 CenterArray [2] = {50.0, 40.0};
F64 Angle = 270;
F64 StrVel = 0.0;
F64 MaxVel = 25.0;
F64 FinVel = 0.0;
F64 Tacc = 0.2;
F64 Tdec = 0.1;
RetCode = add_arc_ta_move(CenterArray, Angle, StrVel, MaxVel, FinVel, Tacc, Tdec);
```

add\_arc\_sa\_move
```txt
I16 RetCode;
F64 CenterArray[2] = {50.0, 30.0};
F64 Angle = 360;
F64 StrVel = 0.0;
F64 MaxVel = 25;
F64 FinVel = 0.0;
F64 Tacc = 0.2;
F64 Tdec = 0.2;
F64 Tlacc = 0.1;
F64 Tldec = 0.0;
RetCode = add_arc_sa_move(CenterArray, Angle, StrVel, MaxVel, FinVel, Tacc, Tdec, Tlacc, Tldec);
```

add\_arc2\_tr\_move
```txt
I16 RetCode;
I16 Axis[2] = {0, 2};
F64 CenterArray [2] = {10.0, 20.0};
F64 Angle = 90;
F64 StrVel = 0.0;
F64 MaxVel = 15.0;
F64 FinVel = 0.0;
F64 Tacc = 0.1;
F64 Tdec = 0.2;
```

```txt
RetCode = add_arc2_tr_move(Axis, CenterArray, Angle, StrVel, MaxVel, FinVel, Tacc, Tdec);
```

add\_arc2\_sr\_move
```txt
I16 RetCode;
I16 Axis[2] = {0, 2};
F64 CenterArray [2] = {20.0, 20.0};
F64 Angle = 180;
F64 StrVel = 0.0;
F64 MaxVel = 5.0;
F64 FinVel = 0.0;
F64 Tacc = 0.3
F64 Tdec = 0.2
F64 Tlacc = 0.3;
F64 Tldec = 0.0;
RetCode = add_arc2_sr_move(Axis, CenterArray, Angle, StrVel, MaxVel, FinVel, Tacc, Tdec, Tlacc, Tldec);
```

add\_arc2\_ta\_move
```c
I16 RetCode;
I16 Axis[2] = {0, 2};
F64 CenterArray [2] = {50.0, 40.0};
F64 Angle = 270;
F64 StrVel = 0.0;
F64 MaxVel = 25.0;
F64 FinVel = 0.0;
F64 Tacc = 0.2;
F64 Tdec = 0.1;
RetCode = add_arc2_ta_move(Axis, CenterArray, Angle, StrVel, MaxVel, FinVel, Tacc, Tdec);
```

add\_arc2\_sa\_move
```javascript
I16 RetCode;
I16 Axis[2] = {0, 2};
F64 CenterArray[2] = {50.0, 30.0};
F64 Angle= 360;
F64 StrVel= 0.0;
F64 MaxVel= 25;
F64 FinVel= 0.0;
F64 Tacc = 0.2;
F64 Tdec = 0.2;
F64 Tlacc = 0.1;
```

```txt
F64 Tldec = 0.0;
RetCode = add_arc2_sa_move(Axis, CenterArray, Angle, StrVel, MaxVel, FinVel, Tacc, Tdec, Tlacc, Tldec);
```

# &lt;Visual Basic&gt;

add\_arc\_tr\_move
```txt
Dim RetCode As Integer
Dim i As Integer
Dim CenterArray (0 To 1) As Double
Dim Angle As Integer
Dim StrVel As Double, MaxVel As Double, FinVel As Double,
Dim Tacc As Double, Tdec as Double
For i = 0 To 1
CenterArray (i) = i*10+5
Next I
Angle = 90
StrVel = 0#
MaxVel = 10
FinVel = 0#
Tacc = 0.1
Tdec = 0.2
RetCode = add_arc_tr_move(CenterArray (0), Angle, StrVel, MaxVel, FinVel, Tacc, Tdec)
```

add\_arc\_sr\_move
```vba
Dim RetCode As Integer
Dim i As Integer
Dim CenterArray (0 To 1) As Double
Dim Angle As Integer
Dim StrVel As Double, MaxVel As Double, FinVel As Double,
Dim Tacc As Double, Tdec as Double
Dim Tlacc As Double, Tldec as Double
For i = 0 To 1
CenterArray (i) = i*10+5
Next I
Angle = 180
StrVel = 0#
MaxVel = 10
FinVel = 0#
Tacc = 0.1
```

```txt
Tdec = 0.2
RetCode = add_arc_sr_move(CenterArray(0), Angle, StrVel, MaxVel, FinVel, Tacc, Tdec, Tlacc, Tldec)
```

add\_arc\_ta\_move
```txt
Dim RetCode As Integer
Dim i As Integer
Dim CenterArray (0 To 1) As Double
Dim Angle As Integer
Dim StrVel As Double, MaxVel As Double, FinVel As Double,
Dim Tacc As Double, Tdec as Double
For i = 0 To 1
CenterArray (i) = i*10+5
Next I
Angle = 270
StrVel = 0#
MaxVel = 10
FinVel = 0#
Tacc = 0.1
Tdec = 0.2
RetCode = add_arc_ta_move(CenterArray (0), Angle, StrVel, MaxVel, FinVel, Tacc, Tdec)
```

add\_arc\_sa\_move
```vba
Dim RetCode As Integer
Dim i As Integer
Dim CenterArray (0 To 1) As Double
Dim Angle As Integer
Dim StrVel As Double, MaxVel As Double, FinVel As Double,
Dim Tacc As Double, Tdec as Double
Dim Tlacc As Double, Tldec as Double
For i = 0 To 1
CenterArray (i) = i*10+5
Next I
Angle = 360
StrVel = 0#
MaxVel = 10
FinVel = 0#
Tacc = 0.1
Tdec = 0.2
```

```erlang
Tlacc = 0.1
Tldec = 0.2
RetCode = add_arc_sa_move(CenterArray(0), Angle, StrVel, MaxVel, FinVel, Tacc, Tdec, Tlacc, Tldec)
```

add\_arc2\_tr\_move
```txt
Dim RetCode As Integer
Dim i As Integer
Dim Axis(0 To 1) As Integer, CenterArray (0 To 1)
As Double
Dim Angle As Integer
Dim StrVel As Double, MaxVel As Double, FinVel As Double,
Dim Tacc As Double, Tdec as Double
For i = 0 To 1
Axis(i) = i
CenterArray (i) = i*10+5
Next I
Angle = 90
StrVel = 0#
MaxVel = 10
FinVel = 0#
Tacc = 0.1
Tdec = 0.2
RetCode = add_arc2_tr_move(Axis(0), CenterArray(0), Angle, StrVel, MaxVel, FinVel, Tacc, Tdec)
```

add\_arc2\_sr\_move
```vba
Dim RetCode As Integer
Dim i As Integer
Dim Axis(0 To 1) As Integer, CenterArray (0 To 1)
As Double
Dim Angle As Integer
Dim StrVel As Double, MaxVel As Double, FinVel As Double,
Dim Tacc As Double, Tdec as Double
Dim Tlacc As Double, Tldec as Double
For i = 0 To 1
Axis(i) = i
CenterArray (i) = i*10+5
Next I
```

```txt
Angle = 180
StrVel = 0#
MaxVel = 10
FinVel = 0#
Tacc = 0.1
Tdec = 0.2
RetCode = add_arc2_sr_move(Axis(0), CenterArray(0), Angle, StrVel, MaxVel, FinVel, Tacc, Tdec, Tlacc, Tldec)
```
add\_arc2\_ta\_move

```vba
Dim RetCode As Integer
Dim i As Integer
Dim Axis(0 To 1) As Integer, CenterArray (0 To 1)
As Double
Dim Angle As Integer
Dim StrVel As Double, MaxVel As Double, FinVel As Double,
Dim Tacc As Double, Tdec as Double
For i = 0 To 1
Axis(i) = i
CenterArray (i) = i*10+5
Next I
Angle = 270
StrVel = 0#
MaxVel = 10
FinVel = 0#
Tacc = 0.1
Tdec = 0.2
RetCode = add_arc2_ta_move(Axis(0), CenterArray(0), Angle, StrVel, MaxVel, FinVel, Tacc, Tdec)
```

add\_arc2\_sa\_move
```txt
Dim RetCode As Integer
Dim i As Integer
Dim Axis(0 To 1) As Integer, CenterArray (0 To 1)
As Double
Dim Angle As Integer
Dim StrVel As Double, MaxVel As Double, FinVel As Double,
Dim Tacc As Double, Tdec as Double
Dim Tlacc As Double, Tldec as Double
```

```txt
For i = 0 To 1
    Axis(i) = i
CenterArray (i) = i*10+5
Next I
Angle = 360
StrVel = 0#
MaxVel = 10
FinVel = 0#
Tacc = 0.1
Tdec = 0.2
Tlacc = 0.1
Tldec = 0.2
RetCode = add_arc2_sa_move(Axis(0), CenterArray(0), Angle, StrVel, MaxVel, FinVel, Tacc, Tdec, Tlacc, Tldec)
```

# 1.4.12 Continuous Motion - Add dwell

# @ Name

add\_dwell(Sec) - add a waiting time into trajectory list

# @ Description

add\_dwell:

This function will add a pause period into motion trajectory. The waiting time is in unit of second.

# @ Syntax

C/C++ (DOS, Windows)

I16 add\_dwell (F64 Sec)

Visual Basic (Windows)

add\_dwell (ByVal Sec As Double) As Integer

# @ Arguments

Sec: dwell period, in unit of second (Min. resolution is 1 ms)

# @ Return Code

```txt
ERROR_NoError
ERROR_Dll_Opened_By_Other_Process
ERROR_Motion_List_Not Started
```

# @ Example

```txt
&lt;C/C++&gt;
```

```ignorefile
add_dwell
```

```c
I16 RetCode;
F64 TimeSec = 1; // 1 second
RetCode = add_dwell(TimeSec);
```

# &lt;Visual Basic&gt;

```ignorefile
add_dwell
```

```vba
Dim RetCode As Integer
Dim TimeSec As Double
TimeSec = 1 '1 Second
```

RetCode = add\_dwell(TimeSec)

# 1.4.13 Continuous Motion - Smooth trajectory

# @ Name

smooth\_enable(Flag, R) - enable/disable trajectory auto smoothing function

# @ Description

smooth\_enable:

This function is used to enable/disable the smoothing facility. When enabled, the intersection of 2 trajectory will be rounded automatically. Please refer to chapter 4 for more detail explanation.

# @ Syntax

C/C++ (DOS, Windows)

I16 smooth\_enable(I16 Flag, F64 R)

Visual Basic (Windows)

smooth\_enable(ByVal Flag As Integer, ByVal R As Double) As Integer

# @ Arguments

Flag: enable/disable of smoothing facility

disable: 0, (Default)

enable: 1,

R: The distance between intersection and round-starting point.

# @ Return Code

```txt
ERROR_NoError
ERROR_Dll_Opened_By_Other_Process
ERROR_Motion_List_Not Started
```

# @ Example

```txt
&lt;C/C++&gt;
```

```txt
smooth_enable
```

```txt
I16 RetCode;
I16 Flag = 1; // smooth enabled
F64 Radius = 3; // 3mm
RetCode = smooth_enable(Flag, Radius);
```

# &lt;Visual Basic&gt;

smooth\_enable
```txt
Dim RetCode As Integer
Dim Flag As Integer, Radius As Double
Flag = 1 ' Enabled
Radius = 3# '3mm
RetCode = smooth_enable(Flag, Radius)
```

# 1.4.14 Continuous Motion - Start/Stop command

# @ Name

start\_cont\_move(Void) - Start continuous motion
stop\_cont\_move(Void) - Stop continuous motion

# @ Description

start\_cont\_move:

After building a trajectory by start/stop motion list commands or loading it from file, this function can be executed to realize it.

stop\_cont\_move:

This function is used to immediately stop the continuous motion. All axes specified in AxisArray in start\_motion\_list() will stop. If user want to stop only one axis, he can use tv\_stop(), sv\_stop or emg\_stop(), and, in that case, other axes will keep going.

# @ Syntax

C/C++ (DOS, Windows)

```txt
I16 start_cont_move(Void)
I16 stop_cont_move(Void)
```

Visual Basic (Windows)

```txt
start_cont_move () As Integer
stop_cont_move () As Integer
```

# @ Arguments

# @ Return Code

```txt
ERROR_NoError
ERROR_Dll_Opened_By_Other_Process
ERROR_Motion_List_Not_Defined
ERROR_Card_Not_Ready
ERROR_Card_Not_Initial
ERROR_DSP_Not_Ready
ERROR_Axis_Not_In_Control
ERROR_Axis_Servo_Alarm
ERROR_Axis_Is_Not_Ready_ON
ERROR_Axis_Is_Not_Servo_ON
ERROR_Axis_Hand_Shake_Failed
```

ERROR\_Axis\_Not\_Response

@ Example
```txt
&lt;C/C++&gt;
start_cont_move
    I16 RetCode;
    RetCode = start_cont_move();
stop_cont_move
    I16 RetCode;
    RetCode = stop_cont_move();
```
&lt;Visual Basic&gt;

```python
start_cont_move
Dim RetCode As Integer
RetCode = start_cont_move()
stop_cont_move
Dim RetCode As Integer
RetCode = stop_cont_move ()
```

# 1.5 Motion Related I/O Function

# 1.5.1 Position control and feedback

# @ Name

get\_position(Axis, \*Pos\_F, \*Pos\_C) - get current position of specified axis

set\_position(Axis,Pos) - set current position of specified axis

get\_target\_pos(Axis,\* TargetPos) - get current target position of specified axis

get\_move\_ratio(Axis, \*PulsePerMM) - get motion ration of specified axis

set\_move\_ratio(Axis, PulsePerMM) - set motion ration of specified axis

get\_fb\_position(Axis, \*Pos\_F) - get feedback position only

shift\_position(Axis, Pos) - Offset both feedback and command position synchronized with SSCNET cycle

# @ Description

get\_position:

This function is used to read the value of current position of specified axis. Both command position and feedback position can be retrieved. The position information is in unit of mm.

set\_position:

This function is used to set the value of current position of specified axis. The Pos carry the position information in unit of mm.

get\_target\_pos:

This function is used to get current target position of specified axis, which is maintained by software driver. It records the position to settle down for current running motion.

get\_move\_ratio:

This function is used to read the resolution setting of specified axis in unit of pulse/mm.

set\_move\_ratio:

This function is used to set the resolution of axis. If the encoder resolution is 10000 pulses per revolution, and the displacement in one revolution is $5\mathrm{mm}$ , then the value of PulsePerMM is 10000/5 = 2000.0 (pulse / mm)

get\_fb\_position:

This function is used to get the feedback position only. Not like get\_position, it saves get command position time. The position information is in unit of mm.

shift\_position:

This function is used to shift the feedback and command position inside the SSCNET control board. It is synchronized with the SSCNET cycle. The purpose is to prevent the 32-bit counters overflow. Especially in endless one direction move application. The position information is in unit of mm.

@ Syntax

C/C++ (DOS, Windows)

```csv
I16 get_position(I16 Axis, F64 *Pos_F, F64 *Pos_C)
I16 set_position(I16 Axis, F64 Pos)
I16 get_target_pos(I16 Axis, F64 *TargetPos)
I16 get_move_ratio(I16 Axis, F32 *PulsePerMM)
I16 set_move_ratio(I16 Axis, F32 PulsePerMM)
I16 get_fb_position(I16 Axis, F64 *Pos_F)
I16 shift_position(I16 Axis, F64 shiftMM)
```

Visual Basic (Windows)

```txt
get_position (ByVal Axis As Integer, Pos_F As Double, Pos_C As Double) As Integer
set_position (ByVal Axis As Integer, ByVal Position As Double) As Integer
get_target_pos (ByVal Axis As Integer, Position As Double) As Integer
get_move_ratio (ByVal Axis As Integer, PulsePerMM As Single) As Integer
```

```txt
set_move_ratio (ByVal Axis As Integer, ByVal PulsePerMM As Single) As Integer
get_fb_position (ByVal Axis As Integer, Pos_F As Double) As Integer
shift_position (ByVal Axis As Integer, ByVal shiftMM As Double) As Integer
```

# @ Arguments

Axis: designated axis index.

Pos\_F: current feedback position value in unit of mm.

Pos\_C: current command position value in unit of mm.

TargetPos: target position value in unit of mm.

PulsePerMM: specified resolution in unit of pulse/mm.

shiftMM: the shift value in mm

# @ Return Code

```txt
ERROR_NoError
ERROR_Dll_Opened_By_Other_Process
ERROR_Wrong_Axis_Number
ERROR_Card_Not_Ready
ERROR_Card_Not_Initial
ERROR_DSP_Not_Ready
ERROR_Axis_Not_In_Control
ERROR_Axis_Busy_For_Motion
ERROR_Invalid_MoveRatio
```

# @ Example

```txt
&lt;C/C++&gt;
```

get\_position
```txt
I16 RetCode;
I16 Axis = 1;
F64 Pos_F;
F64 Pos_C;
RetCode = get_position(Axis, &Pos_F, &Pos_C);
```

set\_position
```javascript
I16 RetCode;
I16 Axis = 1;
```

```txt
F64 Pos = 0.0;
RetCode = set_position(Axis, Pos)
```
get\_target\_position

```txt
I16 RetCode;
I16 Axis = 0;
F64 TargetPos;
RetCode = get_target_pos(Axis, &TargetPos)
```
get\_move\_ratio

```txt
I16 RetCode;
I16 Axis = 0;
F32 PulsePerMM;
RetCode = get_move_ratio(Axis, &PulsePerMM);
```
set\_move\_ratio

```c
I16 RetCode;
I16 Axis = 0;
F32 PulsePerMM = 1000.0; // 1000.0 (pulse/mm)
RetCode = set_move_ratio(Axis, PulsePerMM);
```
&lt;Visual Basic&gt;

get\_position
```vba
Dim RetCode As Integer
Dim Axis As Integer
Dim Pos_F As Double, Pos_C As Double
Axis = 1
RetCode = get_position(Axis, Pos_F, Pos_C)
```

set\_position
```vba
Dim RetCode As Integer
Dim Axis As Integer
Dim Pos As Double
Axis = 1
Pos = 0#
RetCode = set_position(Axis, Pos)
```

get\_target\_position
```txt
Dim RetCode As Integer
Dim Axis As Integer
Dim TargetPos As Double
Axis = 1
RetCode = get_target_pos(Axis, TargetPos)
```

get\_move\_ratio
```vba
Dim RetCode As Integer
Dim Axis As Integer
Dim PulsePerMM As Double
Axis = 0
RetCode = get_move_ratio(Axis, PulsePerMM)
```
set\_move\_ratio

```txt
Dim RetCode As Integer
Dim Axis As Integer
Dim PulsePerMM As Double
Axis = 0
PulsePerMM = 1000#    ' 1000.0 (pulse/mm)
RetCode = set_move_ratio(Axis, PulsePerMM)
```

# 1.5.2 Velocity Feedback

# @ Name

get\_velocity(Axis, \*Vel\_F, \*Vel\_C) - Get current speed of specified axis

get\_cnt\_speed(CardID, EncNo, \*PPS) - Get external encoder input counter speed

# @ Description

get\_velocity:

This function is used to read current speed of specified axis. Both command velocity and feedback velocity can be retrieved.

get\_cnt\_speed:

This function is used to read current speed of specified external encoder counter in unit of PPS. Notice that the value is calculated by SSCNET cycle. It means that the minimum value is I pulse per SSCNET cycle.

@ Syntax

C/C++ (DOS, Windows)

```csv
I16 get_velocity(I16 Axis, F64 *Vel_F, F64 *Vel_C)
I16 get_cnt_speed(I16 CardID, I16 EncNo, F32 *PPS)
```

# Visual Basic (Windows)

```txt
get_velocity (ByVal Axis As Integer, Vel_F As Double, Vel_C As Double) As Integer
get_cnt_speed (ByVal CardID As Integer, ByVal EncNo As Integer, PPS As float) As Integer
```

# @ Arguments

Axis: designated axis index.

\*Vel\_F: current feedback speed value in unit of mm/sec
\*Vel\_C: current command speed value in unit of mm/sec
CardID: The CardID from MDSP\_Initial()

EncNo: The encoder number

PPS: encoder counter speed in PPS

# @ Return Code

```txt
ERROR_NoError
ERROR_Dll_Opened_By_Other_Process
ERROR_Wrong_Axis_Number
ERROR_Card_Not_Ready
ERROR_Card_Not_Initial
ERROR_DSP_Not_Ready
ERROR_Axis_Not_In_Control
```

# @ Example

```txt
&lt;C/C++&gt;
```

get\_velocity
```txt
I16 RetCode;
I16 Axis = 1;
F64 Vel_F;
F64 Vel_C;
RetCode = get_velocity(Axis, & Vel_F, & Vel_C);
```

# &lt;Visual Basic&gt;

get\_velocity
```txt
Dim RetCode As Integer
Dim Axis As Integer
Dim Vel_F As Double, Vel_C As Double
Axis = 1
RetCode = get_velocity (Axis, Vel_F, Vel_C)
```

# 1.5.3 Motion DIO Status

# @ Name

```c
set_PEL_config(Axis, Logic, Mode) - Set configure of PEL signal
set_MEL_config(Axis, Logic, Mode) - Set configure of MEL signal
set_ORG_config(Axis, Logic) - Set configure of ORG signal
set_EMG_config(CardID, Logic) - Set configure of EMG signal
get_PEL_status(Axis, *Status) - get status of PEL signal
get_MEL_status(Axis, *Status) - get status of MEL signal
get_ORG_status(Axis, *Status) - get status of ORG signal
get_EMG_status(CardID, *Status) - get status of EMG signal
```

# @ Description

```c
set_PEL_config, set_MEL_config, set_ORG_config, set_EMG_config:
```

These functions are used to set the configuration of motion-related IO, ie PEL, MEL, ORG, EMG. The default configuration is “active low”, which means if PEL is giving a 0V, it will cause axis stop to move in positive direction.

```txt
get_PEL_status, get_MEL_status, get_ORG_status, get_EMG_status:
```

These functions are used to get the status of motion IO

# @ Syntax

C/C++ (DOS, Windows)
```csv
I16 set_PEL_config(I16 Axis, I16 Logic, I16 Mode)
I16 set_MEL_config(I16 Axis, I16 Logic, I16 Mode)
I16 set_ORG_config(I16 Axis, I16 Logic)
```

```txt
I16 set_EMG_config(I16 Card, I16 Logic)
I16 get_PEL_status(I16 Axis, I16* Status)
I16 get_MEL_status(I16 Axis, I16* Status)
I16 get_ORG_status(I16 Axis, I16* Status)
I16 get_EMG_status(I16 Card, I16* Status)
```
Visual Basic (Windows)

```csv
get_PEL_status (ByVal Axis As Integer, Status As Integer) As Integer
get_MEL_status (ByVal Axis As Integer, Status As Integer) As Integer
get_ORG_status (ByVal Axis As Integer, Status As Integer) As Integer
get_EMG_status (ByVal Card As Integer, Status As Integer) As Integer
set_PEL_config (ByVal Axis As Integer, ByVal Logic As Integer, ByVal Mode As Integer) As Integer
set_MEL_config (ByVal Axis As Integer, ByVal Logic As Integer, ByVal Mode As Integer) As Integer
set_ORG_config (ByVal Axis As Integer, ByVal Logic As Integer) As Integer
set_EMG_config (ByVal Card As Integer, ByVal Logic As Integer) As Integer
```

# @ Arguments

Axis: designated axis index.

CardID: The SSCNet series card index number.

Logic: to assign the logic of IO

▶ value = 0, active low
▶ value = 1, active high

Mode: to assign the response mode when IO becomes activated

▶ value = 0, stop immediately
▶ value = 1, slow down then stop

Status: IO status, 1 for active, 0 for not active

# @ Return Code

ERROR\_NoError

```txt
ERROR_Dll_Opened_By_Other_Process
ERROR_Wrong_Axis_Number
ERROR_Card_Not_Ready
ERROR_Card_Not_Initial
ERROR_DSP_Not_Ready
```

# @ Example

```txt
&lt;C/C++&gt;
```

set\_PEL\_config
```c
I16 RetCode;
I16 Axis = 1;
I16 Logic = 1;
I16 Mode = 0;
RetCode = set_PEL_config(Axis, Logic, Mode);
```

set\_MEL\_config
```txt
I16 RetCode;
I16 Axis = 1;
I16 Logic = 1;
I16 Mode = 0;
RetCode = set_MEL_config(Axis, Logic, Mode);
```

set\_ORG\_config
```txt
I16 RetCode;
I16 Axis = 1;
I16 Logic = 1;
RetCode = set_ORG_config(Axis, Logic);
```
set\_EMG\_config

```txt
I16 RetCode;
I16 Card = 1;
I16 Logic = 1;
RetCode = set_EMG_config(CardID, Logic);
```
get\_PEL\_status

```c
I16 RetCode;
I16 Axis = 1;
I16 Status;
RetCode = get_PEL_status(Axis, &Status);
```

get\_MEL\_status
```javascript
I16 RetCode;
```

```c
I16 Axis = 1;
I16 Status;
RetCode = get_MEL_status(Axis, &Status);
```
get\_ORG\_status

```c
I16 RetCode;
I16 Axis = 1;
I16 Status;
RetCode = get_ORG_status(Axis, &Status);
```
get\_EMG\_status

```c
I16 RetCode;
I16 Card = 0;
I16 Status;
RetCode = get_EMG_status(CardID, &Status);
```
&lt;Visual Basic&gt;

set\_PEL\_config
```vba
Dim RetCode As Integer
Dim Axis As Integer, Logic As Integer, Mode As Integer
Axis = 1
Logic = 1
Mode = 0
RetCode = set_PEL_config(Axis, Logic, Mode)
```
set\_MEL\_config

```vba
Dim RetCode As Integer
Dim Axis As Integer, Logic As Integer, Mode As Integer
Axis = 1
Logic = 1
Mode = 0
RetCode = set_MEL_config(Axis, Logic, Mode)
```

set\_ORG\_config
```txt
Dim RetCode As Integer
Dim Axis As Integer, Logic As Integer
Axis = 1;
Logic = 1;
RetCode = set_ORG_config(Axis, Logic)
```
set\_EMG\_config

```txt
Dim RetCode As Integer
Dim Card As Integer, Logic As Integer
Card = 1;
Logic = 1;
RetCode = set_EMG_config(CardID, Logic)
```

get\_PEL\_status
```vba
Dim RetCode As Integer
Dim Axis As Integer, Status As Integer
Axis = 1
RetCode = get_PEL_status(Axis, Status)
```

get\_MEL\_status
```vba
Dim RetCode As Integer
Dim Axis As Integer, Status As Integer
Axis = 1
RetCode = get_MEL_status(Axis, Status)
```
get\_ORG\_status

```vba
Dim RetCode As Integer
Dim Axis As Integer, Status As Integer
Axis = 1
RetCode = get_ORG_status(Axis, Status)
```
get\_EMG\_status

```txt
Dim RetCode As Integer
Dim Card As Integer, Status As Integer
Card = 0
RetCode = get_EMG_status(CardID, Status)
```

# 1.5.4 Software Limit

# @ Name

set\_soft\_limit(Axis, PLimit, MLimit, ON\_OFF) - Set and enable/disable soft limit

get\_soft\_limit(Axis, \*PLimit, \*MLimit, \*ON\_OFF) - get current soft limit value

# @ Description

set\_soft\_limit:

This function is used to set the value of software limit and enable/disable the software limit function.

get\_soft\_limit:

This function is used to get current setting value of software limit.

# @ Syntax

C/C++ (DOS, Windows)

```txt
I16 set_soft_limit(I16 Axis, F64 PLimit, F64 MLimit, I16 ON_OFF)
I16 get_soft_limit(I16 Axis, F64 *PLimit, F64 *MLimit, I16 *ON_OFF)
```

# Visual Basic (Windows)

```txt
set_soft_limit(ByVal Axis As Integer, ByVal
    Plimit As Double, ByVal Mlimit As Double,
    ByVal ON_OFF As Integer) As Integer
get_soft_limit(ByVal Axis As Integer, Plimit As
    Double, Mlimit As Double, ON_OFF As Integer)
As Integer
```

# @ Arguments

Axis: designated axis index.

PLimit: the positive software limit value in unit of mm.

MLimit: the minus software limit value in unit of mm.

ON\_OFF: turn ON/OFF the software limit function.

▶ 0: OFF

▶ 1: ON

@ Return Code
```txt
ERROR_NoError
ERROR_Dll_Opened_By_Other_Process
ERROR_Wrong_Axis_Number
ERROR_Card_Not_Ready
ERROR_Card_Not_Initial
ERROR_DSP_Not_Ready
ERROR_Axis_Not_In_Control
```

@ Example
```c
&lt;C/C++&gt;
set_soft_limit
    I16 RetCode;
    I16 Axis = 1;
    F64 Plimit = 100.0;
    F64 Mlimit = -10.0;
    I16 ON_OFF = 1;
    RetCode = set_soft_limit(Axis, PLimit, MLimit, ON_OFF);
```
get\_soft\_limit

```c
I16 RetCode;
I16 Axis = 1;
F64 Plimit, Mlimit;
I16 ON_OFF;
RetCode = get_soft_limit(Axis, &PLimit, &MLimit, &ON_OFF);
```
&lt;Visual Basic&gt;

```txt
set_soft_limit
Dim RetCode As Integer
Dim Axis As Integer, ON_OFF As Integer
Dim Plimit As Double, Mlimit As Double
Axis = 1
Plimit = 100.0
Mlimit = -10.0
```

```txt
ON_OFF = 1
RetCode = set_soft_limit(Axis, PLimit, MLimit, ON_OFF)
```
get\_soft\_limit

```txt
Dim RetCode As Integer
Dim Axis As Integer, ON_OFF As Integer
Dim Plimit As Double, Mlimit As Double
I16 Axis = 1
RetCode = get_soft_limit(Axis, PLimit, MLimit, ON_OFF)
```

# 1.5.5 Motion Status

# @ Name

motion\_status(Axis, \*MotionStatus) - return motion status of specified axis

axis\_status(Axis,\*AxisStatus) – return the servo status of axis.

motion\_done(Axis) – to check if the axis has finished previous motion command

# @ Description

motion\_status:

This function is used to get current motion status of specified axis:

axis\_status:

This function is used to get current servo status of specified axis:

motion\_done:

This function is used to check if the axis has finished previous motion command

▶ return ‘1’ – Axis is ready for next motion command
▶ return '0' – Axis is still in motion

# @ Syntax

C/C++ (DOS, Windows)

```txt
I16 motion_status(I16 Axis, U16* MotionStatus)
I16 axis_status(I16 Axis, U16* AxisStatus)
I16 motion_done(I16 Axis)
```

# Visual Basic (Windows)

```c
motion_status (ByVal Axis As Integer,
    MotionStatus As Integer) As Integer
axis_status (ByVal Axis As Integer, AxisStatus As Integer) As Integer
motion_done (ByVal Axis As Integer) As Integer
```

# @ Arguments

Axis: designated axis index.

\*MotionStatus: axis motion status

<table><tr><td>Bit</td><td>Name</td><td>Description</td></tr><tr><td>0</td><td>Ready_for_Motion</td><td>Axis is not moving and it is available for another move command</td></tr><tr><td>1</td><td>In_Motion</td><td>Axis is moving and can’t accept another move command</td></tr><tr><td>2</td><td>In_Home_Move</td><td>Axis is in moving in home procedure and can’t accept another move command</td></tr><tr><td>3</td><td>In_V_Change</td><td>After lauching velocity change command, this bit will be ON till the change is done</td></tr><tr><td>4</td><td>In_P_Change</td><td>After lauching position change command, this bit will be ON till the change is done</td></tr><tr><td>5</td><td>MEL_ON</td><td>Axis touches the positive limit switch</td></tr><tr><td>6</td><td>PEL_ON</td><td>Axis touches the negative limit switch</td></tr><tr><td>7</td><td>ORG_ON</td><td>Axis touched the origin switch</td></tr><tr><td>8</td><td>EMG_ON</td><td>Emergency input pin is ON</td></tr><tr><td>9</td><td>P_Soft_ON</td><td>Axis is reached the positive software limit</td></tr><tr><td>10</td><td>M_Soft_ON</td><td>Axis is reached the negative software limit</td></tr><tr><td>11</td><td>EZ_ON</td><td>Axis touched the external Index switch</td></tr><tr><td>12</td><td>Stop_cmd_end</td><td>After v_stop() command ends, this bit will be ON</td></tr><tr><td>13</td><td>Stop_cmd_running</td><td>This bit will be ON if users lauched a v_stop() command</td></tr><tr><td>14</td><td>Interlock_Pause</td><td>Once the axis is paused be interlock procedure, this bit will be ON</td></tr><tr><td>15</td><td>Waiting Other Axis</td><td>Command is pending because other axis’ condition has not been met</td></tr></table>

Table 1-4: Motion Status

\*AxisStatus: axis servo status

<table><tr><td>Bit</td><td>Name</td><td>Value &amp; Description</td></tr><tr><td rowspan="2">0</td><td rowspan="2">Not_In_Control</td><td>1: Axis not in control</td></tr><tr><td>0: Axis is in control</td></tr><tr><td rowspan="2">1</td><td rowspan="2">In_Servo_Alarm</td><td>1: Axis is in servo alarm</td></tr><tr><td>0: Axis is not in servo alarm</td></tr></table>

Table 1-5: Axis Status

<table><tr><td>Bit</td><td>Name</td><td>Value &amp; Description</td></tr><tr><td rowspan="2">2</td><td rowspan="2">Not_Ready_ON</td><td>1: Axis not Ready ON</td></tr><tr><td>0: Axis is Ready ON</td></tr><tr><td rowspan="2">3</td><td rowspan="2">Not_Servo_ON</td><td>1: Axis not Servo ON</td></tr><tr><td>0: Axis is Servo ON</td></tr></table>

Table 1-5: Axis Status

# @ Return Code

```txt
ERROR_NoError
ERROR_Dll_Opened_By_Other_Process
ERROR_Wrong_Axis_Number
ERROR_Card_Not_Ready
ERROR_Card_Not_Initial
ERROR_DSP_Not_Ready
ERROR_Axis_Not_In_Control
ERROR_Axis_Servo_Alarm
ERROR_Axis_Is_Not_Ready_ON
ERROR_Axis_Is_Not_Servo_ON
```

# @ Example

```txt
&lt;C/C++&gt;
```
motion\_status

```javascript
I16 RetCode;
I16 Axis = 1;
U16 MotionStatus;
RetCode = motion_status(Axis, &MotionStatus);
```

axis\_status
```txt
I16 RetCode;
I16 Axis = 1;
U16 AxisStatus;
RetCode = axis_status(Axis, &AxisStatus);
```
Motion\_done

```txt
I16 Axis = 1;
while (motion_done(Axis) == 0) { ... };
```
&lt;Visual Basic&gt;

```txt
motion_status
```

```vba
Dim RetCode As Integer
Dim Axis As Integer, MotionStatus As Integer
Axis = 1
RetCode = motion_status(Axis, MotionStatus)
```

axis\_status
```vba
Dim RetCode As Integer
Dim Axis As Integer,AxisStatus As Integer
Axis = 1
RetCode = axis_status(Axis,AxisStatus)
```

Motion\_done
```txt
Dim Axis As Integer
Axis = 0
Do while motion_done(Axis) = 0
...
loop
```

# 1.5.6 Frame Management

# @ Name

frame\_to\_execute(Axis, \*Len) - check the number of remaining frames to be executed

# @ Description

frame\_to\_execute:

This function is used to get the number of remaining frame to be executed.

# @ Syntax

C/C++ (DOS, Windows)

U16 frame\_to\_execute(I16 Axis, I16 \*Len)

Visual Basic (Windows)

frame\_to\_execute (ByVal Axis As Integer, Len As Integer) As Integer

# @ Arguments

Axis: designated axis index.

\*Len: number of frame

# @ Return Code

```txt
ERROR_NoError
ERROR_Dll_Opened_By_Other_Process
ERROR_Wrong_Axis_Number
ERROR_Card_Not_Ready
ERROR_Card_Not_Initial
ERROR_DSP_Not_Ready
ERROR_Axis_Not_In_Control
ERROR_Axis_Servo_Alarm
ERROR_Axis_Is_Not_Ready_ON
ERROR_Axis_Is_Not_Servo_ON
```

# @ Example

```txt
&lt;C/C++&gt;
```

frame\_to\_execute
```txt
I16 RetCode;
I16 Axis = 1;
I16 Len;
RetCode = frame_to_execute(Axis, &Len);
```
&lt;Visual Basic&gt;

frame\_to\_execute
```txt
Dim RetCode As Integer
Dim Axis As Integer, Len As Integer
Axis = 1
RetCode = frame_to_execute (Axis, Len)
```

# 1.6 General-purposed IO Function

# 1.6.1 Encoder

# @ Name

set\_cnt \_iptmode(CardID, EncNo, IptMode) - set the configuration of encoder counter

set\_cnt\_to\_axis(CardID, EncNo, Axis, Resolution) - To assign a counter to some axis as the position feedback source, and declare the resolution of that counter.

set\_cnt\_value(CardID, EncNo, Value) - set current counter value

get\_cnt\_value(CardID, EncNo, \*Value) - get current counter value

set\_ring\_counter(CardID, EncNo, RingValue) - set current ring counter value

get\_ring\_counter(CardID, EncNo, \*RingValue) - get current ring counter value

# @ Description

set\_cnt\_iptmode:

Configure the input modes of encoder counter. There are 3 sets of encoder counter in PCI-83XX series; 2 set in cPCI series.

set\_cnt\_to\_axis:

This function has two functionalities. One is to assign a counter to work as position feedback source of certain axis; the other is to declare the resolution of this counter. For example: set\_cnt\_to\_axis(0, 0, 0, 1000) let the counter "0" of SSCNet board as the position feedback source of axis '0'. This counter counts 1000 pulses when axis 0 rotates one revolution.

set\_cnt\_value:

Set current counter value.

get\_cnt\_value:

Get current counter value.

set\_ring\_counter:

The external encoder counter could be set as ring counter for rotary application. The ring counter value represents a maximum value of the external encoder counter. Once the counter reaches this value, it will automatically reset by hardware. This value is positive but the counter will be reseted both on positive and negative counter value.

If the value is zero, it means disable ring counter.

get\_ring\_counter:

This function is for users to check the current ring counter value.

# @ Syntax

# C/C++ (DOS, Windows)

```csv
I16 set_cnt_iptmode(I16 Card, I16 EncNo, I16 IptMode)
I16 set_cnt_to_axis(I16 Card, I16 EncNo, I16 Axis, F32 Resolution)
I16 set_cnt_value(I16 Card, I16 EncNo, I32 Value)
I16 get_cnt_value(I16 Card, I16 EncNo, I32 *Value)
I16 set_ring_counter(I16 Card, I16 EncNo, I32 RingValue)
I16 get_ring_counter(I16 Card, I16 EncNo, I32 *RingValue)
```

# Visual Basic (Windows)

```txt
set_cnt_iptmode (ByVal Card As Integer, ByVal EncNo As Integer, ByVal IPTMode As Integer) As Integer
set_cnt_to_axis (ByVal Card As Integer, ByVal EncNo As Integer, ByVal Axis As Integer, ByVal Resolution as Single) As Integer
set_cnt_value (ByVal Card As Integer, ByVal EncNo As Integer, ByVal Value As Long) As Integer
get_cnt_value (ByVal Card As Integer, ByVal EncNo As Integer, Value As Long) As Integer
set_ring_counter(ByVal Card As Integer, ByVal EncNo As Integer, ByVal RingValue As Long) As Integer
```

get\_ring\_counter(ByVal Card As Integer, ByVal EncNo As Integer, RingValue As Long) As Integer

# @ Arguments

CardID: The SSCNet series card index number.

EncNo: designated encoder counter channel number.

Axis: designated axis index.

Resolution: number of pulses counted by counter per revolution.

IptMode: setting of encoder feedback pulse input mode

<table><tr><td>Value</td><td>Meaning</td></tr><tr><td>0</td><td>Not Used</td></tr><tr><td>1</td><td>OUT/DIR</td></tr><tr><td>2</td><td>CW/CCW</td></tr><tr><td>3</td><td>4X A/B</td></tr><tr><td>4</td><td>2X A/B</td></tr><tr><td>5</td><td>1X A/B</td></tr></table>

Table 1-6: IPT Modes

Axis: designated index.

Value: counter value.

RingValue: a 32-bit value for ring counter. 0 means disable

# @ Return Code

```txt
ERROR_NoError
ERROR_Dll_Opened_By_Other_Process
ERROR_Card_Not_Exist
ERROR_Card_Not_Ready
ERROR_Card_Not_Initial
ERROR_DSP_Not_Ready
ERROR_Wrong_Encoder_Channel_Number
```

# @ Example

```txt
&lt;C/C++&gt;
```

set\_cnt\_iptmode
```txt
I16 RetCode;
I16 Card = 0;
I16 EncNo = 1;
I16 IptMode = 1;
RetCode = set_cnt_iptmode(CardID, EncNo, IptMode);
```

set\_cnt\_to\_axis
```txt
I16 RetCode;
I16 Card = 0;
I16 EncNo = 0;
I16 Axis = 1
F32 Resolution = 1000.0;
RetCode = set_cnt_to_axis(CardID, EncNo, Axis, Resolution);
```

set\_cnt\_value
```txt
I16 RetCode;
I16 Card = 0;
I16 EncNo = 1;
I32 Value = 0;
RetCode = set_cnt_value(CardID, EncNo, Value);
```
get\_cnt\_value

```txt
I16 RetCode;
I16 Card = 0;
I16 EncNo = 1;
I32 Value;
RetCode = get_cnt_value(CardID, EncNo, &Value);
```
&lt;Visual Basic&gt;

set\_cnt\_iptmode
```txt
Dim RetCode As Integer
Dim Card As Integer, EncNo As Integer, IptMode As Integer
Card = 0
EncNo = 1
IptMode = 1
RetCode = set_cnt _iptmode(CardID, EncNo, IptMode)
```
set\_cnt\_to\_axis

```vba
Dim RetCode As Integer
Dim Card As Integer, EncNo As Integer, Axis As Integer
Dim Resolution As Single
Card = 0
EncNo = 1
IptMode = 1
Resolution = 1000.0
RetCode = set_cnt_to_axis(CardID, EncNo, Axis, Resolution)
```

set\_cnt\_value
```lua
Dim RetCode As Integer
Dim Card As Integer, EncNo As Integer, Value As Long
Card = 0
EncNo = 1
Value = 0
RetCode = set_cnt_value(CardID, EncNo, Value)
```

get\_cnt\_value
```lua
Dim RetCode As Integer
Dim Card As Integer, EncNo As Integer, Value As Long
Card = 0
EncNo = 1
RetCode = get_cnt_value(CardID, EncNo, Value)
```

# 1.6.2 DIO

# @ Name

get\_di\_status(CardID, ChNo ,\*Sts) - get DO status

set\_do\_value(CardID, ChNo, Value) - set DO value

set\_di\_mode(CardID, DI\_Channel, DI\_Mode,

ActiveL) - Set DI mode

set\_mio\_mode(CardID, MDI\_Ch, Mode)

# @ Description

get\_di\_status:

This function is used to get current DI status.

set\_do\_value:

This function is used to set DO value.

set\_di\_mode:

This function is used to set DI Channel mode.

set\_mio\_mode:

This function is used to switch the motion DI (PEL, MEL, EMG) to general purpose DI.

# @ Syntax

# C/C++ (DOS, Windows)

I16 get\_di\_status(I16 Card, I16 ChNo, I16 \*Sts)

I16 set\_do\_value(I16 Card, I16 ChNo, I16 Value)

I16 set\_di\_mode(I16 Card, I16 DI\_Channel, I16 DI\_Mode, I16 ActiveL)

I16 set\_mio\_mode(I16 Card, I16 MDI\_Ch, I16 Mode)

# Visual Basic (Windows)

get\_di\_status (ByVal Card As Integer, ByVal ChNo As Integer, Sts As Integer) As Integer set\_do\_value (ByVal Card As Integer, ByVal ChNo As Integer, ByVal Value As Integer) As Integer

```txt
set_di_mode(ByVal Card As Integer, ByVal DI_Channel As Integer, ByVal DI_Mode As Integer, ByVal ActiveL As Integer)
set_mio_mode(ByVal Card As Integer, ByVal MDI_Ch As Integer, ByVal Mode As Integer)
```

# @ Arguments

CardID: The SSCNet series card index number.

\*sts: DI status :

ChNo: specified channel number

▶ For get\_di\_status : ChNo = 0, 1
For set\_do\_value : ChNo = 0, 1 (DO on CN5); 2 \~7 (TTL output on CN3)

Value: DO value, 0: Low, 1: High

DI\_Channel: 0=EMG, 1=DI0, 2=DI1

DI\_Mode: 0=original function, 1=slow down and stop axis motion

ActiveL: DI active level, 0=active low, 1=active high

MDI\_Ch:

<table><tr><td>Axis</td><td>DI</td><td>MDI_Ch</td></tr><tr><td rowspan="3">Axis 0</td><td>PEL</td><td>0</td></tr><tr><td>MEL</td><td>1</td></tr><tr><td>ORG</td><td>2</td></tr><tr><td rowspan="3">Axis 1</td><td>PEL</td><td>3</td></tr><tr><td>MEL</td><td>4</td></tr><tr><td>ORG</td><td>5</td></tr><tr><td>.</td><td>.</td><td>.</td></tr><tr><td>.</td><td>.</td><td>.</td></tr><tr><td>.</td><td>.</td><td>.</td></tr><tr><td rowspan="3">Axis 11</td><td>PEL</td><td>33</td></tr><tr><td>MEL</td><td>34</td></tr><tr><td>ORG</td><td>35</td></tr></table>

Mode: 0 = Default, 1= general DI

@ Return Code
```txt
ERROR_NoError
ERROR_Dll_Opened_By_Other_Process
ERROR_Card_Not_Exist
ERROR_Card_Not_Ready
ERROR_Card_Not_Initial
ERROR_DSP_Not_Ready
ERROR_Wrong_DIO_Channel_Number
```

@ Example
```c
&lt;C/C++&gt;
get_di_status
    I16 RetCode;
    I16 Card = 0;
    I16 ChNo = 1;
    I16 Sts;
    RetCode = get_di_status(CardID, ChNo, &Sts);
```
set\_do\_value

```c
I16 RetCode;
I16 Card = 0;
I16 ChNo = 1;
I16 Value = 0;
RetCode = set_do_value(CardID, ChNo, Value);
```
&lt;Visual Basic&gt;

get\_di\_status
```vba
Dim RetCode As Integer
Dim Card As Integer, EncNo As Integer, Sts As Long
Card = 0
EncNo = 1
RetCode = get_di_status(CardID, ChNo, Sts)
```
set\_do\_value

```txt
Dim RetCode As Integer
Dim Card As Integer, EncNo As Integer, Value As Long
Card = 0
EncNo = 1
Value = 0
```

RetCode = set\_do\_value(CardID, ChNo, Value)

# 1.6.3 DA

# @ Name

set\_da\_config(CardID, ChNo, Cfg) – set configuration of specified DA channel

set\_da\_value(CardID, ChNo, Value) - set output value of specified DA channel

# @ Description

set\_da\_config:

Set DA output configuration. There are 2 options. One is for direct DA output and the other is for velocity profile output. The default is DA direct output. By direct DA output, user can control DA value by using set\_da\_value() function. While if velocity profile output is selected, the DA output value will be proportional to current command velocity.

set\_da\_value:

Set output value/voltage to specified DA channel. There are 2 12-bit DA channels in PCI-83XX Series card.

@ Syntax

C/C++ (DOS, Windows)

```txt
I16 set_da_config(I16 Card, I16 ChNo, U16 Cfg)
I16 set_da_value(I16 Card, I16 ChNo, F64 Value)
```

Visual Basic (Windows)

```c
set_da_config (ByVal Card As Integer, ByVal ChNo As Integer, ByVal Cfg As Integer) As Integer set_da_value (ByVal Card As Integer, ByVal ChNo As Integer, ByVal Value As Double) As Integer
```

# @ Arguments

CardID: The SSCNet series card index number.

ChNo: specified channel number

cfg: Setting of configuration

▶ Cfg = 0, Direct DA output (default)
▶ Cfg = 1, Velocity profile of Axis 0
▶ Cfg = 2, Velocity profile of Axis 1
▶ :
▶ Cfg = 12, Velocity profile of Axis 11
▶ Cfg = 13, DA closed loop output of Axis 0
▶ Cfg = 14, DA closed loop output of Axis 1
▶ :
▶ Cfg = 24, DA closed loop output of Axis 11

Value: output value, -10.0 \~ 10.0 V
@ Return Code
```txt
ERROR_NoError
ERROR_Dll_Opened_By_Other_Process
ERROR_Card_Not_Exist
ERROR_Card_Not_Ready
ERROR_Card_Not_Initial
ERROR_DSP_Not_Ready
ERROR_Wrong_DA_Channel_Number
```

@ Example
```c
&lt;C/C++&gt;
set_da_config
    I16 RetCode;
    I16 Card = 0;
    I16 ChNo = 1;
    U16 Cfg = 0; // Direct DA output
    RetCode = set_da_config(CardID, ChNo, Cfg);
set_da_value
    I16 RetCode;
    I16 Card = 0;
    I16 ChNo = 1;
    I16 Value = 1.0; // DA output 1.0 Volt
    RetCode = set_da_value(CardID, ChNo, Value);
```
&lt;Visual Basic&gt;

set\_da\_config
```vba
Dim RetCode As Integer
Dim Card As Integer, ChNo As Integer, Cfg As integer
Card = 0
ChNo = 1
Cfg = 1    ' DA output proportional to Axis_0's velocity
RetCode = set_da_config(CardID, ChNo, Cfg)
```

set\_da\_value
```txt
Dim RetCode As Integer
Dim Card As Integer, ChNo As Integer, Value As double
Card = 0
ChNo = 1
Value = 1.0 ' DA output 1.0 Volt
RetCode = set_da_value(CardID, ChNo, Value)
```

# 1.6.4 AD

# @ Name

set\_ad\_function(CardID, Enable, AD\_Gain, AD\_Last, AD2\_SRC) – set configuration of specified AD channel

get\_ad\_value(CardID, ChNo, \*Value) – get input value of specified AD channel

# @ Description

set\_ad\_function:

Set AD input configuration. There are 3 AD channel available on cPCI Series SSCNET motion cards. AD0 and AD1's sources are directly from external pin. AD2's sources are selectable. Users can set the AD2 channel input source from internal +5V, GND and one of external AD pins. Each channel's gain is also adjustable from 4x, 2x, and 1x for voltage range +/-2.5V, +/-5V, +/-10V.

get\_ad\_value:

Get input voltage from specified AD channel. There are 2 16-bit AD channels in cPCI Series SSCNET motion cards.

# @ Syntax

C/C++ (DOS, Windows)

```csv
I16 set_ad_function(I16 CardID, U16 Enable, U16 AD_Gain, U16 AD_Last, U16 AD2_SRC)
I16 get_ad_value(I16 CardID, I16 ChNo, F64 *Value)
```

# Visual Basic (Windows)

```c
set_ad_function (ByVal CardID As Integer, ByVal Enable As Integer, ByVal AD_Gain As Integer, ByVal AD_Last As Integer, ByVal AD2_SRC As Integer) As Integer
get_ad_value (ByVal Card As Integer, ByVal ChNo As Integer, Value As Double) As Integer
```

# @ Argument

CardID: The SSCNet series card index number.

ChNo: specified channel number, 0=AD0, 1=AD1, 2=AD2

AD\_Gain: 0 = 1x, 1 = 2x, 2 = 4x

AD\_Last: 0 = Ch0 1 = Ch1, 2 = Ch2 (Last AD scan channel)

AD2\_SRC: 0 = Ref+5V, 1 = AGND, 2 = DA0, 3 = DA1

Enable: 0=disable, 1=enable

\*Value: input value, -10.0 \~ 10.0 V

# @ Return Code

```txt
ERROR_NoError
ERROR_Dll_Opened_By_Other_Process
ERROR_Card_Not_Exist
ERROR_Card_Not_Ready
ERROR_Card_Not_Initial
ERROR_DSP_Not_Ready
ERROR_Wrong_DA_Channel_Number
```

# 1.6.5 Analog Auto Calibration

# @ Name

tune\_ref\_5v(CardID, Value) – tuning reference 5V

save\_auto\_k\_value(CardID, Channel, Value) - save
tuning value to ROM

get\_auto\_k\_value(CardID, Channel, \*Value) - get tuning value from ROM

tune\_ad\_offset\_gain(CardID, Step, Value) – tune AD offset and gain

tune\_da\_offset(CardID, Step, Value) – tune DA offset

reload\_auto\_k\_setting(CardID) - get tuning data from ROM and set to analog control register

# @ Description

tune\_ref\_5v:

This function is used for tuning on board reference +5V source. This source is very important because the whole auto calibration procedures need this accurate voltage source. Users must use a voltage meter to measure the on board reference 5V from JP1 connector.

save\_auto\_k\_value:

This function is used for saving the auto-k value channel by channel to EEPROM.

get\_auto\_k\_value:

This function is used for getting the auto-k value channel by channel from EEPROM.

tune\_ad\_offset\_gain:

This function is used for tuning ADC's 0v offset and its gain.

tune\_da\_offset:

This function is used for tuning each DA channel's 0 voltage output offset.

reload\_auto\_k\_setting:

Get auto-k setting from EEPROM and set them to analog control register. This function will be called automatically when MDSP\_initial() is called.

# @ Syntax

C/C++ (DOS, Windows)

```txt
I16 tune_ref_5v(I16 CardID, U8 Value);
I16 tune_ad_offset_gain(I16 CardID, I16 Step, U8 Value);
```

Visual Basic (Windows)

```c
tune_ref_5v (ByVal CardID As Integer, ByVal Value As Byte) As Integer
tune_ad_offset_gain (ByVal CardID As Integer, ByVal Step As Integer, ByVal Value Byte) As Integer
```

# @ Argument

CardID: The SSCNet series card index number.

Channel: specified auto-K channel number, 0-8 for cPCI system. 0-2 for PCI system.

▶ Channel0=No use.
▶ Channel1= DA0 Fine Offset
▶ Channel2= DA1 Fine Offset
▶ Channel3= AD Fine Offset
▶ Channel4= AD Fine Gain, not available now
▶ Channel5= DA0 Coarse Offset
▶ Channel6= DA1 Coarse Offset
▶ Channel7= AD Coarse Offset
▶ Channel8= AD Coarse Gain

Step: tunning step number 0\~3

[AD Function]
```txt
- Step=0 Tune AD Coarse Offset, Channel7
- Step=1 Tune AD Fine Offset, Channel3
- Step=2 Tune AD Coarse Gain, Channel8
- Step=3 Tune AD Fine Gain, Channel4, not available now
```

[ DA Function ]
```csv
▶ Step=0 Tune DA0 Coarse Offset, Channel5
▶ Step=1 Tune DA0 Fine Offset, Channel1
▶ Step=2 Tune DA1 Coarse Offset, Channel6
▶ Step=3 Tune DA1 Fine Offset, Channel2
```
value: tunnig value, 0 \~ 255

@ Return Code
```txt
ERROR_NoError
ERROR_Dll_Opened_By_Other_Process
ERROR_Card_Not_Exist
ERROR_Card_Not_Ready
ERROR_Card_Not_Initial
ERROR_DSP_Not_Ready
ERROR_Wrong_DA_Channel_Number
ERROR_DPBUSY_TIMEOUT
```

@ Example
```c
tune_ref_5v(0, 128); // use this function until voltage meter read 5.000V from JP1
tune_ad_offset_gain(0, 1, 128); // reset to middle point
tune_ad_offset_gain(0, 3, 128); // reset to middle point
tune_ad_offset_gain(0, 0, K7); // start tuning AD offset
    get_ad_value(0, 2, &AD2_Value); // check AD2_Value = 0.0
    save_auto_k_value(0, 7, K7); // save to channel 7
```

```txt
tune_ad_offset_gain(0,1,K3); // start tuning AD offset
    get_ad_value(0, 2, &AD2_Value); // check AD2_Value = 0.0
    save_auto_k_value(0, 3, K3); // save to channel 3
tune_ad_offset_gain(0,2,K8); // start tuning AD offset
    get_ad_value(0, 2, &AD2_Value); // check AD2_Value = 5.0
    save_auto_k_value(0, 8, K8); // save to channel 8
tune_da_offset_gain(0,1,128); // reset to middle point
tune_da_offset_gain(0,3,128); // reset to middle point
tune_da_offset_gain(0,0,K5); // start tuning AD offset
    get_ad_value(0, 2, &AD2_Value); // check AD2_Value = 0.0
    save_auto_k_value(0, 5, K5); // save to channel 5
tune_ad_offset_gain(0,1,K1); // start tuning AD offset
    get_ad_value(0, 2, &AD2_Value); // check AD2_Value = 0.0
    save_auto_k_value(0, 1, K1); // save to channel 1
tune_ad_offset_gain(0,2,K6); // start tuning AD offset
    get_ad_value(0, 2, &AD2_Value); // check AD2_Value = 0.0
    save_auto_k_value(0, 6, K6); // save to channel 6
tune_ad_offset_gain(0,3,K2); // start tuning AD offset
    get_ad_value(0, 2, &AD2_Value); // check AD2_Value = 0.0
```

save\_auto\_k\_value(0, 2, K2); // save to channel 2

// Finally Save Result to ROM
save\_auto\_k\_value(0, 0\~8, K0\~K8);

# 1.7 Driver Management Function

# 1.7.1 Driver Parameter

# @ Name

get\_servo\_para(Axis, ParaNo,\*Value) - Read current servo parameter value

set\_servo\_para(Axis, ParaNo, Value) - Set servo parameter

get\_servo\_para\_all(Axis, \*Value) - Read all current servo parameter value

set\_servo\_para\_all(Axis, \*Value) - Set all servo parameters

save\_servo\_para(Axis) - Write current servo parameter value into Flash ROM on PCI-83XX Series.

set\_servo\_para\_default(Axis) – Set all servo parameter to default value.

# @ Description

get\_servo\_para:

This function is used to read current servo parameter value of specified parameter number.

set\_servo\_para:

This function is used to set a new servo parameter value for specified parameter number.

get\_servo\_para\_all:

This function is used to read all current servo parameter value.

set\_servo\_para\_all:

This function is used to set new servo value for all servo parameters.

save\_servo\_para:

This function is used to set write current servo parameter value into Flash ROM on PCI-83XX Series. So that, next time when booting, all the parameter values will be the same as saved.

set\_servo\_para\_default:

This function is used to set all servo parameter values to default.

# @ Syntax

C/C++ (DOS, Windows)
```txt
I16 get_servo_para(I16 Axis, I16 ParaNo, U16 *Value)
I16 set_servo_para(I16 Axis, I16 ParaNo, U16 Value)
I16 get_servo_para_all(I16 Axis, U16 *Value)
I16 set_servo_para_all(I16 Axis, U16 *Value)
I16 save_servo_para(I16 Axis)
I16 set_servo_para_default(I16 Axis)
```
Visual Basic (Windows)

```txt
get_servo_para (ByVal Axis As Integer, ByVal ParaNo As Integer, Value As Integer) As Integer
set_servo_para (ByVal Axis As Integer, ByVal ParaNo As Integer, ByVal Value As Integer) As Integer
get_servo_para_all (ByVal Axis As Integer, Value As Integer) As Integer
set_servo_para_all (ByVal Axis As Integer, Value As Integer) As Integer
save_servo_para (ByVal Axis As Integer) As Integer
set_servo_para_default (ByVal Axis As Integer) As Integer
```

# @ Arguments

Axis: specified Axis index

ParaNo: specified parameter number. Range: 1 \~ 56

Value: servo parameter value.

Note: Please refer to SSCNet servo driver manual for definition of individual servo parameter.

@ Return Code
```txt
ERROR_NoError
ERROR_Dll_Opened_By_Other_Process
ERROR_Wrong_Axis_Number
ERROR_Card_Not_Ready
ERROR_Card_Not_Initial
ERROR_DSP_Not_Ready
ERROR_Axis_Not_In_Control
ERROR_Axis_Servo_Alarm
ERROR_Axis_Is_In_Servo_ON
ERROR_Servo_Parameter_Set_Failed
ERROR_Servo_Parameter_Get_Failed
```

@ Example
```c
&lt;C/C++&gt;
get_servo_para
    I16 RetCode;
    I16 Axis = 0;
    I16 ParaNo = 9;
    U16 Value;
    RetCode = get_servo_para(Axis, ParaNo, &Value);
```

```txt
set_servo_para
I16 RetCode;
I16 Axis = 0;
I16 ParaNo = 9;
U16 Value = 6;
RetCode = set_servo_para(Axis, ParaNo, Value);
```

```c
get_servo_para_all
I16 RetCode;
I16 Axis = 0;
U16 Value[56];
RetCode = get_servo_para_all(Axis, Value);
```

```txt
set_servo_para_all
I16 RetCode;
I16 Axis = 0;
U16 Value[56];
RetCode = get_servo_para(Axis, Value);
Value[8] = 6;
```

```txt
RetCode = set_servo_para(Axis, Value);
```

save\_servo\_para
```txt
I16 RetCode;
I16 Axis = 0;
RetCode = save_servo_para (Axis);
```

set\_servo\_para\_default
```txt
I16 RetCode;
I16 Axis = 0;
RetCode = set_servo_para_default(Axis);
```
&lt;Visual Basic&gt;

get\_servo\_para
```txt
Dim RetCode As Integer
Dim Axis As Integer, ParaNo As Integer, Value As Integer
Axis = 0
ParaNo = 9
RetCode = get_servo_para(Axis, ParaNo, Value)
```
set\_servo\_para

```vba
Dim RetCode As Integer
Dim Axis As Integer, ParaNo As Integer, Value As Integer
Axis = 0
ParaNo = 9
Value = 6
RetCode = set_servo_para(Axis, ParaNo, Value)
```
get\_servo\_para\_all

```txt
Dim RetCode As Integer
Dim Axis As Integer, Value(0 to 55) As Integer
Axis = 0
RetCode = get_servo_para_all(Axis, Value(0))
```
set\_servo\_para\_all

```txt
Dim RetCode As Integer
Dim Axis As Integer, Value(0 to 55) As Integer
Axis = 0
RetCode = get_servo_para(Axis, Value)
Value(8) = 6
RetCode = set_servo_para(Axis, Value(0))
```

save\_servo\_para
```vba
Dim RetCode As Integer
Dim Axis As Integer
Axis = 0
RetCode = save_servo_para (Axis)
```
set\_servo\_para\_default-

```txt
Dim RetCode As Integer
Dim Axis As Integer
Axis = 0
RetCode = set_servo_para_default(Axis)
```

# 1.7.2 Data Monitoring

# @ Name

set\_monitor\_channel(Axis, Channel\_0, Channel\_1, Channel\_2, Channel\_3) -Set axis data monitoring channel

set\_monitor\_config(Axis, Trigger\_Select, Trigger\_Level, SamplePeriod, PreTriggerSampleNo, SampleNumber) - Set axis data monitoring configuration

start\_monitor(Axis) - Start monitor process.

check\_monitor\_ready(Axis, \*Status) – check if monitor process finished.

get\_monitor\_data(Axis, \*Data) - Get axis monitoring data.

get\_instant\_monitor\_data(Axis, \*Data\_0, \*Data\_1, \*Data\_2, \*Data\_3) - Get instant monitor data

# @ Description

set\_monitor\_channel:

This function is used to set axis data monitoring Channels. Each axis has 4 monitor channels. Each cannel can be set independently by parameter 'Channel\_#'. The definition of value of 'Channel\_#' is listed below:

<table><tr><td>Value</td><td>Description</td><td>Unit</td></tr><tr><td>FF</td><td>Not Used</td><td></td></tr><tr><td>00</td><td>Feedback pulse accumulation</td><td>Pulse</td></tr><tr><td>01</td><td>(Reserved)</td><td></td></tr><tr><td>02</td><td>Motor revolution speed</td><td>0.1rpm</td></tr><tr><td>03</td><td>(Reserved)</td><td></td></tr><tr><td>04</td><td>Accumulated pulse</td><td>Pulse</td></tr><tr><td>05</td><td>(Reserved)</td><td></td></tr><tr><td>06</td><td>Regenerative load factor</td><td>%</td></tr><tr><td>07</td><td>Execution load factor</td><td>%</td></tr><tr><td>08</td><td>Peak load factor</td><td>%</td></tr><tr><td>09</td><td>Bus voltage</td><td></td></tr><tr><td>0A</td><td>Load inertia ratio</td><td></td></tr><tr><td>0B</td><td>ABS counter</td><td>Rev</td></tr><tr><td>0C</td><td>Position within one revolution</td><td>Pulse</td></tr><tr><td>0D</td><td>(Reserved)</td><td></td></tr><tr><td>0E</td><td>F/B present value</td><td>Pulse</td></tr><tr><td>0F</td><td>(Reserved)</td><td></td></tr><tr><td>10</td><td>Position droop</td><td>Pulse</td></tr><tr><td>11</td><td>(Reserved)</td><td></td></tr><tr><td>12</td><td>Speed command</td><td>0.1rpm</td></tr><tr><td>13</td><td>(Reserved)</td><td>0.1rpm</td></tr><tr><td>14</td><td>Speed feedback</td><td>0.1rpm</td></tr><tr><td>15</td><td>(Reserved)</td><td>0.1rpm</td></tr><tr><td>16</td><td>Current command</td><td>0.1%</td></tr><tr><td>17</td><td>Current feedback</td><td>0.1%</td></tr></table>

Table 1-7: Channel\_# Definitions

<table><tr><td>Value</td><td>Description</td><td>Unit</td></tr><tr><td>18</td><td>ZCT (Bottom)</td><td>Pulse</td></tr><tr><td>19</td><td>(Reserved)</td><td></td></tr><tr><td>1A</td><td>Present revolution counts</td><td>Rev</td></tr><tr><td>1B</td><td>Origin revolution counts</td><td>Rev</td></tr><tr><td>1C</td><td>Origin position within one revolution</td><td>Pulse</td></tr><tr><td>1D</td><td>(Reserved)</td><td></td></tr><tr><td>1E</td><td>(Reserved)</td><td></td></tr><tr><td>1F</td><td>(Reserved)</td><td></td></tr><tr><td>20</td><td>Alarm status AL-1</td><td></td></tr><tr><td>21</td><td>Alarm status AL-2</td><td></td></tr><tr><td>22</td><td>Alarm status AL-3</td><td></td></tr><tr><td>23</td><td>Alarm status AL-4</td><td></td></tr><tr><td>24</td><td>Alarm status AL-5</td><td></td></tr><tr><td>25</td><td>Alarm status AL-6</td><td></td></tr><tr><td>26</td><td>Alarm status AL-7</td><td></td></tr><tr><td>27</td><td>Alarm status AL-8</td><td></td></tr><tr><td>28</td><td>Alarm status AL-9</td><td></td></tr><tr><td>29</td><td>Alarm status AL-E</td><td></td></tr><tr><td>2A</td><td>(Reserved)</td><td></td></tr><tr><td>2B</td><td>(Reserved)</td><td></td></tr><tr><td>2C</td><td>(Reserved)</td><td></td></tr><tr><td>2D</td><td>(Reserved)</td><td></td></tr><tr><td>2E</td><td>(Reserved)</td><td></td></tr><tr><td>2F</td><td>(Reserved)</td><td></td></tr><tr><td>30</td><td>Alarm history #1,#2</td><td></td></tr><tr><td>31</td><td>Alarm history #3,#4</td><td></td></tr><tr><td>32</td><td>Alarm history #5,#6</td><td></td></tr><tr><td>33</td><td>Alarm history #7,#8</td><td></td></tr><tr><td>34</td><td>Alarm history #9,#10</td><td></td></tr><tr><td>35</td><td>(Reserved)</td><td></td></tr><tr><td>36</td><td>(Reserved)</td><td></td></tr><tr><td>37</td><td>(Reserved)</td><td></td></tr></table>

Table 1-7: Channel\_# Definitions

<table><tr><td>Value</td><td>Description</td><td>Unit</td></tr><tr><td>38</td><td>Parameter error NO.Pr01 to Pr16</td><td></td></tr><tr><td>39</td><td>Parameter error NO.Pr17 to Pr32</td><td></td></tr><tr><td>3A</td><td>Parameter error NO.Pr33 to Pr40</td><td></td></tr><tr><td>3B</td><td>(Reserved)</td><td></td></tr><tr><td>3C</td><td>(Reserved)</td><td></td></tr><tr><td>3D</td><td>(Reserved)</td><td></td></tr><tr><td>3E</td><td>(Reserved)</td><td></td></tr><tr><td>3F</td><td>(Reserved)</td><td></td></tr><tr><td>A5</td><td>INP (in position)</td><td>Active: 1, Inactive: 0</td></tr><tr><td>B0</td><td>Velocity Command</td><td>Pulse/sec</td></tr><tr><td>B2</td><td>DA1 Value</td><td></td></tr><tr><td>B3</td><td>DA2 Value</td><td></td></tr><tr><td>B4</td><td>Speed Feedback</td><td></td></tr><tr><td>B6</td><td>External Encoder Feedback</td><td></td></tr><tr><td>B8</td><td>Command Pulse</td><td></td></tr></table>

Table 1-7: Channel\_# Definitions

set\_monitor\_config:

This function is used to set configuration for axis data monitoring.

<table><tr><td>Parameter Name</td><td>Type</td><td>Description</td></tr><tr><td>Trigger_Select</td><td>I16</td><td>This variable is used to define the trigger source.Trigger_Select:► Value = 0: No trigger► Value = 1: CH0 as trigger source, going high► Value = 2: CH1 as trigger source, going high► Value = 3: CH2 as trigger source, going high► Value = 4: CH3 as trigger source, going high► Value = -1: CH0 as trigger source, going low► Value = -2: CH1 as trigger source, going low► Value = -3: CH2 as trigger source, going low► Value = -4: CH3 as trigger source, going low</td></tr><tr><td>TriggerLevel</td><td>I32</td><td>Define the trigger level</td></tr></table>

Table 1-8: set\_monitor\_config Settings

<table><tr><td>Parameter Name</td><td>Type</td><td>Description</td></tr><tr><td>SamplePeriod</td><td>U32</td><td>This variable is used to define the sample period.► Value = 1: 0.888 ms► Value = 2: 2 * 0.888 ms► Value = 3: 3 * 0.888 ms► Value = 4: 4 * 0.888 ms</td></tr><tr><td>PreTriggerSampleNo</td><td>I16</td><td>Define the Number of samples before Trigger Value = 1 ~ 1023</td></tr><tr><td>SampleNumber</td><td>I16</td><td>Define the Total Number of samples Value = 1 ~ 1023</td></tr></table>

Table 1-8: set\_monitor\_config Settings

start\_monitor:

After setting monitor channel and monitor configuration, user can call this function to inform 83XX to start monitor process.

check\_monitor\_ready:

This function is used to check if axis monitoring process in 83XX finished.

get\_monitor\_data:

After monitoring process finished, this function can be applied to retrieve axis monitoring data from 83XX. The parameter ‘\*Data’ is a ‘I32’ array with size = (4\*SampleNumber).

get\_instant\_monitor\_data:

This function is used to get axis monitor data at this instant. This function is always available regardless monitor configuration is set or not.

@ Syntax

C/C++ (DOS, Windows)

I16 set\_monitor\_channel(I16 Axis, U8 Channel\_0, U8 Channel\_1, U8 Channel\_2, U8 Channel\_3)

I16 set\_monitor\_config(I16 Axis, I16 Trigger\_Select, I32 Trigger\_Level, U32 SamplePeriod, I16 PreTriggerSampleNo, I16 SampleNumber)

I16 start\_monitor(I16 Axis)

```c
I16 check_monitor_ready(I16 Axis, U8 *Status)
I16 get_monitor_data(I16 Axis, I32 *Data)
I16 get_instant_monitor_data(I16 Axis, I32 *Data_0, I32 *Data_1, I32 *Data_2, I32 *Data_3)
```
Visual Basic (Windows)

```txt
set_monitor_channel (ByVal Axis As Integer, ByVal Channel_0 As Byte, ByVal Channel_1 As Byte, ByVal Channel_2 As Byte, ByVal Channel_3 As Byte) As Integer
set_monitor_config (ByVal Axis As Integer, ByVal Trigger_Select As Integer, ByVal Trigger_Level As Long, ByVal SamplePeriod As Long, ByVal PreTriggerSampleNo As Integer, ByVal SampleNumber As Integer) As Integer
start_monitor (ByVal Axis As Integer) As Integer
check_monitor_ready (ByVal Axis As Integer, Status As Byte) As Integer
get_monitor_data (ByVal Axis As Integer, Data As Long) As Integer
get_instant_monitor_data (ByVal Axis As Integer, Data_0 As Long, Data_1 As Long, Data_2 As Long, Data_3 As Long) As Integer
```

# @ Arguments

Axis: specified Axis index

Channel\_#: to specify selection of monitor channel #.

Trigger\_Select: Define the trigger source& direction.

Trigger\_Level: Define the trigger level

SamplePeriod: Define the sample period

PreTriggerSampleNo: Define the number of samples before trigger

SampleNumber: Define number of samples

Status: status of monitoring process.

▶ Value = 1 (true), monitoring process is finished.
▶ Value = 0 (false), monitoring process is not finished yet.

\*Data: servo monitor data.

\*Data\_#: The servo monitor data in the instant when get\_instant\_monitor\_data() was applied.

# @ Return Code

```txt
ERROR_NoError
ERROR_Dll_Opened_By_Other_Process
ERROR_Wrong_Axis_Number
ERROR_Card_Not_Ready
ERROR_Card_Not_Initial
ERROR_DSP_Not_Ready
ERROR_Axis_Not_In_Control
ERROR_Monitor_Configuration_Not_Set
ERROR_Monitor_Process_Not_start
ERROR_Monitor_Process_Not_Finish
ERROR_Axis_Hand_Shake_Failed
```

# @ Example

```txt
&lt;C/C++&gt;
```

set\_monitor\_channel
```txt
I16 RetCode;
I16 Axis= 0;
U8 Channel_0 = 0xA5;
U8 Channel_1 = 0xB1;
U8 Channel_2 = 0x14;
U8 Channel_3 = 0x10;
RetCode = set_monitor_channel(Axis, Channel_0, Channel_1, Channel_2, Channel_3);
```
set\_monitor\_config

```txt
I16 RetCode;
I16 Axis = 0;
I16 Trigger_Select = 1; // channel 0, going up
I32 Trigger_Level = 1; // trigger level 1
U32 SamplePeriod = 1; // sample period = 1 * 0.888 ms
I16 PreTriggerSampleNo = 100; // pre trigger sample number = 100
I16 SampleNumber = 1023; // total sample number = 1023
RetCode = set_monitor_config(Axis, Trigger_Select, Trigger_Level,
```

```javascript
SamplePeriod, PreTriggerSampleNo, SampleNumber);
```

start\_monitor
```javascript
I16 RetCode;
I16 Axis = 0;
RetCode = start_monitor(Axis);
```
check\_monitor\_ready

```txt
I16 RetCode;
I16 Axis = 0;
U8 Status;
RetCode = check_monitor_ready(Axis, &Status);
```
get\_monitor\_data

```txt
I16 RetCode;
I16 Axis = 0;
I32 Data[1023];
RetCode = get_monitor_data(I16 Axis, Data);
```
get\_instant\_monitor\_data

```txt
I16 RetCode;
I16 Axis= 0;
I32 Data_0, Data_1, Data_2, Data_3;
RetCode = get_instant_monitor_data(I16 Axis, &Data_0, &Data_1, &Data_2, &Data_3);
```
&lt;Visual Basic&gt;

set\_monitor\_channel
```txt
Dim RetCode As Integer
Dim Axis As Integer
Dim Channel_0 As Byte, Channel_1 As Byte
Dim Channel_2 As Byte, Channel_3 As Byte
Axis= 0;
Channel_0 = &hA5
Channel_1 = &hB1
Channel_2 = &h14
Channel_3 = &h10
RetCode = set_monitor_channel(Axis, Channel_0, Channel_1, Channel_2, Channel_3)
```

set\_monitor\_config
```txt
Dim RetCode As Integer
```

```vba
Dim Axis As Integer
Dim Trigger_Select As Integer, Trigger_Level As Long
Dim SamplePeriod As Long, PreTriggerSampleNo As Integer
Dim SampleNumber As Integer
Axis= 0;
I16 Trigger_Select = 1 'channel 0, going up
I32 Trigger_Level = 1 ' trigger level 1
U32 SamplePeriod = 1 ' sample period = 1 * 0.888 ms
I16 PreTriggerSampleNo = 100 ' pre trigger sample number = 100
I16 SampleNumber = 1023 ' total sample number = 1023
RetCode = set_monitor_config(Axis, Trigger_Select, Trigger_Level, SamplePeriod, PreTriggerSampleNo, SampleNumber)
```

start\_monitor
```txt
Dim RetCode As Integer
Dim Axis As Integer
Axis= 0;
RetCode = start_monitor(Axis)
```
check\_monitor\_ready

```txt
Dim RetCode As Integer
Dim Axis As Integer
Dim Status As Byte
Axis = 0
RetCode = check_monitor_ready(Axis, Status);
```

get\_monitor\_data
```txt
Dim RetCode As Integer
Dim Axis As Integer
Dim Data(0 to 1022) As Long
Axis = 0;
RetCode = get_monitor_data(I16 Axis, Data(0));
```

get\_instant\_monitor\_data
```txt
Dim RetCode As Integer
Dim Axis As Integer
```

```txt
Dim Data_0 As Long, Data_1 As Long, Data_2 As Long
Dim Data_3 As Long
Axis= 0
RetCode = get_instant_monitor_data(I16 Axis, Data_0, Data_1, Data_2, Data_3);
```

# 1.7.3 Servo information

# @ Name

get\_servo\_info(Axis,\*ServoInfo) – retrieve servo information

# @ Description

get\_servo\_info:

This function is used to get current servo information. The meaning of individual bit of retrieved \*Servolinfo is described at argument description.

# @ Syntax

C/C++ (DOS, Windows)

I16 get\_servo\_info(I16 Axis, U32 \* ServoInfo)

# Visual Basic (Windows)

get\_servo\_info (ByVal Axis As Integer, ServoSts As Long) As Integer

# @ Arguments

Axis: specified axis index

\*ServoInfo: variable to carry out servo status information

▶ Bit 0: in course of Ready-ON
▶ Bit 1: in course of Servo-ON
▶ Bit 2: in course of in-Position
▶ Bit 3: in course of zero speed
▶ Bit 4: Pass through Z phase
▶ Bit 5: in course of Torque limit
▶ Bit 6: in course of Alarm
▶ Bit 7: in course of warning
▶ Bit 8: Absolute position reference point data set

▶ Bit 9: Absolute position reference point data set wrong
▶ Bit 10 \~ 14: Reserved
▶ Bit 15: in course of Speed limit
▶ Bit 16 \~ 31 : Reserved

@ Return Code
```txt
ERROR_NoError
ERROR_Dll_Opened_By_Other_Process
ERROR_Wrong_Axis_Number
ERROR_Card_Not_Ready
ERROR_Card_Not_Initial
ERROR_DSP_Not_Ready
ERROR_Axis_Not_In_Control
```

@ Example
```c
&lt;C/C++&gt;
get_servo_info
    I16 RetCode;
    I16 Axis = 0;
    U32 ServoInfo;
    RetCode = get_servo_info(Axis, &ServoInfo);
```
&lt;Visual Basic&gt;

```txt
get_servo_info-
Dim RetCode As Integer
Dim Axis As Integer, ServoInfo As Long
Axis = 0
RetCode = get_servo_info(Axis, ServoInfo)
```

# 1.7.4 Servo ON

# @ Name

set\_servo\_on(Axis, ON\_OFF) - set servo on

# @ Description

set\_servo\_on:

This function is used to command servo driver of specified axis to starts controlling its servomotor. Then motion function could be applied on this axis.

# @ Syntax

C/C++ (DOS, Windows)

I16 set\_servo\_on(I16 Axis, I16 ON\_OFF)

Visual Basic (Windows)

set\_servo\_on (ByVal Axis As Integer, ByVal ON\_OFF As Integer) As Integer

# @ Arguments

Axis: specified axis index

ON\_OFF: variable to control servo on or off

▶ ON\_OFF = 0, servo off
▶ ON\_OFF = 1, servo on

# @ Return Code

```txt
ERROR_NoError
ERROR_Dll_Opened_By_Other_Process
ERROR_Wrong_Axis_Number
ERROR_Card_Not_Ready
ERROR_Card_Not_Initial
ERROR_DSP_Not_Ready
ERROR_Axis_Not_In_Control
ERROR_Axis_Servo_Alarm
```

# @ Example

```txt
&lt;C/C++&gt;
```

set\_servo\_info
```c
I16 RetCode;
I16 Axis = 0;
I16 ON_OFF = 1;
RetCode = set_servo_on(Axis, ON_OFF);
```
&lt;Visual Basic&gt;

set\_servo\_info
```txt
Dim RetCode As Integer
Dim Axis As Integer, ON_OFF As Long
Axis = 0
ON_OFF = 1
RetCode = set_servo_on(Axis, ON_OFF)
```

# 1.7.5 Driver information

# @ Name

understand\_driver() - retrieve servo driver classification code

understand\_motor() - retrieve servo motor information

# @ Description

understand\_driver:

This function is used to get servo driver's classification code

understand\_motor:

This function is used to get servo motor's information, including motor type, motor capacity, rated revolution speed... etc. please refer to description of function call parameters.

# @ Syntax

C/C++ (DOS, Windows)
```txt
I16 understand_driver(I16 Axis, U16 *Class_Code, U16 *SoftwareNo)
I16 understand_motor(I16 Axis, U16* MotorType, U16* Capacity, U16* RateRPM, U16* RateCurrent, U16* MaxRPM, U16* MaxTorq, U32* PPR, U16* ENCInfo, U16* OptionalInfor)
```
Visual Basic (Windows)

```txt
understand_driver (ByVal Axis As Integer, Class_Code As Integer, SoftwareNo As Integer) As Integer
understand_motor (ByVal Axis As Integer, MotorType As Integer, Capacity As Integer, RateRPM As Integer, RateCurrent As Integer, MaxRPM As Integer, MaxTorq As Integer, PPR As Long, ENCInfo As Integer, OptionalInfor As Integer) As Integer
```

# @ Arguments

Axis: specified axis index

\*Class\_Code: variable to carry out servo driver's classification code
\*SoftwareNo: Array to carry out servo driver's Software number
\*MotorType: variable to carry out servo motor's type information
\*Capacity: variable to carry out servo motor's capacity information
\*RateRPM: variable to carry out servo motor's Rated Revolution Speed information
\*RateCurrent: variable to carry out servo motor's Rated Crrrent information
\*MaxRPM: variable to carry out servo motor's Maximum Revolution number
\*MaxTorq: variable to carry out servo motor's Maximum Torque information
\*PPR: variable to carry out servo motor's Encoder Pulse Per revolution
\*ENCInfo: variable to carry out motor's Encoder type information, 0 for incremental, 1 for absolute
\*OptionalInfor: variable to carry out motor's Optional information

# @ Return Code

```txt
ERROR_NoError
ERROR_Dll_Opened_By_Other_Process
ERROR_Wrong_Axis_Number
ERROR_Card_Not_Ready
ERROR_Card_Not_Initial
ERROR_DSP_Not_Ready
ERROR_Axis_Not_In_Control
```

# @ Example

```txt
&lt;C/C++&gt;
```

```txt
understand_driver
```

```javascript
I16 RetCode;
I16 Axis = 0;
```

```txt
U16 Class_Code;
U16 SoftwareNo[6];
RetCode = understand_driver(Axis, &Class_Code, SoftwareNo)
```

understand\_motor
```txt
I16 RetCode;
I16 Axis= 0;
U16 MotorType, Capacity, RateRPM, RateCurrent,
    MaxRPM, MaxTorq
U32 PPR;
U16 ENCInfo, OptionalInfor;
RetCode = understand_motor (Axis, &MotorType,
    &Capacity, &RateRPM, &RateCurrent, &MaxRPM,
    &MaxTorq, &PPR, &ENCInfo, &OptionalInfor)
```
&lt;Visual Basic&gt;

understand\_driver
```txt
Dim RetCode As Integer
Dim Axis As Integer, Class_Code As Integer
Dim SoftwareNo(0 to 5) As Integer
Axis = 0
RetCode = understand_driver(Axis, Class_Code, SoftwareNo(0))
```
understand\_motor

```txt
Dim RetCode As Integer
Dim Axis As Integer
Dim MotorType As Integer, Capacity As Integer, RateRPM As Integer,
Dim RateCurrent As Integer, MaxRPM As Integer, MaxTorq As Integer
Dim PPR As Long
Dim ENCInfo As Integer, OptionalInfor As Integer
Axis = 0
RetCode = understand_motor (Axis, MotorType, Capacity, RateRPM, RateCurrent, MaxRPM, MaxTorq, PPR, ENCInfo, OptionalInfor)
```

# 1.7.6 Alarm reset

# @ Name

get\_alarm\_no(Axis, \*AlarmNo) - get alarm number.

alarm\_reset(Axis) - servo alarm reset

# @ Description

get\_alarm\_no:

When servo alarm occurs, this function can help to get alarm number.

alarm\_reset:

When servo alarm occurs, servo motor will stop moving. After the alarm condition passed, this function can help to clear alarm and reset servo.

# @ Syntax

C/C++ (DOS, Windows)

I16 get\_alarm\_no(I16 Axis, U8\* AlarmNo)

I16 alarm\_reset(I16 Axis)

# Visual Basic (Windows)

alarm\_reset (ByVal Axis As Integer) As Integer get\_alarm\_no (ByVal Axis As Integer, AlarmNo As Byte) As Integer

# @ Arguments

Axis: specified axis index

\*AlarmNo: variable to carry out alarm number

# @ Return Code

```txt
ERROR_NoError
ERROR_Dll_Opened_By_Other_Process
ERROR_Wrong_Axis_Number
ERROR_Card_Not_Ready
ERROR_Card_Not_Initial
ERROR_DSP_Not_Ready
ERROR_Axis_Not_In_Control
```

@ Example
```txt
&lt;C/C++&gt;
get_alarm_no
    I16 RetCode;
    I16 Axis = 0;
    U8 AlarmNo;
    RetCode = get_alarm_no(Axis, &AlarmNo);
```

```c
alarm_reset-
I16 RetCode;
I16 Axis = 0;
RetCode = alarm_reset(I16 Axis);
```
&lt;Visual Basic&gt;

```python
get_alarm_no
Dim RetCode As Integer
Dim Axis As Integer, AlarmNo As Byte
Axis = 0
RetCode = get_alarm_no(Axis, AlarmNo)
```

```txt
alarm_reset
Dim RetCode As Integer
Dim Axis As Integer
Axis = 0
RetCode = alarm_reset(Axis)
```

# 1.8 Control Gain Tuning

# @ Name

set\_auto\_tune(Axis, Mode, RSP, GD2) – Set auto tuning mode and parameters

get\_auto\_tune(Axis, \*Mode, \*RSP, \*GD2) – Read auto tuning mode and parameters

set\_control\_gain(Axis, PG1, VG1, VIC, PG2, VG2, FFC) - Set control gain value

get\_control\_gain(Axis, \*PG1, \*VG1, \*VIC,\*PG2, \*VG2, \*FFC) - Set control gain value

set\_notch\_filter(Axis, Mode, NotchFrequency, NotchDepth) - Set machine resonance suppression filter

get\_notch\_filter(Axis, \*Mode, \*NotchFrequency, \*NotchDepth) -Get current machine resonance suppression filter value

set\_LP\_filter(Axis, ON\_OFF) - Enable/Disable low pass filter

get\_LP\_filter(Axis,\*ON\_OFF) - get current low pass filter mode

# @ Description

set\_auto\_tune:

This function is used to select auto-tuning mode and set RS, GD2 parameter. There are 5 auto-tuning modes available, and it is specified by the 2nd parameter. When mode 1 or 3 was selected, the servo driver automatically determines all control gains. If mode 2,4, or 0 was selected, control gains is of user's choice by using set\_control\_gain(). Please refer to the MR-J2S-B servo driver instruction manual for more information.

<table><tr><td>Mode Value</td><td>Description</td><td>RSP</td><td>GD2</td><td>PG1</td><td>VG1</td><td>VIC</td><td>PG2</td><td>VG2</td><td>FFC</td></tr><tr><td>1</td><td>Auto-Tuning mode 1</td><td>M</td><td>A</td><td>A</td><td>A</td><td>A</td><td>A</td><td>A</td><td>A</td></tr><tr><td>2</td><td>Manual mode 2</td><td>--</td><td>M</td><td>M</td><td>M</td><td>M</td><td>M</td><td>M</td><td>M</td></tr><tr><td>3</td><td>Auto-Tuning mode 2</td><td>M</td><td>M</td><td>A</td><td>A</td><td>A</td><td>A</td><td>A</td><td>A</td></tr><tr><td>4</td><td>Manual mode 1</td><td>--</td><td>M</td><td>M</td><td>A</td><td>M</td><td>A</td><td>M</td><td>A</td></tr><tr><td>0*</td><td>Interpolation mode</td><td>--</td><td>A</td><td>M</td><td>M</td><td>A</td><td>A</td><td>A</td><td>A</td></tr></table>

Table 1-9: Mode Values

▶ A: Set automatically
▶ M: Allow set by function calls

Note: Mode 0 is normally not used.

get\_auto\_tune:

This function is used to read current auto-tuning mode selection, and RSP, GD2 parameter setting. Please refer to the MR-J2S-B servo driver instruction manual for more information.

set\_control\_gain:

This function is to set control gains. This function is valid only when 'Mode' is set\_auto\_tune() is set to 2,4, or 0. Please refer to section 4.9 for control gains introduction. Please refer to the MR-J2S-B servo driver instruction manual for more information.

get\_control\_gain:

This function is used to read current control gains setting. Please refer to the MR-J2S-B servo driver instruction manual for more information.

set\_notch\_filter:

This function is to set match resonance suppression filter (Notch Filter). There are 6 modes available, and it is specified by the 2nd parameter; there are 32 notch frequency selection, and it is specified by the 3rd parameter; there are 4 notch depth selection, and it is specified by the 4th parameter. Please refer to the MR-J2S-B servo driver instruction manual for more information.

get\_notch\_filter:

This function is used to read current notch filter configuration. Please refer to the MR-J2S-B servo driver instruction manual for more information.

set\_LP\_filter:

This function is to enable/disable the low pass filter function for torque command. Please refer to the MR-J2S-B servo driver instruction manual for more information.

get\_LP\_filter:

This function is to read current setting for low pass filter function. Please refer to the MR-J2S-B servo driver instruction manual for more information.

# @ Syntax

# C/C++ (DOS, Windows)

```csv
I16 set_auto_tune(I16 Axis, U16 Mode, U16 RSP, U16 GD2)
I16 get_auto_tune(I16 Axis, U16 *Mode, U16 *RSP, U16 *GD2)
I16 set_control_gain(I16 Axis, U16 PG1, U16 VG1, U16 VIC, U16 PG2, U16 VG2, U16 FFC)
I16 get_control_gain(I16 Axis, U16 *PG1, U16 *VG1, U16 *VIC, U16 *PG2,U16 *VG2, U16 *FFC)
I16 set_notch_filter(I16 Axis, U16 Mode, U16 NotchFrequency, U16 NotchDepth)
I16 get_notch_filter(I16 Axis, U16 *Mode, U16 *NotchFrequency, U16 *NotchDepth)
I16 set_LP_filter(I16 Axis,I16 ON_OFF)
I16 get_LP_filter(I16 Axis,I16 *ON_OFF)
```

# Visual Basic (Windows)

```csv
set_auto_tune (ByVal Axis As Integer, ByVal Mode As Integer, ByVal RSP As Integer, ByVal GD2 As Integer) As Integer
get_auto_tune (ByVal Axis As Integer, Mode As Integer, RSP As Integer, GD2 As Integer) As Integer
set_control_gain (ByVal Axis As Integer, ByVal PG1 As Integer, ByVal VG1 As Integer, ByVal VIC As Integer, ByVal PG2 As Integer, ByVal
```

```txt
VG2 As Integer, ByVal FFC As Integer) As Integer
get_control_gain (ByVal Axis As Integer, PG1 As Integer, VG1 As Integer, VIC As Integer, PG2 As Integer, VG2 As Integer, FFC As Integer) As Integer
set_notch_filter (ByVal Axis As Integer, ByVal Mode As Integer, ByVal NotchFrequency As Integer, ByVal NotchDepth As Integer) As Integer
get_notch_filter (ByVal Axis As Integer, Mode As Integer, NotchFrequency As Integer, NotchDepth As Integer) As Integer
set_LP_filter (ByVal Axis As Integer, ByVal ON_OFF As Integer) As Integer
get_LP_filter (ByVal Axis As Integer, ON_OFF As Integer) As Integer
```

# @ Arguments

Axis: specified axis index

Mode: specified Auto-Tuning mode

RSP: specified auto tuning response level setting

<table><tr><td>RSP value (in Hex)</td><td>1</td><td>2</td><td>3</td><td>4</td><td>5 *</td><td>6</td><td>7</td><td>8</td><td>9</td><td>A</td><td>B</td><td>C</td><td>D</td><td>E</td><td>F</td></tr><tr><td>Machine response frequency guideline</td><td>15Hz</td><td>20Hz</td><td>25Hz</td><td>30Hz</td><td>35Hz*</td><td>45Hz</td><td>55Hz</td><td>70Hz</td><td>85Hz</td><td>105Hz</td><td>130Hz</td><td>160Hz</td><td>200Hz</td><td>240Hz</td><td>300Hz</td></tr></table>

Table 1-10: RSP Tuning Settings

Note: \*Default setting value

GD2: specified ratio of load inertia moment to servo motor inertia moment.

▶ Value range: 0 \~ 3000 (unit 0.1 times)
▶ Default setting: 70

PG1: position loop gain 1.

▶ Value range: 4 \~ 2000 (rad/s)
▶ Default setting: 35

VG1: velocity loop gain 1.

▶ Value range: 20 \~ 8000 (rad/s)
▶ Default setting: 177

VIC: velocity integral compensation.

▶ Value range: 1 \~ 1000 (ms)
▶ Default setting: 48

PG2: position loop gain 2.

▶ Value range: 1 \~ 500 (rad/s)
▶ Default setting: 35

VG2: velocity loop gain 2.

▶ Value range: 20 \~ 20000 (rad/s)
▶ Default setting: 817

FFC: Velocity feed foreword gain.

▶ Value range: 0 \~ 100 (%)
▶ Default setting: 0

Mode: specified notch filter modes

NotchFrequency: specified notch frequency

NotchDepth: specified notch depth

<table><tr><td>Setting</td><td>Depth(Gain)</td></tr><tr><td>0</td><td>-40db</td></tr><tr><td>1</td><td>-14db</td></tr><tr><td>2</td><td>-8db</td></tr><tr><td>3</td><td>-4db</td></tr></table>

Table 1-11: Notch Depth

ON\_OFF: Enable/Disable selection

▶ ON\_OFF = 1, Enabled
▶ ON\_OFF = 0, Disabled

@ Return Code

ERROR\_NoError

```txt
ERROR_Dll_Opened_By_Other_Process
ERROR_Wrong_Axis_Number
ERROR_Card_Not_Ready
ERROR_Card_Not_Initial
ERROR_DSP_Not_Ready
ERROR_Axis_Not_In_Control
ERROR_Axis_Servo_Alarm
ERROR_Axis_Is_In_Servo_ON
ERROR_Servo_Parameter_Set_Failed
ERROR_Servo_Parameter_Get_Failed
ERROR_Invaild_Auto_Tune_Mode
```

# @ Example

&lt;C/C++&gt;
set\_auto\_tune
```txt
I16 RetCode;
I16 Axis = 0;
U16 Mode = 1;
U16 RSP = 6; // 45 Hz
U16 GD2 = 70; // 7 times
RetCode = set_auto_tune(Axis, Mode, RSP, GD2);
```

get\_auto\_tune
```c
I16 RetCode;
I16 Axis = 0;
U16 Mode, RSP, GD2;
RetCode = get_auto_tune(Axis, &Mode, &RSP, &GD2);
```

set\_control\_gain
```txt
I16 RetCode;
I16 Axis = 0;
U16 PG1 = 45;
U16 VG1 = 200;
U16 VIC = 48;
U16 PG2 = 35;
U16 VG2 = 817;
U16 FFC = 0;
RetCode = set_control_gain(Axis, PG1, VG1, VIC, PG2, VG2, FFC);
```
get\_control\_gain

```txt
I16 RetCode;
I16 Axis = 0;
U16 PG1, VG1, VIC, PG2, VG2, FFC;
RetCode = get_control_gain(Axis, &PG1, &VG1, &VIC, &PG2, &VG2, &FFC);
```

set\_notch\_filter
```javascript
I16 RetCode;
I16 Axis = 0;
U16 Mode = 1;
U16 NotchFrequency = 5;
U16 NotchDepth = 1;
RetCode = set_notch_filter(Axis, Mode, NotchFrequency, NotchDepth);
```

get\_notch\_filter
```txt
I16 RetCode;
I16 Axis = 0;
U16 Mode, NotchFrequency, NotchDepth;
RetCode = get_notch_filter(Axis, &Mode, &NotchFrequency, &NotchDepth);
```
set\_LP\_filter

```c
I16 RetCode;
I16 Axis = 0;
I16 ON_OFF = 0;
RetCode = set_LP_filter(Axis, ON_OFF);
```
get\_LP\_filter-

```c
I16 RetCode;
I16 Axis = 0;
I16 ON_OFF;
RetCode = get_LP_filter(Axis, &ON_OFF);
```
&lt;Visual Basic&gt;

```c
set_auto_tune-
Dim RetCode As Integer
Dim Axis As Integer
Dim Mode As Integer, RSP As Integer, GD2 As Integer
Axis = 0;
Mode = 1;
RSP = 6; // 45 Hz
```

```csv
GD2 = 70; // 7 times
RetCode = set_auto_tune (Axis, Mode, RSP, GD2)
get_auto_tune -
Dim RetCode As Integer
Dim Axis As Integer, Mode As Integer, RSP As Integer, GD2 As Integer
Axis = 0
RetCode = get_auto_tune (Axis, Mode, RSP, GD2)
```
set\_control\_gain

```txt
Dim RetCode As Integer
Dim Axis As Integer, PG1 As Integer, VG1 As Integer, VIC As Integer,
Dim PG2 As Integer, VG2 As Integer, FFC As Integer
Axis = 0
PG1 = 45
VG1 = 200
VIC = 48
PG2 = 35
VG2 = 817
FFC = 0
RetCode = set_control_gain(Axis, PG1, VG1, VIC, PG2, VG2, FFC)
```

get\_control\_gain
```txt
Dim RetCode As Integer
Dim Axis As Integer, PG1 As Integer, VG1 As Integer, VIC As Integer,
Dim PG2 As Integer, VG2 As Integer, FFC As Integer
Axis = 0
RetCode = get_control_gain(Axis, PG1, VG1, VIC, PG2, VG2, FFC)
```
set\_notch\_filter

```txt
Dim RetCode As Integer
Dim Axis As Integer, Mode As Integer,
    NotchFrequency As Integer,
Dim NotchDepth As Integer
Axis = 0
Mode = 1
NotchFrequency = 5
```

```erlang
NotchDepth = 1
RetCode = set_notch_filter(Axis, Mode,
    NotchFrequency, NotchDepth)
```
get\_notch\_filter

```python
Dim RetCode As Integer
Dim Axis As Integer, Mode As Integer,
    NotchFrequency As Integer,
Dim NotchDepth As Integer
RetCode = get_notch_filter(Axis, Mode,
    NotchFrequency, NotchDepth)
```
set\_LP\_filter

```txt
Dim RetCode As Integer
Dim Axis As Integer, ON_OFF As Integer
Axis = 0
ON_OFF = 0
RetCode = set_LP_filter(Axis, ON_OFF);
```
get\_LP\_filter

```vba
Dim RetCode As Integer
Dim Axis As Integer, ON_OFF As Integer
Axis = 0
RetCode = get_LP_filter(Axis, ON_OFF)
```

# 1.9 Interrupt Control Function

# @ Name

int\_control(CardID, Flag) – Enable/Disable INT service

set\_int\_factor(CardID, Source, IntFactor) - Set INT factor

get\_int\_status(CardID, Source, \*IntStatus) - Get INT Status

set\_int\_event(CardID,\*HEvent) - Enable event

link\_interrupt(CardID, \*callbackAddr) - setup call back unction

set\_int\_event2(CardID,\*TotalEvent) - Enable all Interrupt factor events

clear\_tlc\_int(Axis) - clear TLC interrupt status

set\_timer\_int\_interval(CardID, Sec) – set timer interrupt interval in seconds

# @ Description

int\_control:

This function is used to enable interrupt generating to host PC.

set\_int\_factor:

This function allows users to select factors to initiate the interrupt. The first parameter defines the applied cardID, the second define the source, and the third defines the interrupt factor.

▶ Source = 0 - 11 for Axis 0 - Axis 11 respectively.

<table><tr><td>Bit of ‘IntFactor’</td><td>Name</td><td>Description</td></tr><tr><td>0</td><td>PEL</td><td>Positive Limit Switch</td></tr><tr><td>1</td><td>MEL</td><td>Negative Limit Switch</td></tr><tr><td>2</td><td>ORG</td><td>Home Switch</td></tr><tr><td>3</td><td>RDY</td><td>Servo Ready</td></tr><tr><td>4</td><td>INP</td><td>In Position</td></tr><tr><td>5</td><td>EZ</td><td>Index signal passed</td></tr><tr><td>6</td><td>ZSPD</td><td>Zero Speed</td></tr><tr><td>7</td><td>TLC</td><td>Torque Limit reached</td></tr><tr><td>8</td><td>ALM</td><td>Alarm signal on</td></tr><tr><td>9</td><td>WRN</td><td>Servo Warning on</td></tr><tr><td>10</td><td>HOME</td><td>Home Move completed</td></tr><tr><td>11</td><td>MTC</td><td>Motion Completed</td></tr><tr><td>12</td><td>CPBF</td><td>Curve Parameter Buffer Full</td></tr><tr><td>13</td><td>EPD</td><td>Position deviation is too large</td></tr><tr><td>14</td><td>CMP1</td><td>Position compare1 is true</td></tr><tr><td>15</td><td>CMP2</td><td>Position compare2 is true</td></tr></table>

Table 1-12: IntFactor Bits for Source 0-11

▶ Source = 12 for system interrupt

<table><tr><td>Bit of ‘IntFactor’</td><td>Description</td></tr><tr><td>0</td><td>System Error</td></tr><tr><td>1</td><td>Emergency Stop</td></tr><tr><td>2</td><td>Cyclic Timer Interrupt</td></tr></table>

Table 1-13: IntFactor Bits for Source 12

▶ Source = 13 for GPIO interrupt

<table><tr><td>Bit of ‘IntFactor’</td><td>Description</td></tr><tr><td>0</td><td>General purposed DI, Channel 0</td></tr><tr><td>1</td><td>General purposed DI, Channel 1</td></tr><tr><td>8</td><td>Compare_Counter_CH0</td></tr><tr><td>9</td><td>Compare_Counter_CH1</td></tr><tr><td>10</td><td>Compare_Counter_CH2</td></tr></table>

Table 1-14: IntFactor Bits for Source 13

get\_int\_status:

This function allows user to identify what cause the interrupt signal. After interrupt, user can call this function to check what causes interrupt. The returned interrupt status information has exactly the same definition as described in previous function.

set\_int\_event:

This function is used to assign the window INT event.

int\_disable:

This function is used to disable the window INT event.

set\_int\_event2:

This function is used for creating an event mapping array for all interrupt factors of this board. There are 14 interrupt sources in one SSCNET board. Each source has 16 interrupt factors. Therefore, total events on one board are 224. Users must declare an event array which has 224 events. Each event represents one interrupt factor. Users can use WaitForSingleObject WINAPI function to wait one specific event without using get\_int\_status() function to check. This method shorten the time on an event-driven based control system.

clear\_tlc\_int:

This function is used to clear TLC interrupt status. TLC means torque limit reached.

set\_timer\_int\_interval:

This function is used to set the timer interrupt interval in sec. The minimum value is 0.000888sec. In Windows system, please don't use the timer interval less than 1ms because it is not a real time OS.

# @ Syntax

C/C++ (DOS, Windows)
```txt
I16 int_control(I16 Card, I16 Flag)
I16 set_int_factor(I16 Card, I16 Source, U16 IntFactor)
I16 get_int_status(I16 Card, I16 Source, U16 *IntStatus)
I16 set_int_event(I16 Card, HANDLE *HEvent)
I16 link_interrupt(I16 Card, void ( __stdcall *callbackAddr)( I16 IntAxisInCard))
I16 set_int_event2(I16 CardID, HANDLE *TotalEvent)
I16 clear_tlc_int(I16 Axis);
I16 set_timer_int_interval(I16 CardID, F64 Sec);
```
Visual Basic (Windows)

```txt
int_control (ByVal Card As Integer, ByVal Flag As Integer) As Integer
set_int_factor (ByVal Card As Integer, ByVal Source As Integer, ByVal IntFactor As Integer) As Integer
get_int_status (ByVal Card As Integer, ByVal Source As Integer, IntStatus As Integer) As Integer
set_int_event (ByVal Card As Integer, hEvent As Long) As Integer
link_interrupt (ByVal Card As Integer, ByVal lpCallBackProc As Long) As Integer
set_int_event2 (ByVal CardID As Integer, TotalEvent As Long) As Integer
clear_tlc_int (ByVal Axis As Integer) As Integer
set_timer_int_interval (ByVal CardID As Integer, ByVal Sec As Double) As Integer
```

# @ Arguments

CardID: The SSCNet series card index number.

Axis: specified axis index 0,1,2,3,4...

Flag: interrupt flag, 0 or 1 (0: Disable, 1: Enable)

Source: interrupt source,

▶ 0 - 11: for axis 0 - 11 respectively
▶ 12: for DSP system
▶ 13: for GPIO

IntFactor: interrupt factor, refer to previous table

\*IntStatus: interrupt status, refer to previous table

\*HEvent: event handler (for Windows)

\*callbackAddr: Call back function address.

TotalEvent: Event[224] pointer

Sec: timer interrupt interval in second, it is a 0.888ms 16bit counter.

# @ Return Code

```csv
ERROR_NoError
ERROR_Dll_Opened_By_Other_Process
ERROR_Card_Not_Exist
ERROR_PCIBios_Not_Exist
ERROR_Card_Reinitialized
ERROR_Card_Not_Exist
ERROR_Card_Not_Accessible
ERROR_Card_Not_Ready
ERROR_DSP_Not_Ready
ERROR_DSP_Initial_Time_Out
ERROR_Unknown_Card_Type
```

# @ Example

&lt;C/C++&gt;
```c
int_control -
I16 RetCode;
I16 Card = 0;
I16 Flag = 1; //Enable interrupt
RetCode = int_control(CardID, Flag);
```
set\_int\_factor-

```c
I16 RetCode;
I16 Card = 0;
I16 Source = 1; // Axis 1
U16 IntFactor= 0x800;// Motion complete
RetCode = set_int_factor(CardID, Source, IntFactor);
```
get\_int\_status

```c
I16 RetCode;
I16 Card = 0;
I16 Source = 1; // Axis 1
U16 IntStatus;
RetCode = get_int_status(CardID, Source, &IntStatus);
```

set\_int\_event
```c
I16 RetCode;
I16 Card = 0;
HANDLEHEvent[14];
RetCode = set_int_event (CardID,HEvent);
```
link\_interrupt

```txt
I16 RetCode;
I16 Card = 0;
RetCode = link_interrupt (CardID, CallBackProc);
...
__stdcall CallBackProc ( I16 Source)
...
}
```
set\_int\_event2

```c
HANDLE hTotalEvent[224];
I16 RetCode;
set_int_event2(CARD0, hTotalEvent);
int_control(CARD0, 1);
set_int_factor(CARD0, Source_Axis3, 0x10); // Axis3 INP
start_tr_move(Axis3, 50, 0, 100, 0, 0.01, 0.01)
WaitForSingleObject(hTotalEvent[16*Axis3 + 4], INFINITE); // INP
ResetEvent(hTotalEvent[16*Axis3 + 4]);
```
&lt;Visual Basic&gt;

int\_control
```txt
Dim RetCode As Integer
Dim Card As Integer, Flag As Integer
Card = 0;
Flag = 1;    'Enable interrupt
RetCode = int_control(CardID, Flag)
```
set\_int\_factor

```txt
Dim RetCode As Integer
Dim Card As Integer, Source As Integer, IntFactor
    As Integer
Card = 0
Source = 1 ' Axis 1
IntFactor = 0x800' Motion complete
RetCode = set_int_factor(CardID, Source,
    IntFactor);
```

get\_int\_status
```vba
Dim RetCode As Integer
Dim Card As Integer, Source As Integer, IntStatus
    As Integer
Card = 0
Source = 1 ' Axis 1
RetCode = get_int_status(CardID, Source,
    IntStatus)
```

set\_int\_event
```sql
Dim RetCode As Integer
Dim Card As Integer, Hevent(0 to 13) As Long
Card = 0
RetCode = set_int_event (CardID, Hevent(0));
```
link\_interrupt

```vba
Dim RetCode As Integer
Dim Card As Integer, Hevent(0 to 13) As Long
Card = 0
RetCode = link_interrupt (CardID, AddressOf
    CallBackProc);
...
Public Function CallBackProc (ByVal Source As
    Integer)
...
End Function
```

# 1.10 Position Compare Function

# @ Name

set\_compare(Axis, CMP1Pos, CMP1Dir, CMP2Pos, CMP2Dir) - set position compare

check\_compare(Axis, \*status) - check position comparing status

set\_compare\_source - set position comparator source

set\_compare\_channel(Axis, Channel, CMPPos, CMP-Dir) – set compare config by channel

set\_single\_compare(Axis, Channel, CMP\_Pos) - set compare position by channel

map\_dout\_and comparator(CardID, DOut\_Ch, AxisNo, CompNo, DOut\_mode) - mapping digital output channel as trigger output

set\_compare\_table\_dir(CardID, Table\_ChNo, Dir) - change compare data table's direction

link\_dout\_and\_compare\_table(CardID, DO\_ChNo, StartI, EndI, \*Table\_Data) – select trigger output's compare data table

set\_ext\_encoder\_compare\_method(CardID, EncNo, Mode) – set external encoder's compare method

set\_ext\_encoder\_compare\_value(CardID, EncNo, CompareValue) - set external encoder's compare value

# @ Description

set\_compare:

This function is used to set up position comparing for specified axis. Every motion axis of PCI-83XX Series has 2 position compare channel. It compares feedback position with desired position.

check\_compare:

This function is used to check position-comparing status. If the comparing has already come into existence, the relative bit of status becomes '1', otherwise '0'. All bit of status will be set to '0' every time when set\_compare() function is executed.

set\_compare\_source:

This function is used to select the source of position compare function. There are two sources of compare function: motor's feedback position or controller's command position.

set\_compare\_channel:

This function is used to set compare position and direction by channel. This function has fewer parameters than set\_compare() function. It needs less time than set\_compare() function.

set\_single\_compare:

This function is used to set compare position by channel. This function has fewer parameters than set\_compare() function. It needs less time than set\_compare() function.

map\_dout\_and\_comparator:

This function is used to mapping digital output pin to one of comparator in a specific axis. Each axis has two position comparators and each card has only two digital output pin. Users must tell the card mapping relation.

set\_compare\_table\_dir:

This function is used to set compare table's reloading direction. The compare data is static. When running continuous compare trigger function, on board DSP must know reloading direction of the data table. This function tells what reloading direction must be run. It reduces compare data size for two directions. Users need only build one compare data series plus a direction parameter instead of two compare data series table by difference directions.

link\_dout\_and\_compare\_table:

This function is used to link a static compare table data and attach it to one digital output channel. Also you can assign the starting index and ending index from the static compare table. After calling this function, the data from start index to end index will be transferred to SSCNET board. The talbe points for SSCNET Board must be less than 100.

set\_ext\_encoder\_compare\_method:

This function is used to set external encoder's compare method.

set\_ext\_encoder\_compare\_value:

This function is used to set external encoder's compare value.

# @ Syntax

# C/C++ (DOS, Windows)

```txt
I16 set_compare(I16 Axis, F64 CMP1Pos, I16
CMP1Dir, F64 CMP2Pos, I16 CMP2Dir)
I16 check_compare (I16 Axis, I16* status)
I16 set_compare_source(I16 Axis, I16 Source)
I16 set_compare_channel(I16 Axis, I16 Channel,
F64 CMPPos, I16 CMPDir);
I16 set_single_compare(I16 Axis, I16 Channel,
F64 CMPPos);
I16 map_dout_and comparator(I16 CardID, I16
DOut_Ch, I16 Axis, I16 Channel,I16
DOut_mode);
I16 set_compare_table_dir(I16 CardID, I16
Table_ChNo, I16 CMPDir );
I16 link_dout_and_compare_table(I16 CardID, I16
DO_ChNo, I16 StartI,I16 EndI, F32
*Table_Data);
I16 set_ext_encoder_compare_method(I16 CardID,
I16 EncNo, U16 Mode);
I16 set_ext_encoder_compare_value(I16 CardID, I16
EncNo, I32 CMPPos);
```

# Visual Basic (Windows)

```txt
set_compare (ByVal Axis As Integer, ByVal CMP1Pos As Double, ByVal CMP1Dir As Integer, ByVal CMP2Pos As Double, ByVal CMP2Dir As Integer) As Integer
check_compare (ByVal Axis As Integer, status As Integer) As Integer
set_compare_source (ByVal Axis As Integer, ByVal Source As Integer) As Integer
set_compare_channel(ByVal Axis As Integer, ByVal Channel As Integer, ByVal CMPPos As Double, ByVal CMPDir As Integer) As Integer
```

```csv
set_single_compare(ByVal Axis As Integer, ByVal Channel As Integer, ByVal CMPPos As Double) As Integer
map_dout_and comparator(ByVal CardID As Integer, ByVal DOut_Ch As Integer, ByVal Axis As Integer, ByVal Channel As Integer, ByVal DOut_mode As Integer) As Integer
set_compare_table_dir(ByVal CardID As Integer, ByVal Table_ChNo As Integer, ByVal CMPDir As Integer) As Integer
link_dout_and_compare_table(ByVal CardID As Integer, ByVal DO_ChNo As Integer, ByVal StartI As Integer, ByVal EndI As Integer, Table_Data As Single) As Integer
set_ext_encoder_compare_method(ByVal CardID As Integer, ByVal EncNo As Integer, ByVal Mode As Integer) As Integer
set_ext_encoder_compare_value(ByVal CardID As Integer, ByVal EncNo As Integer, ByVal CMPPos As Long) As Integer
```

# @ Arguments

Axis: specified axis index

CMP1Pos: Desired position for compare channel1 in unit of mm.

CMP2Pos: Desired position for compare channel1 in unit of mm.

CMP1Dir: select comparing direction for compare channel 1

CMP2Dir: select comparing direction for compare channel 1

▶ CMP#Dir = 0, disable
▶ CMP#Dir = 1, feedback > ComparePos
▶ CMP#Dir = 2: feedback >= ComparePos
▶ CMP#Dir = 3, feedback &lt; ComparePos
▶ CMP#Dir = 4: feedback &lt;= ComparePos
▶ CMP#Dir = 5, feedback == ComparePos

\*status: return of compare startus

▶ bit 0, for compare channel 1

▶ bit 1, for compare channel 2

Source: 0 means feedback, 1 means command

CardID: The SSCNet series card index number.

Channel: compare channel inside axis, 0=CMP1, 1=CMP2

CMPPos: compare position

CMPDir: compare table direction, 0=increasing, 1=decreasing

DOut\_Mode: digital output mode, 0=normal low, 1=normal high

DOut\_Ch: digital output channel selection, 0=DO1, 1=DO2

Table\_ChNo: Table Attached DO number

StartI: start index of compare table

EndI: end index of compare table, (Endl-Startl)&lt;100

\*Table\_Data: static table data pointer created by users

EncNo: external encoder number

Mode: compare method= 1, 2:greater or equal, 3,4: less or equal

# @ Return Code

```txt
ERROR_NoError
ERROR_Dll_Opened_By_Other_Process
ERROR_Wrong_Axis_Number
ERROR_Card_Not_Ready
ERROR_Card_Not_Initial
ERROR_DSP_Not_Ready
ERROR_Axis_Not_In_Control
ERROR_Wrong_CMP_Channel
ERROR_Wrong_DIO_Channel_Number
ERROR_Wrong_Compare_Talbe_Count
```

# @ Example

```txt
&lt;C/C++&gt;
```

set\_compare
```txt
I16 RetCode;
I16 Axis = 1;
F64 CMP1Pos = 10.0; // 10.0 mm
F64 CMP2Pos = -10.0; // -10.0 mm
I16 CMP1Dir = 1; // feedback > ComparePos
I16 CMP2Dir = 3; // feedback &lt; ComparePos
```

```c
RetCode = set_compare(Axis, CMP1Pos, CMP1Dir, CMP1Pos, CMP2Dir);
```

check\_compare
```txt
I16 RetCode;
I16 Axis = 1;
I16 status;
RetCode = check_compare (Axis, &status);
```
&lt;Visual Basic&gt;

set\_compare
```txt
Dim RetCode As Integer
Dim Axis As Integer, CMP1Pos As Double, CMP1Dir
As Integer
Dim CMP2Pos As Double, CMP2Dir As Integer
Axis = 1
CMP1Pos = 10.0    ' 10.0 mm
CMP2Pos = -10.0' -10.0 mm
CMP1Dir = 1' feedback > ComparePos
CMP2Dir = 3' feedback &lt; ComparePos
RetCode = set_compare(Axis, CMP1Pos, CMP1Dir,
    CMP2Pos, CMP2Dir)
```

check\_compare
```txt
Dim RetCode As Integer
Dim Axis As Integer, status As Integer
Axis = 1
RetCode = check_compare (Axis, status)
```

# 1.11 Interlock Function

# @ Name

set\_interlock(CardID, Flag, Axis\_X, Axis\_Y, X1, X2, Y1, Y2, Time) - setup interlock function

get\_interlock(CardID, \*Flag, \*Axis\_X, \*Axis\_Y, \*X1, \*X2, \*Y1, \*Y2, \*Time) - get interlock parameters from board.

# @ Description

set\_interlock:

This function is used to set up interlock facility. Every PCI-83XX Series has a interlock protect facility.

get\_interlock:

This function is used to get interlock parameters on SSCNET Board.

# @ Syntax

C/C++ (DOS, Windows)

```c
I16 set_interlock(I16 Card, I16 Flag, I16 Axis_X, I16 Axis_Y, F64 X1, F64 X2, F64 Y1, F64 Y2)
I16 get_interlock(I16 CardID, I16 *Flag, I16 *Axis_X, I16 *Axis_Y, F32 *X1, F32 *X2, F32 *Y1, F32 *Y2, F32 *Time);
```

# Visual Basic (Windows)

```txt
set_interlock(ByVal Card As Integer, ByVal Flag As Integer, ByVal Axis_X As Integer, ByVal Axis_Y As Integer, ByVal X1 As Double, ByVal X2 As Double, ByVal Y1 As Double, ByVal Y2 As Double) As Integer
get_interlock(ByVal Card As Integer, Flag As Integer, Axis_X As Integer, Axis_Y As Integer, X1 As Double, X2 As Double, Y1 As Double, Y2 As Double) As Integer@ Arguments
```

CardID: specified card index

Flag: Enable/Disable interlock facility

▶ Flag = 0, Disable
▶ Flag = 1, Enable

Axis\_X, Axis\_Y: specified axis number

x1, x2, y1, y2: specified interlock region

# @ Return Code

```txt
ERROR_NoError
ERROR_Dll_Opened_By_Other_Process
ERROR_Wrong_Axis_Number
ERROR_Card_Not_Ready
ERROR_Card_Not_Initial
ERROR_DSP_Not_Ready
ERROR_Axis_Not_In_Control
```

# @ Example

```txt
&lt;C/C++&gt;
```

set\_interlock
```c
I16 RetCode;
I16 Card = 0;
I16 Flag = 1; //Enable interlock
I16 Axis_X = 1; // Axis 1
I16 Axis_Y = 6; //Axis 6
F64 X1 = -10.0;
F64 X2 = 15.0;
F64 Y1 = -15.0;
F64 Y2 = 10.0;
F64 Time = 0.01;
RetCode = set_interlock(CardID, Flag, Axis_X, Axis_Y, X1, X2, Y1, Y2, Time);
```

# &lt;Visual Basic&gt;

set\_interlock
```txt
Dim RetCode As Integer
Dim Card As Integer, Flag As Integer
Dim Axis_X As Integer, Axis_Y As Integer
Dim X1 As Double, X2 As Double, Y1 As Double, Y2 As Double
Card = 0
```

```ini
Flag = 1 //Enable interlock
Axis_X = 1// Axis 1
Axis_Y = 6//Axis 6
X1 = -10.0
X2 = 15.0
Y1 = -15.0
Y2 = 10.0
FTime = 0.01
RetCode = set_interlock(CardID, Flag, Axis_X, Axis_Y, X1, X2, Y1, Y2, FTime)
```

# 1.12 Absolute Position System

# @ Name

get\_abs\_position(Axis, \*ABS\_Pos) - get ABS position value from driver

save\_abs\_position(Axis) - save current position as absolute zero to ROM

clear\_abs\_data\_on\_flash(CardID) - clear ABS data in ROM

# @ Description

get\_abs\_position:

This function will get the ABS data from servo driver and calculate ABS position. It changes the monitor channels to 0x0b, 0x0c, 0x1c and 0x1a. Then it obtains RevOffset, CurData, OrgData and AbsR. It also obtains the servo parameter07 about the rotation direction setting and the PPR of the axis. Finally, it will calculate the ABS\_Pos according to servo parameter07. You can see that the procedures are more than the get\_position() function and it takes a longer time. Normally, this function is not needed at run time; use get\_position() instead.

If servo parameter07 is set to '1', this function must be used to obtain ABS\_Pos after MDSP\_initial() and the set\_position() function must be used by this ABS\_Pos. If this is not performed, the initial position of get\_position() function will feedback an incorrect value. If servo parameter07 is set to '0', nothing need to be done after MDSP\_initial(). The get\_position() value will be the correct ABS\_Pos.

save\_abs\_position:

This function is used to save current zero point into the onboard flash. Next time the servo drivers are connected, the ABS position will be calculated according to this zero point. It changes the monitor channels to 0x0b, 0x0c, 0x0d, 0x1a. Then it obtains CurData and RevData, which are then saved to the flash.

If the ABS origin data does not exist on the FLASH, the current position will be zero at beginning. Notice that after this function is called, the monitor channel will be changed. To be sure that the position is in zero location, this function will return an error when command counter is not zero.

clear\_abs\_data\_on\_flash:

This function will clear all axes' ABS position data on the onboard flash. It will not load the ABS position the next time the servo drivers are connected.

# @ Syntax

C/C++ (DOS, Windows)
```c
I16 clear_abs _data_on_flash(I16 CardID);
I16 save_abs_position(I16 Axis);
I16 get_abs_position(I16 Axis, F64 *ABS_Pos);
```
Visual Basic (Windows)

```txt
clear_abs_data_on_flash(ByVal CardID As Integer)
As Integer
save_abs_position(ByVal Axis As Integer) As
    Interger
get_abs_position(ByVal Axis As Integer, ABS_Pos
    As Double) As Integer
```

# @ Arguments

CardID: specified card index

Axis: specified axis index

ABS\_Pos: Current position relative to absolute origin of driver

# @ Return Code

```txt
ERROR_NoError
ERROR_Dll_Opened_By_Other_Process
ERROR_Wrong_Axis_Number
ERROR_Card_Not_Ready
ERROR_Card_Not_Initial
ERROR_DSP_Not_Ready
ERROR_Axis_Not_In_Control
ERROR_Unknown_Card_Type
ERROR_Command_Counter_Not_Zero
ERROR_Clear_ABS_Data_Fail
```

@ Example
&lt;C/C++&gt;
```asm
// After home_move(), the command position
    position should be zero.
for(i=0;i&lt;TotalAxes;i++)
    save_abs_position(i);
.
.
.
// When program ends, call this functions will
    save all axes' ABS value
MDSP_close(CARD0);
.
.
.
// Next time when program starts, call this
    function will load all axes'
// ABS value
MDSP_initial(0);
.
.
.
// If users want to erase ABS data on FLASH
clear_abs_data_on_flash(CARD0);
// If users wants to reload ABS data, use the
    following two functions
F64 ABS_Value;
get_abs_data(AxisNo, &ABS_Value);
set_position(AxisNo, ABS_Value);
```
&lt;Visual Basic&gt;

```txt
' After home_move(), the command position
    position should be zero.
For i=0 to TotoalAxes-1
    save_abs_position i
Next i
.
.
.
' When program ends, call this functions will
    save all axes' ABS value
MDSP_close CARD0
```

```txt
'
Next time when program starts, call this function will load all axes'
' ABS value
MDSP_initial 0
.
.
.
' If users want to erase ABS data on FLASH clear_abs_data_on_flash CARD0
' If users wants to reload ABS data, use the following two functions
get_abs_data AxisNo, ABS_Value
set_position AxisNo, ABS_Value
```

# 1.13 Pulse Output Control

# @ Name

set\_pulse\_output\_control(Axis, Enable, PulseCH, Mode) – Map pulse output control to one axis

# @ Description

set\_pulse\_output\_control:

This function is used to enable/disable the pulse output control of the axis. Users can map one of the 12 axes to one pulse output channel and set the pulse output mode from 3 types of pulse format. After issuing this function, the axis is regarded as a stepper control axis. Users can use any motion function for this axis. This feature is not available in PCI version but in cPCI version.

# @ Syntax

C/C++ (DOS, Windows)

I16 set\_pulse\_output\_control(I16 Axis, U16 Enable, U16 PulseCH, U16 Mode);

# Visual Basic (Windows)

set\_pulse\_output\_control(ByVal Axis As Integer, ByVal Enable As Integer, ByVal PulseCH As Integer, ByVal Mode As Integer) As Integer

# @ Arguments

Axis: specified axis index

Enable: Enable(1)/disable(0) the pulse output of the axis.

PulseCH: Assign pulse output channel (0 or 1)

Mode: Assign pulse output mode

▶ Mode=0 OUT/DIR
▶ Mode=1 CW/CCW
▶ Mode=2 EA/EB
▶ Others=Reserved

# @ Return Code

```txt
ERROR_NoError
ERROR_Dll_Opened_By_Other_Process
ERROR_Wrong_Axis_Number
ERROR_Card_Not_Ready
ERROR_Card_Not_Initial
ERROR_DSP_Not_Ready
ERROR_Axis_Not_In_Control
```

# 1.14 Sequence Motion Control

# @ Name

add\_frame\_ta\_move - add motion frames into on board frame buffer

add\_frame\_dwell(Axis, StartFrameNo, DTime) - add dwell frame into on board frame buffer

set\_pattern – set the pattern by frame range in frame buffer

get\_pattern – get the frame range information of the pattern

insert\_pattern\_to\_seq\_buffer – insert the pattern number in sequence command buffer

insert\_pattern\_to\_seq\_buffer – insert the pattern number in sequence command buffer

check\_seq\_buffer(CardID, SeqNo) - check sequence command buffer index

reset\_seq\_buffer(CardID, SeqNo) – reset sequence command buffer index

start\_seq\_move - start sequence motion

pause\_seq\_move - pause sequence motion

resume\_seq\_move - resume sequence motion

end\_seq\_move - quit sequence motion

set\_seq\_sync\_pause - set synchronous axes stop in sequence motion

check\_seq\_buffer\_index - read back sequence motion command buffer index

check\_seq\_buffer\_empty\_count(CardID, SeqNo) – read back sequence motion command buffer empty quantities

# @ Description

add\_frame\_ta\_move:

This function is for users to create motion frames in the onboard frame buffer. It will create 1\~3 frames depend on the velocity and position parameter. The return code of it is the start frame number for next motion command. Users can create up to 1200 frames in the frame buffer.

add\_frame\_dwell:

This function is for users to create a dwell frame in the onboard frame buffer. The parameter of time is in unit of second. Notice that in SSCNET system, the time base is 0.888ms. The return code of it is the start frame number for next motion command.

set\_pattern:

This function is for users to set a pattern for sequence command buffer. The pattern is composed by several frames. It contents starting frame number, total frame number and synchronized axes.

get\_pattern:

This function is for users to get a pattern information including starting frame number, total frame number and synchronized axes.

insert\_pattern\_to\_seq\_buffer:

This function is for users to insert a pattern into sequence command buffer. Each sequence has 4 command buffers to store pattern number. The command buffer is for continuous pattern motion of the sequence especially when the pattern quantities of the sequence are greater than 4. Users also can set a starting condition for an individual pattern. Notice that the pattern inserting time is about 2ms.

check\_seq\_buffer:

This function is for users to check the sequence command buffer. It will return 1 when the sequence command buffer is ready for next command inserted. If the return value is 0, it means the buffer is full.

reset\_seq\_buffer:

This function is for users to reset the sequence command buffer index. It will reset "begin" and "end" index to zero.

start\_seq\_move:

This function is for users to start one or more than one sequence motion. Once it is started, the axes in the sequences will start to move or waiting the start conditions. Users can issue this command before pattern is inserted.

pause\_seq\_move:

This function is for users to pause one or more than one sequence motion at the same time. All the axes in the sequences will slow down then stop at the same time.

resume\_seq\_move:

This function is for users to resume one or more than one sequence motion. All the axes in the sequences will speed up at the same time.

end\_seq\_move:

This function is used to end sequence motion condition. Once start\_seq\_motion() is issued, all the sequences will be in a state of waiting patterns for running and the motion status will be in busy state. This condition will not be cancelled until the end\_seq\_motion() is issued. Notice that this function is only applicable when the sequene buffer is empty or it will return an error code. The motion busy status will be clear after the function is issued. If users want to execute non-sequence motion command, they must launch this function first.

set\_seq\_sync\_pause:

This function is used to enable synchronous motion check between axes in sequence motion control. If the axes has common working area or the axes have specific coordinated relationship, users can use this function to prevent machine to crash. For example, if axis0 and axis1 are set to synchronous pause, once axis0 is stopped by any reason, axis1 will stop at the same time. Once it is paused by any emergency reason, Please use motion stop function to stop sequence motion or resume sequence function to continue sequence motion.

check\_seq\_buffer\_index:

This function is used to read back sequence motion command buffer index for double checking. It can read back next read index, next write index and running index.

check\_seq\_buffer\_empty\_count:

This function is used to read back sequence motion command buffer empty quantities. It is for double checking. The return code of this function is the count.

# @ Syntax

# C/C++ (DOS, Windows)

```csv
I16 add_frame_ta_move(I16 Axis, I16 StartFrameNo, F64 StartPos, F64 EndPos, F64 StartVel, F64 MaxVel, F64 FinVel, F64 Tacc, F64 Tdec);
I16 add_frame_dwell(I16 Axis, I16 StartFrameNo, F64 StayPos, F64 DTime);
I16 get_pattern(I16 CardID, I16 PatternNo, I16 *FirstFrame, I16 *TotalFrame, U16 *SyncAxes);
I16 set_pattern(I16 CardID, I16 PatternNo, I16 FirstFrame, I16 TotalFrame, U16 SyncAxes);
I16 insert_pattern_to_seq_buffer(I16 CardID, I16 SeqNo, I16 PatternNo, I16 SyncAxes, I16 WaitAxis, I16 StartCondition, I16 StartPatternNo, F32 StartData, I16 EndCondition);
I16 check_seq_buffer(I16 CardID, I16 SeqNo);
I16 start_seq_move(I16 CardID, I16 SeqNoBit);
I16 reset_seq_buffer(I16 CardID, I16 SeqNo);
I16 pause_seq_move(I16 CardID, I16 SeqNoBit, F64 Dec_Time);
I16 resume_seq_move(I16 CardID, I16 SeqNoBit, F64 Acc_Time);
I16 end_seq_move(I16 CardID, I16 SeqNoBit);
I16 set_seq_sync_pause(I16 CardID, I16 Flag, I16 GroupNo, I16 AxisNoBit, F64 DecTime)
I16 check_seq_buffer_index(I16 CardID, I16 SeqNo, I16 *NextRead, I16 *NextWrite, I16 *RunningIndex);
I16 check_seq_buffer_empty_count(I16 CardID, I16 SeqNo)
```

# Visual Basic (Windows)

```c
end_seq_move(ByVal CardID As Integer, ByVal SeqNoBit As Integer) As Integer
set_seq_sync_pause(ByVal CardID As Integer, ByVal Flag As Integer, ByVal GroupNo As Integer,
```

```txt
ByVal AxisNoBit As Integer, ByVal DecTime As Double) As Integer
check_seq_buffer_index(ByVal CardID As Integer, ByVal SeqNo As Integer, NextRead As Integer, NextWrite As Integer, RunningIndex As Integer) As Integer
check_seq_buffer_empty_count (ByVal CardID As Integer, ByVal SeqNo As Integer) As Integer
```

# @ Arguments

Axis: specified axis index

CardID: specified card ID

StartFrameNo: Start FrameNo in frame buffer (max=1200)

StartPos: Start position of the frame motion in mm

EndPos: End position of the frame motion in mm

StartVel: Start velocity of the frame motion in mm/s

MaxVel: Maximun velocity of the frame motion in mm/s

FinVel: Final velocity of the frame motion in mm/s

Tacc: Acceleration time of the frame motion in mm/s2

Tdec: Deceleration time of the frame motion in mm/s2

DTime: Dwell time in sec

FrameNo: Frame number in onboard frame buffer

\*FTime: Frame duration time in on board frame buffer

PatternNo: Pattern number

FirstFrame: The starting frame number in the pattern

TotalFrame: The total frame number in the pattern

SyncAxes: Assigned synchronized motion axes in the sequence

\*FirstFrame: The starting frame number readback in the pattern

\*TotalFrame: The total frame number readback in the pattern

\*SyncAxes: Synchronized motion axes readback in the sequence

SeqNo: Sequence number

SeqNoBit: Sequence number in each bit

# WaitFlag:

▶ 0 = ignore start condition and start immediately
▶ 1 = wait for axis condition
▶ 2 = ignore start condition and start immediately. It will generate INP interrupt if enabled when this pattern ends.
▶ 3 = wait for axis condition. It will generate INP interrupt if enabled when this pattern ends.

WaitAxis: The axis number associated with start condition when WaitFlag=1

# StartCondition:

▶ Frame start condition:
▷ 0\~98= the pattern number of wait axis (please refer to StartData for additional setting)
▶ Compare start condition:
▷ 100\~199= feedback position >= StartData (when the pattern is equal to 0\~99)
▷ 200\~299= feedback position &lt;= StartData (when the pattern is equal to 0\~99)

# StartData:

▶ For Frame start condition:
It means frame order number in a pattern, start from 0. The sequence will start at the beginning of the frame order number in a pattern.
▶ For Compare start condition:
▷ It means the compare value in unit of mm

Flag: Sequence motion flag (0: Disable, 1: Enable)

GroupNo: range = 0\~5

AxisNoBit: axis number in each bit

Dec\_Time: Deceleration time of pause command

Acc\_Time: Acceleration time of resume command

\*NextRead: Next read index

\*NextWrite: Next write index

\*RunningIndex: Current Running Index

@ Return Code
```txt
ERROR_NoError
ERROR_Dll_Opened_By_Other_Process
ERROR_Wrong_Axis_Number
ERROR_Card_Not_Ready
ERROR_Card_Not_Initial
ERROR_DSP_Not_Ready
ERROR_Axis_Not_In_Control
```

@ Example
```c
&lt;C/C++&gt;
end_seq_move -
    intert_pattern_to_seq_buffer(CARD0, SEQ0, P00,
    SYNC0, WAIT_OFF, StartCondition,
    StartData);
    intert_pattern_to_seq_buffer(CARD0, SEQ1, P20,
    SYNC1, WAIT_ON, StartCondition, StartData);
    start_seq_move(CARD0, SYNC0 | SYNC1 );
    ...
    // After All sequene motion is finished.
    end_seq_move(CARD0, SYNC0 | SYNC1);
```

set\_seq\_sync\_pause -
```c
set_seq_sync_pause(CARD0, ENABLE, PAIR0, 0x03, 0.1);
tv_stop(AXISO, 0.1);
resume_seq_move
// When tv_stop() is launched, the corresponding axis1 will be stopped too
```

# 1.15 Auto Stop Protection Function

# @ Name

```erlang
set_pos_diff_stop(CardID, Enable,
    PosDiffCheckSetNo_0_To_5, Axis_X, Axis_Y,
    UpperLimit, LowerLimit)
```

# @ Description

set\_pos\_diff\_stop:

This function is used for checking two axes' position difference. If the position difference of two axes over the preset range, they will be stopped automatically. Users can set 6 pairs of axes for this checking. Each pair contents two axes and they can't be overlapped in axis number. Once the motion is stopped by this function, please disable it by the same function and move axes to a safe position then re-enable it.

# @ Syntax

# C/C++ (Windows)

```txt
I16 set_pos_diff_stop(I16 CardID, I16 Enable, I16 PosDiffCheckSetNo_0_To_5, I16 Axis_X, I16 Axis_Y, F32 UpperLimit, F32 LowerLimit)
```

# Visual Basic (Windows)

```txt
set_pos_diff_stop(ByVal CardID As Integer, ByVal Enable As Integer, ByVal PosDiffCheckSetNo_0_To_5 As Integer, ByVal Axis_X As Integer, ByVal Axis_Y As Integer, ByVal UpperLimit As Single, ByVal LowerLimit As Single) As Integer
```

# @ Argument

CardID: The PCI-83XX Series card index number.

Enable: 0=liable, 1=enable

PosDiffCheckSetNo\_0\_To\_5: range = 0\~5

Axis\_x: The first axis in one pair

Axis\_Y: The second axis in one pair

UpperLimit: The position difference upper limit value ( UpperLimit > LowerLimit )

LowerLimit: The position difference lower limit value ( LowerLimit &lt; UpperLimit )

@ Return Code
```txt
ERROR_NoError
ERROR_Dll_Opened_By_Other_Process
ERROR_Card_Not_Exist
ERROR_PCIBios_Not_Exist
ERROR_Card_Reinitialized
ERROR_Card_Not_Exist
ERROR_Card_Not_Accessible
ERROR_Card_Not_Ready
ERROR_DSP_Not_Ready
ERROR_DSP_Initial_Time_Out
ERROR_Uknow_Card_Type
```

@ Example
```txt
&lt;C/C++&gt;
```

set\_pos\_diff\_stop -
```txt
F32 UpperLimit, LowerLimit
I16 RetCode;
set_pos_diff_stop(CARD0, ENABLE, PAIR0, Axis0, Axis2, -10.123, 18.435);
```

If the axes stops by this function, please disable it by setting flag=0. Others parameter will be ignored.

```txt
set_pos_diff_stop(CARD0, DISABLE, PAIR0, Axis0, Axis2, -10.123, 18.435);
```

After stop condition recovered, please re-enable it again.

# 2 Appendix

# 2.1 MR-J2S-B Alarm List

When any alarm has occurred, eliminate its cause, ensure safety, then deactivate the alarm, and restart operation. Not doing so can cause injury.

<table><tr><td>AL.10</td><td>Undervoltage</td><td>Power supply voltage dropped. MR-J2S-B: 160V or lessMR-J2S-oB1: 83V or less</td></tr><tr><td>AL.12</td><td>Memory alarm 1</td><td>RAM memory fault</td></tr><tr><td>AL.13</td><td>Clock alarm</td><td>Printed board fault</td></tr><tr><td>AL.15</td><td>Memory alarm 2</td><td>EEPROM fault</td></tr><tr><td>AL.16</td><td>Encoder alarm 1</td><td>Communication error occurred between encoder and servo amplifier.</td></tr><tr><td>AL.17</td><td>Board alarm</td><td>CPU/parts fault</td></tr><tr><td>AL.19</td><td>Memory alarm 3</td><td>ROM memory fault</td></tr><tr><td>AL.1A</td><td>Motor combination alarm</td><td>Combination of servo amplifier and servo motor is wrong.</td></tr><tr><td>AL.20</td><td>Encoder alarm 2</td><td>Communication error occurred between encoder and servo amplifier.</td></tr><tr><td>AL.24</td><td>Main circuit error</td><td>Ground fault occurred at the servo motor outputs (U, V, W phases) of the servo amplifier.</td></tr><tr><td>AL.25</td><td>Absolute position erase</td><td>Absolute position data in errorPower was switched on for the first time in the absolute position detection system.</td></tr><tr><td>AL.30</td><td>Regenerative alarm</td><td>The permissible regenerative power of the built-in regenerative brake resistor or regenerative brake option is exceeded.Regenerative transistor fault</td></tr><tr><td>AL.31</td><td>Overspeed</td><td>Speed has exceeded the instantaneous permissible speed.</td></tr><tr><td>AL.32</td><td>Overcurrent</td><td>Current that flew is higher than the permissible current of the servo amplifier.</td></tr><tr><td>AL.33</td><td>Overvoltage</td><td>Converter bus voltage input value-exceeded 400V.</td></tr><tr><td>AL.34</td><td>CRC error</td><td>Bus cable is faulty.</td></tr><tr><td>AL.35</td><td>Command pulse frequency alarm</td><td>The pulse frequency of the input command pulses is too high.</td></tr><tr><td>AL.36</td><td>Transfer error</td><td>Bus cable or printed board is faulty.</td></tr><tr><td>AL.37</td><td>Parameter alarm</td><td>Parameter setting is wrong.</td></tr><tr><td>AL.45</td><td>Main circuit device overheat</td><td>Main circuit overheated abnormally.</td></tr><tr><td>AL.46</td><td>Motor overheat</td><td>Servo motor temperature rise actuated the thermal protector.</td></tr><tr><td>AL.50</td><td>Overload 1</td><td>Load exceeded overload protection characteristic of servo amplifier.Load ratio 300%: 2.5s or moreLoad ratio 200%: 100s or more</td></tr></table>

Table 2-1: MR-J2S-B Alarm List

<table><tr><td>AL.51</td><td>Overload 2</td><td>Machine collision etc. caused max. output current to flow successively for several seconds.Servo motor locked: 1s or more</td></tr><tr><td>AL.52</td><td>Error excessive</td><td>Droop pulse value of the deviation counter exceeded the parameter No.31 setting value .</td></tr><tr><td>AL.8E</td><td>Serial communication alarm</td><td>Serial communication fault occurred between servo amplifier and communication device (e.g. personal computer).</td></tr><tr><td>88</td><td>Watchdog</td><td>CPU, parts faulty</td></tr></table>

Table 2-1: MR-J2S-B Alarm List

# 2.2 MR-J2S-B Warning List

If E6, E7, E9 or EE occurs, the servo off status is established. If any other warning occurs, operation can be continued but an alarm may take place or proper operation may not be performed. Eliminate the cause of the warning according to this section. Use the optional servo configuration software to refer to the cause or warning.

<table><tr><td>AL.92</td><td>Open battery cable warning</td><td>Absolute position detection system battery voltage is low.</td></tr><tr><td>AL.96</td><td>Home position setting warning</td><td>Home position return could not be made in the precise position.</td></tr><tr><td>AL.9F</td><td>Battery warning</td><td>Voltage of battery for absolute position detection system reduced.</td></tr><tr><td>AL.E0</td><td>Excessive regenerative load warning</td><td>There is a possibility that regenerative power may exceed permissible regenerative power of built-in regenerative brake resistor or regenerative brake option.</td></tr><tr><td>AL.E1</td><td>Overload warning</td><td>There is a possibility that overload alarm 1 or 2 may occur.</td></tr><tr><td>AL.E3</td><td>Absolute position counter warning</td><td>Absolute position encoder pulses faulty.</td></tr><tr><td>AL.E4</td><td>Parameter warning</td><td>Parameter outside setting rang.</td></tr><tr><td>AL.E6</td><td>Servo emergency stop</td><td>EM1-SG are open.</td></tr><tr><td>AL.E7</td><td>Controller emergency stop warning.</td><td></td></tr><tr><td>AL.E9</td><td>Main circuit off warning</td><td>Servo was switched on with main circuit power off.</td></tr><tr><td>AL.EE</td><td>SCCNET error warning</td><td>The servo system controller connected is not SSCNET-compatible..</td></tr></table>

Table 2-2: MR-J2S-B Warning List

2.3 Driver parameter List

<table><tr><td>Symbol</td><td>Name</td><td>MR-J2SB Instruction Manual Parameter</td><td>Unit</td><td>Setting range</td></tr><tr><td>*AMS</td><td>Amp setting</td><td>Pr.01</td><td></td><td>0000H~0001H</td></tr><tr><td>*REG</td><td>Regenerative resistor</td><td>Pr.02</td><td></td><td>0000H~0011H</td></tr><tr><td>*MTY</td><td>For manufacturer&#x27;s settings</td><td>Pr.03</td><td></td><td>0080H</td></tr><tr><td>*MCA</td><td>For manufacturer&#x27;s settings</td><td>Pr.04</td><td></td><td>0000H</td></tr><tr><td>*MTR</td><td>For manufacturer&#x27;s settings</td><td>Pr.05</td><td></td><td>1</td></tr><tr><td>*FBP</td><td>Feedback pulse number</td><td>Pr.06</td><td></td><td>0,1,6,7,225</td></tr><tr><td>*POL</td><td>Direction of motor rotation</td><td>Pr.07</td><td></td><td>0,1</td></tr><tr><td>ATU</td><td>Auto-tuning</td><td>Pr.08</td><td></td><td>0000H~0004H</td></tr><tr><td>RSP</td><td>Servo response setting</td><td>Pr.09</td><td></td><td>0001H~000FH</td></tr><tr><td>TLP</td><td>Forward rotation torque limits</td><td>Pr.10</td><td>%</td><td>0~Maximum torque</td></tr><tr><td>TLN</td><td>Reverse rotation torque limits</td><td>Pr.11</td><td>%</td><td>0~Maximum torque</td></tr><tr><td>DG2</td><td>Moment of inertia ratio of load</td><td>Pr.12</td><td>0.1</td><td>0~3000</td></tr><tr><td>PG1</td><td>Position control gain 1</td><td>Pr.13</td><td>rad/sec</td><td>4~2000</td></tr><tr><td>VG1</td><td>Speed control gain 1</td><td>Pr.14</td><td>rad/sec</td><td>20~8000</td></tr><tr><td>PG2</td><td>Position control gain 2</td><td>Pr.15</td><td>rad/sec</td><td>1~1000</td></tr><tr><td>VG2</td><td>Speed control gain 2</td><td>Pr.16</td><td>rad/sec</td><td>20~20000</td></tr><tr><td>VIC</td><td>Speed integration compensation</td><td>Pr.17</td><td>msec</td><td>1~1000</td></tr><tr><td>NCH</td><td>Mechanical resonance control filter</td><td>Pr.18</td><td></td><td>0~031FH</td></tr><tr><td>FFC</td><td>Feed forward gain</td><td>Pr.19</td><td>%</td><td>0~100</td></tr><tr><td>INP</td><td>In position range</td><td>Pr.20</td><td>pulse</td><td>0~50000</td></tr><tr><td>MBR</td><td>Electromagnetic brake sequence output</td><td>Pr.21</td><td>msec</td><td>0~1000</td></tr><tr><td>MOD</td><td>Monitor output mode</td><td>Pr.22</td><td></td><td>0000H~0B0BH</td></tr><tr><td>OP1</td><td>Optional function 1</td><td>Pr.23</td><td></td><td>0000H~0001H</td></tr><tr><td>OP2</td><td>Optional function 2</td><td>Pr.24</td><td></td><td>0000H~0110H</td></tr><tr><td>LPF</td><td>Low pass filter</td><td>Pr.25</td><td></td><td>0000H~1210H</td></tr><tr><td>OP4</td><td>For manufacturer&#x27;s settings</td><td>Pr.26</td><td></td><td>0000H</td></tr><tr><td>MO1</td><td>Monitor output 1 offset</td><td>Pr.27</td><td>mv</td><td>-999~999</td></tr><tr><td>MO2</td><td>Monitor output 2 offset</td><td>Pr.28</td><td>Mv</td><td>-999~999</td></tr></table>

Table 2-3: Driver parameter List

<table><tr><td>Symbol</td><td>Name</td><td>MR-J2SB Instruction Manual Parameter</td><td>Unit</td><td>Setting range</td></tr><tr><td>MOA</td><td>For manufacturer&#x27;s settings</td><td>Pr.29</td><td></td><td>0001H</td></tr><tr><td>ZSP</td><td>Zero speed</td><td>Pr.30</td><td>rpm</td><td>0~10000</td></tr><tr><td>ERZ</td><td>Error excess alarm level</td><td>Pr.31</td><td>kpulse</td><td>1~1000</td></tr><tr><td>OP5</td><td>Option function 5</td><td>Pr.32</td><td></td><td>0000H~0002H</td></tr><tr><td>OP6</td><td>For manufacturer&#x27;s settings</td><td>Pr.33</td><td></td><td>0000H~0113H</td></tr><tr><td>VPI</td><td>PI-PID change position droop</td><td>Pr.34</td><td></td><td>0~50000</td></tr><tr><td>TTT</td><td>For manufacturer&#x27;s settings</td><td>Pr.35</td><td></td><td>0000H</td></tr><tr><td>VDC</td><td>Speed integration compensation</td><td>Pr.36</td><td></td><td>0~1000</td></tr><tr><td>OP7</td><td>For manufacturer&#x27;s settings</td><td>Pr.37</td><td></td><td>0010H</td></tr><tr><td>ENR</td><td>Encoder output pulse</td><td>Pr.38</td><td></td><td>0~32768</td></tr><tr><td></td><td>For manufacturer&#x27;s settings</td><td>Pr.39</td><td></td><td>0000H</td></tr><tr><td>*BLK</td><td>Parameter block</td><td>Pr.40</td><td></td><td>0000H~000EH</td></tr></table>

Table 2-3: Driver parameter List

# 2.4 Function Response Time

<table><tr><td>Category</td><td>Function name</td><td>Process time (ms)</td></tr><tr><td colspan="3">System Function</td></tr><tr><td rowspan="8">System Function</td><td>error_msg()</td><td>0.0133</td></tr><tr><td>MDSP_initial()</td><td>3227.5232</td></tr><tr><td>MDSP_close()</td><td>2494.1883</td></tr><tr><td>MDSP_reset()</td><td>2716.2470</td></tr><tr><td>get_base_addr()</td><td>0.0206</td></tr><tr><td>get_irq_number()</td><td>0.0205</td></tr><tr><td>understand_mdsp()</td><td>0.0261</td></tr><tr><td>get_version_info()</td><td>0.0197</td></tr><tr><td colspan="3">Motion Function</td></tr><tr><td rowspan="25">Single Motion</td><td>tv_move()</td><td>3.0834</td></tr><tr><td>sv_move()</td><td>3.0942</td></tr><tr><td>start_tr_move()</td><td>3.0813</td></tr><tr><td>start_sr_move()</td><td>3.1140</td></tr><tr><td>start_ta_move()</td><td>3.0865</td></tr><tr><td>start_sa_move()</td><td>3.1093</td></tr><tr><td>tv_move_all()</td><td>2.2246</td></tr><tr><td>sv_move_all()</td><td>2.2830</td></tr><tr><td>start_tr_move_all()</td><td>2.2505</td></tr><tr><td>start_sr_move_all()</td><td>2.4633</td></tr><tr><td>start_ta_move_all()</td><td>2.2489</td></tr><tr><td>start_sa_move_all()</td><td>2.3428</td></tr><tr><td>tv_change()</td><td>10.0539</td></tr><tr><td>sv_change()</td><td>10.0534</td></tr><tr><td>tv_stop()</td><td>9.0982</td></tr><tr><td>sv_stop()</td><td>9.0830</td></tr><tr><td>emg_stop()</td><td>4.0551</td></tr><tr><td>start_line_tr_move()</td><td>2.2537</td></tr><tr><td>start_line_sr_move()</td><td>2.5953</td></tr><tr><td>start_line_ta_move()</td><td>2.2496</td></tr><tr><td>start_line_sa_move()</td><td>2.7381</td></tr><tr><td>start_arc_tr_move()</td><td>2.1525</td></tr><tr><td>start_arc_sr_move()</td><td>2.1949</td></tr><tr><td>start_arc_ta_move()</td><td>2.1473</td></tr><tr><td>start_arc_sa_move()</td><td>2.1926</td></tr></table>

Table 2-4: Function Response Time

<table><tr><td>Category</td><td>Function name</td><td>Process time (ms)</td></tr><tr><td rowspan="2">Home move</td><td>set_home_mode()</td><td>0.0368</td></tr><tr><td>home_move()</td><td>3.1159</td></tr><tr><td rowspan="18">Continuous motion</td><td>start_motion_list()</td><td>0.0631</td></tr><tr><td>end_motion_list()</td><td>0.0046</td></tr><tr><td>repeat_last_move()</td><td>10.0228</td></tr><tr><td>add_line_tr_move()</td><td>0.0100</td></tr><tr><td>add_line_sr_move()</td><td>0.0142</td></tr><tr><td>add_line_ta_move()</td><td>0.0068</td></tr><tr><td>add_line_sa_move()</td><td>0.0167</td></tr><tr><td>add_arc_tr_move()</td><td>0.0131</td></tr><tr><td>add_arc_sr_move()</td><td>0.0156</td></tr><tr><td>add_arc_ta_move()</td><td>0.0137</td></tr><tr><td>add_arc_sa_move()</td><td>0.0162</td></tr><tr><td>add_arc2_sa_move()</td><td>0.0140</td></tr><tr><td>add_arc2_sr_move()</td><td>0.0162</td></tr><tr><td>add_arc2_ta_move()</td><td>0.0148</td></tr><tr><td>add_arc2_tr_move()</td><td>0.0167</td></tr><tr><td>add_dwell()</td><td>0.0029</td></tr><tr><td>smooth_enable()</td><td>0.0022</td></tr><tr><td>start_cont_move()</td><td>2.2824</td></tr><tr><td colspan="3">Motion Related I/O Function</td></tr><tr><td rowspan="7">Position control and feedback</td><td>get_position()</td><td>0.0316</td></tr><tr><td>set_position()</td><td>10.0323</td></tr><tr><td>get_target_pos()</td><td>0.0200</td></tr><tr><td>get_move_ratio()</td><td>0.0142</td></tr><tr><td>set_move_ratio()</td><td>10.0231</td></tr><tr><td>get_fb_position()</td><td>0.0263</td></tr><tr><td>shift_position()</td><td>10.0318</td></tr><tr><td rowspan="2">Velocity feedback</td><td>get_velocity()</td><td>5.0321</td></tr><tr><td>get_cnt_speed()</td><td>0.0214</td></tr><tr><td rowspan="4">Motion DIO status</td><td>set_PEL_config()</td><td>10.0315</td></tr><tr><td>set_MEL_config()</td><td>10.0314</td></tr><tr><td>set_ORG_config()</td><td>10.0310</td></tr><tr><td>set_EMG_config()</td><td>5.0240</td></tr></table>

Table 2-4: Function Response Time

<table><tr><td>Category</td><td>Function name</td><td>Process time (ms)</td></tr><tr><td rowspan="4">Software status</td><td>get_PEL_status()</td><td>5.0255</td></tr><tr><td>get_MEL_status()</td><td>5.0252</td></tr><tr><td>get_ORG_status()</td><td>5.0255</td></tr><tr><td>get_EMG_status()</td><td>5.0236</td></tr><tr><td rowspan="2">Software limit</td><td>set_soft_limit()</td><td>30.0463</td></tr><tr><td>get_soft_limit()</td><td>0.0275</td></tr><tr><td rowspan="3">Motion status</td><td>motion_status()</td><td>5.0158</td></tr><tr><td>axis_status()</td><td>5.0171</td></tr><tr><td>motion_done()</td><td>5.0157</td></tr><tr><td>Frame Management</td><td>frame_to_execute()</td><td>0.0130</td></tr><tr><td colspan="3">General Purpose IO</td></tr><tr><td rowspan="6">Encoder</td><td>set_cnt_iptmode()</td><td>10.0287</td></tr><tr><td>set_cnt_to_axis()</td><td>15.0337</td></tr><tr><td>set_cnt_value()</td><td>100.7444</td></tr><tr><td>get_cnt_value()</td><td>0.0227</td></tr><tr><td>set_ring_counter()</td><td>40.0771</td></tr><tr><td>get_ring_counter()</td><td>40.0827</td></tr><tr><td rowspan="4">DIO</td><td>get_di_status()</td><td>1.0248</td></tr><tr><td>set_do_value()</td><td>0.0207</td></tr><tr><td>set_di_mode()</td><td>6.0275</td></tr><tr><td>set_mio_mode()</td><td>20.0441</td></tr><tr><td rowspan="2">DA</td><td>set_da_config()</td><td>0.0199</td></tr><tr><td>set_da_value()</td><td>10.0279</td></tr><tr><td rowspan="2">AD</td><td>set_ad_function()</td><td>40.0854</td></tr><tr><td>get_ad_value()</td><td>0.0066</td></tr><tr><td rowspan="6">Analog auto calibration</td><td>tune_ref_5v()</td><td>20.0378</td></tr><tr><td>save_auto_k_value()</td><td>70.1220</td></tr><tr><td>get_auto_k_value()</td><td>40.0613</td></tr><tr><td>tune_ad_offset_gain()</td><td>40.0807</td></tr><tr><td>tune_da_offset()</td><td>50.0967</td></tr><tr><td>reload_auto_k_setting()</td><td>543.5953</td></tr><tr><td colspan="3">Driver Management Function</td></tr></table>

Table 2-4: Function Response Time

<table><tr><td>Category</td><td>Function name</td><td>Process time (ms)</td></tr><tr><td rowspan="6">Driver parameters</td><td>get_servo_para()</td><td>0.0204</td></tr><tr><td>set_servo_para()</td><td>7023.8662</td></tr><tr><td>get_servo_para_all()</td><td>0.0939</td></tr><tr><td>set_servo_para_all()</td><td>730.5785</td></tr><tr><td>save_servo_para()</td><td>849.8831</td></tr><tr><td>set_servo_para_default()</td><td>763.2503</td></tr><tr><td rowspan="6">Data monitoring</td><td>set_monitor_channel();</td><td>10.0253</td></tr><tr><td>set_monitor_config()</td><td>0.0220</td></tr><tr><td>start_monitor()</td><td>7.0285</td></tr><tr><td>check_monitor_ready()</td><td>0.0230</td></tr><tr><td>get_monitor_data()</td><td>42.8274</td></tr><tr><td>get_instant_monitor_data()</td><td>6.1094</td></tr><tr><td>Servo infomation</td><td>get_servo_info()</td><td>0.0240</td></tr><tr><td>Servo on</td><td>set_servo_on()</td><td>196.3837</td></tr><tr><td rowspan="2">Driver information</td><td>understand_driver()</td><td>0.0313</td></tr><tr><td>understand_motor()</td><td>0.0328</td></tr><tr><td rowspan="2">Alam</td><td>get_alarm_no()</td><td>1.0249</td></tr><tr><td>alarm_reset()</td><td>0.0202</td></tr><tr><td colspan="3">Control Gain Tuning</td></tr><tr><td rowspan="8">Control Gain Tuning</td><td>set_auto_tune()</td><td>739.9458</td></tr><tr><td>get_auto_tune()</td><td>0.0946</td></tr><tr><td>set_control_gain()</td><td>734.3896</td></tr><tr><td>get_control_gain()</td><td>0.0893</td></tr><tr><td>set_notch_filter()</td><td>0.0934</td></tr><tr><td>get_notch_filter()</td><td>0.0944</td></tr><tr><td>set_LP_filter()</td><td>707.6136</td></tr><tr><td>get_LP_filter()</td><td>0.0938</td></tr><tr><td colspan="3">Interrupt Control Function</td></tr><tr><td rowspan="8">Interrupt Control Function</td><td>int_control()</td><td>0.0213</td></tr><tr><td>set_int_factor()</td><td>0.0204</td></tr><tr><td>get_int_status()</td><td>0.0209</td></tr><tr><td>set_int_event()</td><td>0.0685</td></tr><tr><td>link_interrupt()</td><td>0.0112</td></tr><tr><td>set_int_event2()</td><td>4.8593</td></tr><tr><td>clear_tlc_int()</td><td>10.0313</td></tr><tr><td>set_timer_int_interval()</td><td>0.0269</td></tr><tr><td colspan="3">Position Compare Function</td></tr></table>

Table 2-4: Function Response Time

<table><tr><td>Category</td><td>Function name</td><td>Process time (ms)</td></tr><tr><td rowspan="10">Position Compare Function</td><td>set_compare()</td><td>40.0577</td></tr><tr><td>check_compare()</td><td>0.0215</td></tr><tr><td>set_compare_source()</td><td>0.0054</td></tr><tr><td>set_compare_channel()</td><td>2.0289</td></tr><tr><td>set_single_compare()</td><td>2.0190</td></tr><tr><td>map_dout_and comparator()</td><td>11.0255</td></tr><tr><td>set_compare_table_dir()</td><td>11.0236</td></tr><tr><td>link_dout_and_compare_table()</td><td>232.9729</td></tr><tr><td>set_ext_encoder_compare_method()</td><td>10.0314</td></tr><tr><td>set_ext_encoder_compare_value()</td><td>10.0316</td></tr><tr><td colspan="3">Interlock Function</td></tr><tr><td rowspan="2">Interlock Function</td><td>set_interlock()</td><td>870.6801</td></tr><tr><td>get_interlock()</td><td>0.0618</td></tr><tr><td colspan="3">Absolute Position System</td></tr><tr><td rowspan="3">Absolute Position System</td><td>get_abs_position()</td><td>21.1741</td></tr><tr><td>save_abs_position()</td><td>66.2161</td></tr><tr><td>clear_abs_data_on_flash()</td><td>782.0468</td></tr><tr><td colspan="3">Pulse Output Control</td></tr><tr><td>Pulse Output Control</td><td>set_pulse_output_control()</td><td>10.0323</td></tr><tr><td colspan="3">Sequence Motion Control</td></tr><tr><td rowspan="14">Sequence Motion Control</td><td>add_frame_ta_move()</td><td>10.0687</td></tr><tr><td>add_frame_dwell()</td><td>10.0629</td></tr><tr><td>set_pattern</td><td>10.0604</td></tr><tr><td>get_pattern</td><td>10.0652</td></tr><tr><td>insert_pattern_to_seq_buffer()</td><td>2.0334</td></tr><tr><td>check_seq_buffer()</td><td>0.0031</td></tr><tr><td>reset_seq_buffer()</td><td>10.0219</td></tr><tr><td>start_seq_move()</td><td>9.3435</td></tr><tr><td>pause_seq_move()</td><td>6.0639</td></tr><tr><td>resume_seq_move()</td><td>6.3479</td></tr><tr><td>end_seq_move()</td><td>6.0338</td></tr><tr><td>set_seq_sync_pause()</td><td>20.0417</td></tr><tr><td>check_seq_buffer_index()</td><td>0.0034</td></tr><tr><td>check_seq_buffer_empty_count()</td><td>0.0033</td></tr><tr><td colspan="3">Auto Stop Function</td></tr><tr><td>Auto Stop Function</td><td>set_pos_diff_stop()</td><td>40.0592</td></tr></table>

Table 2-4: Function Response Time

# Warranty Policy

Thank you for choosing ADLINK. To understand your rights and enjoy all the after-sales services we offer, please read the following carefully.

1. Before using ADLINK's products please read the user manual and follow the instructions exactly. When sending in damaged products for repair, please attach an RMA application form which can be downloaded from: http://rma.adlinktech.com/policy/.

2. All ADLINK products come with a two-year guarantee:

The warranty period starts from the product's shipment date from ADLINK's factory.
▶ Peripherals and third-party products not manufactured by ADLINK will be covered by the original manufacturers' warranty.
For products containing storage devices (hard drives, flash cards, etc.), please back up your data before sending them for repair. ADLINK is not responsible for loss of data.
▶ Please ensure the use of properly licensed software with our systems. ADLINK does not condone the use of pirated software and will not service systems using such software. ADLINK will not be held legally responsible for products shipped with unlicensed software installed by the user.
For general repairs, please do not include peripheral accessories. If peripherals need to be included, be certain to specify which items you sent on the RMA Request & Confirmation Form. ADLINK is not responsible for items not listed on the RMA Request & Confirmation Form.

3. Our repair service is not covered by ADLINK's two-year guarantee in the following situations:

▶ Damage caused by not following instructions in the user's manual.
▶ Damage caused by carelessness on the user's part during product transportation.
▶ Damage caused by fire, earthquakes, floods, lightening, pollution, other acts of God, and/or incorrect usage of voltage transformers.
▶ Damage caused by unsuitable storage environments (i.e. high temperatures, high humidity, or volatile chemicals).
▶ Damage caused by leakage of battery fluid during or after change of batteries by customer/user.
▶ Damage from improper repair by unauthorized technicians.
▶ Products with altered and/or damaged serial numbers are not entitled to our service.
▶ Other categories not protected under our warranty.

4. Customers are responsible for shipping costs to transport damaged products to our company or sales office.
5. To ensure the speed and quality of product repair, please download an RMA application form from our company website: http://rma.adlinktech.com/policy. Damaged products with attached RMA forms receive priority.

If you have any further questions, please email our FAE staff: service@adlinktech.com.
[🔗 Link to the original document](.sscnet-function-library-50-1h002-1020-202/sscnet-function-library-50-1h002-1020-202.pdf)
