Top Banner
3200 Series Motion Controller Programming Manual (Publication #: MNPR-1307E) Copyright © 2010-2014 Acc Motion Solutions Inc 1911 Sampson Avenue Corona, CA 92879 (951) 808-7158 www.AccMotionSolutions.com
64

MS-Tech CNC System Connection Manual - ACC MOTION …accmotionsolutions.com/virtualoffice_files/Programming Manual of... · 4 Acc-3200 series motion controllers are developed for

Mar 25, 2018

Download

Documents

phungkhanh
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: MS-Tech CNC System Connection Manual - ACC MOTION …accmotionsolutions.com/virtualoffice_files/Programming Manual of... · 4 Acc-3200 series motion controllers are developed for

3200 Series

Motion Controller

Programming Manual

(Publication #: MNPR-1307E)

Copyright © 2010-2014

Acc Motion Solutions Inc 1911 Sampson Avenue

Corona, CA 92879 (951) 808-7158

www.AccMotionSolutions.com

Page 2: MS-Tech CNC System Connection Manual - ACC MOTION …accmotionsolutions.com/virtualoffice_files/Programming Manual of... · 4 Acc-3200 series motion controllers are developed for

2

Safety Notice

Safety is always an important issue in every industry. Please read this manual carefully and make

sure you understand, before you start system integration. Improper connection or installation may

involve potential risks of personal injury or equipment damage. Therefore, adequate installation

and operation safeguard measures must be provided by the system integrator to minimize the

inherent procedural hazards.

Disclaimer

Acc Motion Solutions Inc (Acc Motion) assumes no liability for using Acc Motion products or

application assistance. Acc Motion believes that the information in the manual is correct, but

cannot be guaranteed. Acc Motion reserves the right to change without notice.

Copyright Statement

No part of this manual may be duplicated or reproduced without a written permit from Acc

Motion Solutions Inc. Information presented in the manual is protected by copyright law of US

and international treaties.

Page 3: MS-Tech CNC System Connection Manual - ACC MOTION …accmotionsolutions.com/virtualoffice_files/Programming Manual of... · 4 Acc-3200 series motion controllers are developed for

3

Table of Contents

Chapter 1 Command List ................................................................................................................. 4

Chapter 2 Command Descriptions .................................................................................................. 9

Page 4: MS-Tech CNC System Connection Manual - ACC MOTION …accmotionsolutions.com/virtualoffice_files/Programming Manual of... · 4 Acc-3200 series motion controllers are developed for

4

Acc-3200 series motion controllers are developed for a variety of motion control applications, and

have been used in many areas, including CNC machines, process control, robots, etc. This manual

presents the details of the commands for programming the motion controllers.

Chapter 1 Command List

The following is a summary of the commands for Acc-3200 series motion controllers.

Command Summary

System Configuration

LoadConfig Download the configuration files into motion controller AlarmOff Disable the drive alarm AlarmOn Enable the drive alarm LmtsOn Enable the limit LmtsOff Disable the limit ProfileScale Set the profile scale of axis EncScale Set the encoder scale of axis StepDir Set step to be "pulse+direction" mode StepPulse Set step to be "CW/CCW" mode SetMtrBias Set the zero compensation value of dac GetMtrBias Get the zero compensation value of dac SetMtrLmt Set dac saturation limit GetMtrLmt Get dac saturation limit EncSns Set encoder count direction EncOn Switch to "outside encoder" count mode EncOff Switch to "pulse output of step" count mode SetPosErr Set following error limit GetPosErr Get following error limit SetStopDec Set smooth stop decelerability and emergency stop decelerability GetStopDec Get smooth stop decelerability and emergency stop decelerability LmtSns Specify the effective electrical lever for limit switch CtrlMode Set the output mode of specified axis as analog voltage output or pulse

output SetStopIo Set the input mode of smooth stop and emergency stop GpiSns Specify the effective electrical lever for digital input SetAdcFilter Set the filter time parameter of adc input(for GTS-400-PX only)

Motion Status

GetSts Get the status of specified axis ClrSts Clear the bit of drive alarm, following limit alarm, and position limit alarm

1. Clear the bit of drive alarm, only when the alarm of drive is not been triggered 2. Clear the bit of tracking error alarm, only when tracking error is less than tracking error limit. 3. Clear the bit of position limit alarm in axis status register only when the axis has left the limit switch or profile position of the axis is in soft limit bound

GetPrfMode Get motion mode of specified profile

Page 5: MS-Tech CNC System Connection Manual - ACC MOTION …accmotionsolutions.com/virtualoffice_files/Programming Manual of... · 4 Acc-3200 series motion controllers are developed for

5

GetPrfPos Get profile position of specified profile GetPrfVel Get profile velocity of specified profile GetPrfAcc Get profile acceleration of specified profile GetAxisPrfPos Get transformed profile position of specified axis GetAxisPrfVel Get transformed profile velocity of specified axis GetAxisPrfAcc Get transformed profile acceleration of specified axis GetAxisEncPos Get transformed encoder position of specified axis GetAxisEncVel Get transformed encoder velocity of specified axis GetAxisEncAcc Get transformed encoder acceleration of specified axis GetAxisError Get the difference between transformed profile position and transformed

encoder position Stop Stop one or more axe’s profile motion, or stop the interpolation motion

Point-to-Point Motion Commands

PrfTrap Set specified axis as Point to Point motion mode SetTrapPrm Set parameters of Point to Point motion mode GetTrapPrm Get parameters of Point to Point motion mode

SetPos Set target position GetPos Get target position SetVel Set target velocity GetVel Get target velocity Update Start motion of Point to Point mode

Jog Motion Commands

PrfJog Set specified axis as Jog mode SetJogPrm Set parameters of Jog mode GetJogPrm Get parameters of Jog mode SetVel Set target velocity, unit: pulse/ms GetVel Get target velocity, unit: pulse/ms Update Start motion of Jog mode

P-T Motion Commands

PrfPt Set specified axis as PT mode PtSpace Get the free space of FIFO PtData Add data to FIFO PtClear Empty FIFO data

This command is invalid when the axis is motion or the FIFO memory is in dynamic mode.

SetPtLoop Set the cycle numbers. This command is invalid, when the FIFO memory is in dynamic mode.

GetPtLoop Get the cycle numbers This command is invalid, when the FIFO memory is in dynamic mode.

PtStart Start PT mode motion SetPtMemory Set FIFO memory GetPtMemory Get FIFO memory

Gear Command

PrfGear Set specified axis as Electronic gear mode SetGearMaster Set master axis GetGearMaster Get the information about the master axis SetGearRatio Set the electronic gear ratio GetGearRatio Get the electronic gear ratio GearStart Start Electronic gear mode motion

Following Motion Commands

PrfFollow Set specified axis as following mode SetFollowMaster Set master axis GetFollowMaster Get the information of master axis

Page 6: MS-Tech CNC System Connection Manual - ACC MOTION …accmotionsolutions.com/virtualoffice_files/Programming Manual of... · 4 Acc-3200 series motion controllers are developed for

6

SetFollowLoop Set cycle numbers GetFollowLoop Get the cycle numbers SetFollowEvent Set start condition GetFollowEvent Get the start condition FollowSpace Get the free space of FIFO FollowData Add data to FIFO FollowClear Empty FIFO data

When the axis is in motion, this command is invalid FollowStart Start Following mode motion FollowSwitch Switch FIFO from one to another SetFollowMemory Set memory space GetFollowMemory Get memory space

Coordinate Motion Commands

SetCrdPrm Set parameters of the coordinate system GetCrdPrm Get parameters of the coordinate system CrdData Add Crd data to FIFO

LnXY Buffer command,two-dimensional linear interpolation LnXYZ Buffer command,three-dimensional linear interpolation LnXYZA Buffer command,four-dimensional linear interpolation LnXYG0 Buffer command,two-dimensional linear interpolation with symmetry

profile of velocity planning LnXYZG0 Buffer command,three-dimensional linear interpolation with symmetry

profile of velocity planning LnXYZAG0 Buffer command,four-dimensional linear interpolation with symmetry

profile of velocity planning ArcXYR Buffer command,Circular interpolation in XY plane described with end

point position and radius ArcXYC Buffer command,Circular interpolation in XY plane described with end

point position and circle center position ArcYZR Buffer command,Circular interpolation in YZ plane described with end

point position and radius ArcYZC Buffer command,Circular interpolation in YZ plane described with end

point position and circle center position ArcZXR Buffer command,Circular interpolation in ZX plane described with end

point position and radius ArcZXC Buffer command,Circular interpolation in ZX plane described with end

point position and circle center position BufIO Buffer command, set digital output value BufDelay Buffer command, set buffer delay time BufDA Buffer command, coordinate buffer DA output BufLmtsOn Buffer command,enable limit function in coordinate buffer BufLmtsOff Buffer command,disable limit function in coordinate buffer BufSetStopIo Buffer command,set stop IO information of axis in coordinate buffer BufMove Buffer command, realize the Cutter direction following function. Start

some axis’s point to point move. BufGear Buffer command, realize the Cutter direction following function. Start

some axis’s following move. CrdSpace Get the free space of the FIFO CrdClear Empty Crd data in the FIFO CrdStart Start Crd motion CrdStatus Get the status of coordinate system SetUserSegNum Buffer command, set the user defined segment number. GetUserSegNum Get the user defined segment number. GetRemainderSegNum Get the number of unfinished segments. SetOverride Set the programming resultant velocity

Page 7: MS-Tech CNC System Connection Manual - ACC MOTION …accmotionsolutions.com/virtualoffice_files/Programming Manual of... · 4 Acc-3200 series motion controllers are developed for

7

SetCrdStopDec Set the resultant acceleration of smooth stop and emergency stop GetCrdStopDec Get the resultant acceleration of smooth stop and emergency stop GetCrdPos Get the specified coordinate of the coordinate system GetCrdVel Get the resultant velocity of the coordinate system InitLookAhead Initialize the FIFO of look-ahead

PVT Motion Commands

PrfPvt Set the axis as PVT mode SetPvtLoop Set the number of loops GetPvtLoop Get the number of loops PvtTable Transfer data to the table in PVT description mode PvtTableComplete Transfer data to the table in Complete description mode PvtTablePercent Transfer data to the table in Percent description mode PvtPercentCalculate Calculate the velocity in Percent description mode PvtTableContinuous Transfer data to the table in Continuous description mode PvtContinuousCalculate Calculate the time in Continuous description mode PvtTableSelect Select the table

PvtStart Start Pvt motion PvtStatus Read status

Hardware I/O Commands

GetDi Get digital input status GetDiRaw Get the original digital input status GetDiReverseCount Get reverse times of digital input SetDiReverseCount Set initial value of digital input reverse times SetDo Set digital output status SetDoBit Set digital output status by bit SetDoBitReverse Output pulse signal at the general output pin GetDo Get digital output status GetEncPos Get encoder position. GetEncVel Get encoder velocity. SetEncPos Set the position of encoder. SetDac Set output voltage of dac. GetDac Get output voltage of dac. GetAdc Get input voltage of adc. GetAdcValue Get input digital value of adc.

Capture Commmands

SetCaptureMode Set encoder capture mode, and start capture. GetCaptureMode Get encoder capture mode. GetCaptureStatus Get encoder capture status. SetCaptureSense Set sense value of encoder capture. ClearCaptureStatus Clear the capture status. SetCaptureRepeat Set repeat capture SetCaptureRepeatStatus Get repeat capture status

SetCaptureRepeatPos Get repeat capture position

Limit Protection Commands

SetSoftLimit Set soft limit GetSoftLimit Get soft limit

Thread Motion Commands

Download Download motion program to controller core. GetFunId Read function ID of motion program. GetVarId Read variable ID of motion program. Bind Binding thread, function and data page RunThread Start a thread

Page 8: MS-Tech CNC System Connection Manual - ACC MOTION …accmotionsolutions.com/virtualoffice_files/Programming Manual of... · 4 Acc-3200 series motion controllers are developed for

8

StopThread Stop the running thread PauseThread Pause the running thread GetThreadSts Read thread status SetVarValue Set the variable value of motion program GetVarValue Get the variable value of motion program

Home Commands

HomeInit Initialize the automatic zero point searhcing function. Home Start searching for zero point. Index Search zero point in home+index mode. HomeStop Search for zero point, and then stop at that position. HomeSts Get the running status ofAutomatic homing.

PID Parameter Commands

SetControlFilter Set the index of PID parameters. Maximum value of index is 3.

GetControlFilter Get the index of PID parameters

SetPid Set the parameters of PID. GetPid Get the parameters of PID.

Compensation Commands

SetBacklash Set the relative parameters of backlash compensation. GetBacklash Get the relative parameters of backlash compensation.

Comparison Commands

ComparePulse Output pulse or level at HSIO. CompareData Set parameters of comparison and start compare output of position. CompareStatus Check status of position comparison CompareStop Stop comparison of position output. CompareLinear Set repeated linear position comparing output

Axis On/Off Commands

AxisOn Enable the servo motor. AxisOff Disable the servo motor

Other Commands

Open Open motion controller Close Close motion controller SetCardNo Switch to one card by number GetCardNo Get specified card number Reset Reset motion controller GetVision Get the firmware version of motion controller. GetClock Get the internal clock of motion controller. GetClockHighPrecision Get the high precision value of internal clock of motion controller. SetPrfPos Modify the profile position SynchAxisPos Synchronize synthetic profile position with related profile manager

Synchronize synthetic encoder position with related encoder manager ZeroPos Set profile position and encoder position as zero, and zero drift

compensation. SetAxisBand Set arrival error band

When the error between profile position and encoder position larger than set band, and the profile will be stopped, the arrival bit of motor will be set as 1.

GetAxisBand Get arrival error band

Page 9: MS-Tech CNC System Connection Manual - ACC MOTION …accmotionsolutions.com/virtualoffice_files/Programming Manual of... · 4 Acc-3200 series motion controllers are developed for

9

Chapter 2 Command Descriptions

This chapter describes all the motion control related commands in alphabetical order.

short AlarmOff(short axis)

Function Disable alarm input of the specific axis Execution Executed immediately Parameters axis: 1 to 8 Return value 0: success; 1: setting is invalid. Also refer to Related commands AlarmOn()

short AlarmON(short axis)

Function Enable alarm input of the specific axis Execution Executed immediately Parameters axis: 1 to 8 Return value 0: success; 1: setting is invalid. Also refer to Related commands AlarmOff()

short ArcXYC (short crd, long x, long y, double xc, double yc, short dir, double vel, double acc, double velEnd=0, short fifo=0)

Function Circular interpolation in XY plane

Type Buffered Parameters crd: coordinate specification, valid range [1,2]

x, y: end position of x & y axes in pulses xc, yc: center position dir: 1=cw, -1=ccw vel: velocity of crd segment acc: acceleration of the crd segment velEnd: end velocity fifo: buffer selecton, valid range [0, 1]

Return value 0: success; 1: setting is invalid. Also refer to Related commands

short ArcXYR (short crd, long x, long y, double radius, short circleDir, double Vel, double Acc, double velEnd=0, short fifo=0)

Function Circular interpolation in XY plane

Type Buffered

Parameters crd: coordinate specification, valid range [1,2] x, y: end position of x & y axes in pulses radius: radius of the arc segment, radius>0:the arc segment<=180˚;radius<0,the arc segment>180˚ Arc dir: 1=cw, -1=ccw vel: velocity of crd segment acc: acceleration of the crd segment velEnd: end velocity fifo: buffer selecton, valid range [0, 1]

Return value 0: success; 1: setting is invalid. Also refer to

Page 10: MS-Tech CNC System Connection Manual - ACC MOTION …accmotionsolutions.com/virtualoffice_files/Programming Manual of... · 4 Acc-3200 series motion controllers are developed for

10

short ArcYZC (short crd, long y, long z, double yc, double zc, short dir, double vel, double acc, double velEnd=0, short fifo=0)

Function Circular interpolation in YZ plane

Type Buffered Parameters crd: coordinate specification, valid range [1,2]

y, z: end position of y & z axes in pulses yc, zc: center position dir: 1=cw, -1=ccw vel: velocity of crd segment acc: acceleration of the crd segment velEnd: end velocity fifo: buffer selecton, valid range [0, 1]

Return value 0: success; 1: setting is invalid. Also refer to Related commands

short ArcYZR (short crd, long y, long z, double radius, short circleDir, double Vel, double Acc, double velEnd=0, short fifo=0)

Function Circular interpolation in YZ plane

Type Buffered Parameters crd: coordinate specification, valid range [1,2]

x, y: end position of x & y axes in pulses radius: radius of the arc segment, radius>0:the arc segment<=180˚;radius<0,the arc segment>180˚ Arc dir: 1=cw, -1=ccw vel: velocity of crd segment acc: acceleration of the crd segment velEnd: end velocity fifo: buffer selecton, valid range [0, 1]

Return value 0: success; 1: setting is invalid. Also refer to Related commands

short ArcZXC (short crd, long z, long x, double zc, double xc, short dir, double vel, double acc, double velEnd=0, short fifo=0)

Function Circular interpolation in ZX plane

Type Buffered Parameters crd: coordinate specification, valid range [1,2]

z, x: end position of z & x axes in pulses zc, xc: center position dir: 1=cw, -1=ccw vel: velocity of crd segment acc: acceleration of the crd segment velEnd: end velocity fifo: buffer selecton, valid range [0, 1]

Return value 0: success; 1: setting is invalid. Also refer to Related commands

short ArcZXR (short crd, long z, long x, double radius, short circleDir, double Vel,

Page 11: MS-Tech CNC System Connection Manual - ACC MOTION …accmotionsolutions.com/virtualoffice_files/Programming Manual of... · 4 Acc-3200 series motion controllers are developed for

11

double Acc, double velEnd=0, short fifo=0)

Function Circular interpolation in ZX plane

Type Buffered Parameters crd: coordinate specification, valid range [1,2]

z, x: end position of z & x axes in pulses radius: radius of the arc segment, radius>0:the arc segment<=180˚;radius<0,the arc segment>180˚ Arc dir: 1=cw, -1=ccw vel: velocity of crd segment acc: acceleration of the crd segment velEnd: end velocity fifo: buffer selecton, valid range [0, 1]

Return value 0: success; 1: setting is invalid. Also refer to Related commands

short AxisOff(short axis)

Function Disable the servo motor Execution Executed immediately Parameters axis: 1 to 8 Return value 0: success; 1: setting is invalid. Also refer to Related commands AxisOn()

short AxisON(short axis)

Function Enable the servo motor Execution Executed immediately Parameters axis: 1 to 8 Return value 0: success; 1: setting is invalid. Also refer to Related commands AlarmOff()

short Bind(short thread, short funid, short page)

Function Binding thread, function and data page Execution Executed immediately Parameters thread: 0 to 31

function id: which can be checked using GetFunId Page: data page id, and its value in 0 to 31

Return value 0: success; 1: check whether the thread is already bound and running. Also refer to

Related commands

short BufDA(short crd, short chn, short devalue, short fifo=0)

Function Coordination buffer DA output Type Buffer Parameters crd: coordinate system ID, from 1 to 2

chn: DA channel Ni., from 1 to 8 devalue: DA output value, from -32768 to 32768, and the corresponding voltage from -10V ~ +10V fifo: FIFO ID, from 0 to 1. Default is 0

Return value 0: success;

Page 12: MS-Tech CNC System Connection Manual - ACC MOTION …accmotionsolutions.com/virtualoffice_files/Programming Manual of... · 4 Acc-3200 series motion controllers are developed for

12

1: Check whether current coordinate system is mapping to an axis; Check whether controller transfer data to fifo 1. If so, check whether fifo 0 is use and in motion, if in motion, return error; Check whether fifo is full Also refer to

Related commands

short BufDelay(short crd, unbsigned short delayTime, short fifo)

Function Set buffer delay time Type Buffer Parameters crd: coordinate system ID, from 1 to 2

delayTime: delay time of the delay operation, from 0 to 16383, unit:ms fifo: FIFO ID, from 0 to 1. Default is 0

Return value 0: success; 1: Check whether current coordinate system is mapping to an axis; Check whether controller transfer data to fifo 1. If so, check whether fifo 0 is use and in motion, if in motion, return error; Check whether fifo is full Also refer to

Related commands

short BufGear(short crd, short gearAxis, long pos, short fifo=0)

Function Realize the Cutter direction following function. Start some axis’s following motion

Type Buffer Parameters crd: coordinate system ID, from 1 to 2

gearAxis: Axis ID, from 1 to 8, this axis cannot be anyone of the coordinate axes pos: The displacement of follow movement. Unit: pulse fifo: FIFO ID, from 0 to 1. Default is 0

Return value 0: success; 1: Check whether current coordinate system is mapping to an axis; Check whether controller transfer data to fifo 1. If so, check whether fifo 0 is use and in motion, if in motion, return error; Check whether fifo is full Also refer to

Related commands

short BufIO(short crd, unsigned short doType, unsigned short doMask, unsigned short doValue, short fifo=0)

Function Set digital output value Type Buffer Parameters crd: coordinate system ID, from 1 to 2

doType: MC_ENABLE: output drive enable MC_CLEAR: output drive alarm clear MC_GPO: general purpose I/O doMask: bit0~bit15 indicate whether there are digital output operation in the corresponding channel. 0:no; 1:yes doValue: bit0~bit15 are the digital output value of the corresponding channel

Page 13: MS-Tech CNC System Connection Manual - ACC MOTION …accmotionsolutions.com/virtualoffice_files/Programming Manual of... · 4 Acc-3200 series motion controllers are developed for

13

fifo: FIFO ID, from 0 to 1. Default is 0 Return value 0: success;

1: Check whether current coordinate system is mapping to an axis; Check whether controller transfer data to fifo 1. If so, check whether fifo 0 is use and in motion, if in motion, return error; Check whether fifo is full Also refer to

Related commands

short BufLmtsOff(short crd, short axis, short limitType, short fifo=0)

Function Disable limit function in coordinate buffer Type Buffer Parameters crd: coordinate system ID, from 1 to 2

axis: axis No. of which limit be disabled, from 1 to 8 limitType: MC_LIMIT_POSITIVE: disable the positive limit of axis MC_LIMIT_NEGATIVE:disable the negative limit of axis -1: default value. Disable both of positive and negative limit fifo: FIFO ID, from 0 to 1. Default is 0

Return value 0: success; 1: Check whether current coordinate system is mapping to an axis; Check whether controller transfer data to fifo 1. If so, check whether fifo 0 is use and in motion, if in motion, return error; Check whether fifo is full Also refer to

Related commands BufLmtsOn

short BufLmtsOn(short crd, short axis, short limitType, short fifo=0)

Function Enable limit function in coordinate buffer Type Buffer Parameters crd: coordinate system ID, from 1 to 2

axis: axis No. of which limit be disabled, from 1 to 8 limitType: MC_LIMIT_POSITIVE: disable the positive limit of axis MC_LIMIT_NEGATIVE:disable the negative limit of axis -1: default value. Disable both of positive and negative limit fifo: FIFO ID, from 0 to 1. Default is 0

Return value 0: success; 1: Check whether current coordinate system is mapping to an axis; Check whether controller transfer data to fifo 1. If so, check whether fifo 0 is use and in motion, if in motion, return error; Check whether fifo is full Also refer to

Related commands BufLmtsOff

short BufMove(short crd, short moveAxis, long pos, double vel, double sacc, short modal, short fifo=0)

Function Realize the Cutter direction following function. Start some axis’s point to point move

Type Buffer Parameters crd: coordinate system ID, from 1 to 2

moveAxis: axis ID from 1 to 8

Page 14: MS-Tech CNC System Connection Manual - ACC MOTION …accmotionsolutions.com/virtualoffice_files/Programming Manual of... · 4 Acc-3200 series motion controllers are developed for

14

pos: target position of point to point movement, unit: pulse vel: target velocity ofn point to point movement, unit:pulse/ms acc: acceleration of point to point movement, unit:pulse/(ms*ms) modal: command mode:0: is noit modal; 1: is modal fifo: FIFO ID, from 0 to 1. Default is 0

Return value 0: success; 1: Check whether current coordinate system is mapping to an axis; Check whether controller transfer data to fifo 1. If so, check whether fifo 0 is use and in motion, if in motion, return error; Check whether fifo is full Also refer to

Related commands

short BufSetStopio(short crd, short axis, short stopType, short inputType, short inputIndex, short fifo=0)

Function Set stop IO information of axis in coordinate buffer Type Buffer Parameters crd: coordinate system ID, from 1 to 2

axis axis No. from 1 to 8 stopType: 0:emergency stop; 1: smooth stop inputType: MC_LIMIT_POSITIVE: positive limit MC_LIMIT_MEGATIVE: megative limit MC_ALARM: drive alarm MC_HOME: home MC_GPI: general input MC_ARRIVE: motor arrive signal InoutIndex: digital input index, range according to type of digital input inputType=MC_LIMIT_POSITIVE; from 1 to 8 inputType=MC_LIMIT_NEGATIVE; from 1 to 8 inputType=MC_LIMIT_ALARM; from 1 to 8 inputType=MC_LIMIT_HOME; from 1 to 8 inputType=MC_LIMIT_GPI; from 1 to 16 inputType=MC_LIMIT_ARRIVE; from 1 to 8 fifo: FIFO ID, from 0 to 1. Default is 0

Return value 0: success; 1: Check whether current coordinate system is mapping to an axis; Check whether controller transfer data to fifo 1. If so, check whether fifo 0 is use and in motion, if in motion, return error; Check whether fifo is full Also refer to

Related commands

short ClearCaptureStatus(short encoder)

Function Clear the capture status Execution Executed immediately Parameters encoder: encoder No. positive integer Return value Also refer to Related commands

short Close()

Page 15: MS-Tech CNC System Connection Manual - ACC MOTION …accmotionsolutions.com/virtualoffice_files/Programming Manual of... · 4 Acc-3200 series motion controllers are developed for

15

Function Close the motion controller Execution Executed immediately Parameters Return value Also refer to Related commands

short ClrSts(short axis, short count=1)

Function Clear the bit of drive alarm, following limit alarm, and position limit alarm 1. Clear the bit of drive alarm, only when the alarm of drive is not been

triggered. 2. Clear the bit of tracking error alarm only when tracking error is less

than tracking limit. 3. Clear bit of position limit alarm in axis status register only when the

axis has left the limit switch or profile position of the axis is in soft limit bound.

Execution Executed immediately Parameters Axis: axis No.

Count: number of axes need to be clear Return value Also refer to Related commands

short CompareData(short encoder, short source, short pulseType, short startLevel, short time, long *pBuf1, short count1, long *pBug2, short count2)

Function Set parameter of position comparing output and start Execution Executed immediately Parameters encoder: axis No. whose encoder need to set position comparing

output source: data source of position compare:0:pulse counter; 1: encoder pulseType: output mode of HSIO. 0:impulse output; 1: level output startLevel: Set initial level of HSIO output by bit. Bit1 corresponds to channel 1, bit1 corresponds to 2; 0:initial level is low level; 1:initial level is high level; If pulse type is 1, it is suggested to set the parameter as 0 time: when pulse type is 0, this parameter is the pulse width,from 1 to 65535 unit:us; when pulse type is 1, invalid. pBuf1: buffer of position comparing output for HSIO1, the position value is the relative distance of the current position, it must be a monotomic increasing sequence of positive numbers or a monotonic decreasing sequence of negative numbers count1: data length of pBuf1,maximum value is 4096 pBuf2: Buffer of position comparing output for HSIO2, the position value is the relative distance of the current position; it must be a monotonic increasing sequence of positive numbers or a monotonic decreasing sequence of negative numbers. And monotonicity of pBuf1 and pBuf2 must be the same., Count2: data length of pBuf2, maximum value is 4096

Return value Return 7: check whether the sequence is a increasing sequence of positive numbers or a decreasing sequence of negative numbers. Others: Please refer to summary of return values

Related commands

Page 16: MS-Tech CNC System Connection Manual - ACC MOTION …accmotionsolutions.com/virtualoffice_files/Programming Manual of... · 4 Acc-3200 series motion controllers are developed for

16

short CompareLinear(short encoder, long startPos, long repeartTimes, short interval, short time, short source)

Function Set repeated and evenly position comparing output Execution Executed immediately Parameters encoder: encoder No.

channel: Channel for position comparing output from 1 to 2 startPos: Start position of compare output, unit:pulse repeatTimes: Repeat times of compare output interval: Interval of output, unit: pulse. Its Sign is requested to coincide with startPos,and can not be 0 time: pulse width,unit:ms; from 1 to 65535 source: Data source; 0: internal pulse counter; 1: external encoder.

Return value Return 7: 1. Check whether the sign of startPos and interval is the same. 2. Check whether value of interval is 0.

Others: Please refer to summary of return values.

Related commands

short ComparePulse(short level, short pulseType, short time)

Function Output pulse or level at HSIO Execution Executed immediately Parameters level: If pulseType is 0, the parameter set whether HSIO output

pulse by bit Bit0 corresponds to channel 1, bit1 cooresponds to channel2; 0: not output pulse 1: output pulse. If pulseType is 1 , the parameter set output level of HSIO by bit Bit0 corresponds to channel 1, bit1 corresponds to channel2; 0: output low level 1: output high level. pulseType: Output mode of HSIO 0: output pulse, pulse width depends on “time” 1: output level. Time: If pulseType is 0, the parameter can set pulse width, its value ranging in[1,65535], unit :us If pulseType is 1, the parameter is invalid

Return value Return 1: Check whether position compare output is started, if position comparing output is on run, HSIO cannot output level or pulse Others: Please refer to summary of return values

Related commands

short CompareStatus(short pStatus,unsigned short *pCount)

Function Get the status of position compare Execution Executed immediately

Page 17: MS-Tech CNC System Connection Manual - ACC MOTION …accmotionsolutions.com/virtualoffice_files/Programming Manual of... · 4 Acc-3200 series motion controllers are developed for

17

Parameters Status: Whether position compare is end. 1: end 0: on comparing pCount: Get the number of outputted rising edges from HSIO, the length of pCount must be 2. If GT_CompareData() is called, i.e. in level output mode, the returned pCount [0] and pCount [1] are the number of the outputted rising edges from Channel 1 and Channel 2, but the number aren't equal to the number of positions that is completed(in level output mode, the number of completed positions compared is a sum of output rising edge and output falling edge); In pulse output mode, the returned pCount [0] and pCount [1] are the number of the outputted rising edges from Channel 1 and Channel 2, which are equal to number of positions compared

Return value Others: Please refer to summary of return values

Related commands

short CompareStop()

Function Stop position comparing output Execution Executed immediately Parameters Return value Others: Please refer to summary of return values.

Related commands

short CrdClear(short crd, short fifo)

Function Clear crd data in the FIFO Execution Executed immediately Parameters Crd: Coordinate system ID, from 1 to 2

Fifo: FIFO ID to be cleard, from 1 to 2 Return value Return 1

1. Check whether current coordinate system is mapped with

correspondent axes.

2. Check whether data is transferred to fifo1. If so, check whether

fifo0 is used and in motion, if in motion, return error. Others: Please refer to summary of return values.

Related commands

short CrdData(short crd, short fifo)

Function Used in lookahead.If there is not follow-up data,calling GT_CrdData() will push the data in look-ahead buffer to motion buffer at one time.

Execution Executed immediately Parameters Crd: Coordinate system ID, from 1 to 2

Fifo: FIFO ID to be cleard, from 1 to 2 Return value If returned value is not 0, that means there is data in the look-ahead buffer

have not been transferred to motion buffer because of there is not enough space in motion buffer. User should check the free space by calling GT_CrdSpace(). When there is space in motion buffer, call GT_CrdSpace()

Page 18: MS-Tech CNC System Connection Manual - ACC MOTION …accmotionsolutions.com/virtualoffice_files/Programming Manual of... · 4 Acc-3200 series motion controllers are developed for

18

again, until the return value is 0, which means data in look-ahead buffer is transferred to motion buffer totally.

Related commands

short CrdSpace(short crd, long *pSpace, short fifo=0)

Function Get the free space of the FIFO Execution Executed immediately Parameters Crd: Coordinate system ID, from 1 to 2

pSpace: Query free space of the FIFO Fifo: FIFO ID to be cleared, from 1 to 2

Return value Return 1:Check whether coordinate system is mapped to a axis Others: Please refer to summary of return values.

Related commands

short CrdStart(short mask, short option)

Function Start Crd motion Execution Executed immediately Parameters Mask: bit0~bit1 indicate the coordinate systems to be started.

bit0 corresponds to coordinate system 1, and bit1 corresponds to coordinate system 2. 0: do not start; 1: start. Fifo: FIFO ID to be

cleared, from 1 to 2

Option: bit0~bit1 indicate the FIFO number to be started in the corresponding coordinate system. bit0 corresponds to coordinate system 1, and bit1 corresponds to coordinate system 2. 0: start FIFO0; 1: start FIFO1

Return value Return 1: (1) Check whether the current coordinate system is mapped with axes (2) If motion used auxiliary fifo1, check whether position of current coordinate system resume to break point before start fifo1; (3) Check whether coordinate system has been started (4) Check whether coordinate system is in motion.

Related commands

short CrdStatus(short mask, short option)

Function Get the status of coordinate system Execution Executed immediately Parameters mask: bit0~bit1 indicate the coordinate systems to be started. bit0

corresponds to coordinate system 1, and bit1 corresponds to coordinate system 2. 0: do not start; 1: start option: bit0~bit1 indicate the FIFO number to be started in the corresponding coordinate

Return value Return 1:Check whether coordinate system is mapped to a axis Others: Please refer to summary of return values.

Related commands

short CtrlMode(short axis, short mode)

Function Set the output mode of specified axis as analog voltage output or pulse output

Page 19: MS-Tech CNC System Connection Manual - ACC MOTION …accmotionsolutions.com/virtualoffice_files/Programming Manual of... · 4 Acc-3200 series motion controllers are developed for

19

Execution Executed immediately Parameters axis: Axis No. Positive integer

mode: Output mode 0: analog voltage output mode; 1: pulse output mode

Return value Please refer to summary of return values. Related commands

short Download(char *pFileName)

Function Download motion program to controller core. Remark: Threads in motion must less than 32

Execution Executed immediately Parameters pFileName: The file name downloaded into motion controller core

Return value Return 2007: (1) Check whether the length of file name is too long; (2) Check whether the file need to be downloaded exist;

Return 2008. (1) Check whether the file is destoried and the compilation is successful; (2) Check whether .ini file and .bin file are in the same folder. Return 7: Check Whether number of thread is more than 32.

Others: Please refer to summary of return values Related commands

short EncOff(short encoder)

Function Switch to "pulse count" encoder mode Execution Executed immediately Parameters encoder: encoder No. Positive integer

Return value Please refer to summary of return values. Related commands EncOn

short EncOn(short encoder)

Function Switch to "encoder" encoder mode Execution Executed immediately Parameters encoder: encoder No. Positive integer

Return value Please refer to summary of return values. Related commands EncOff

short EncScale(short axis, short alpha, short beta)

Function Set the encoder scale of axis Execution Executed immediately Parameters axis: Axis No. Positive integer

alpha: Alpha value of encoder scale,from -32768 to 32767 beta: Beta value of encoder scale from -32768 to 32768

Return value Retrun 1: if current axis is runing, please call GT_Stop() to stop the axis motion before calling this command. Please refer to summary of return values.

Related commands ProfileScale

Page 20: MS-Tech CNC System Connection Manual - ACC MOTION …accmotionsolutions.com/virtualoffice_files/Programming Manual of... · 4 Acc-3200 series motion controllers are developed for

20

short EncSns(unsigned short sense)

Function Set encoder count direction Execution Executed immediately Parameters sense: Set encoder count direction by bit

0: not reverse this encoder count’s direction 1: reverse this encoder count’s direction

Return value Please refer to summary of return values. Related commands

short FollowClear(short profile, short fifo)

Function Clear FIFO data. If the axis is in motion, this command is invalid

Execution Executed immediately

Parameters profile: Profile No. Positive integer fifo: FIFO which will be cleared , from 0 to 1. The default value is 0.

Return value Return 1: (1) Check whether current axis is in Following mode, if not, call GT_PrfFollow to set axis as Following mode; (2) Check whether FIFO to be cleared up is being used, whether axis is in motion. Others: Please refer to summary of return values.

Related commands

short FollowData(short profile, lopng masterSegment, double slaveSegment, short type, short fifo=0)

Function Add data to Follow motion fifo

Execution Executed immediately Parameters profile: Profile No. Positive integer

masterSegment: Displacement of master axis. Unit: pulse. slaveSegment: Displacement of slave axis. Unit: pulse. Type: Type of segments. “FOLLOW_SEGMENT_NORMAL” means the segments is a “normal” type segment. The default value of “type” is FOLLOW_SEGMENT_NORMAL “FOLLOW_SEGMENT_EVEN” means the segments is an “even” type segment. “FOLLOW_SEGMENT_STOP” means the segments is a “stop” type segment “FOLLOW_SEGMENT_CONTINUE” means the velocity between segments will be continuous fifo: FIFO which will be cleared , from 0 to 1. The default value is 0.

Return value Return 1: (1) Check whether current axis is in Following mode, if not, call GT_PrfFollow to set axis as Following mode; (2) Check whether FIFO to be cleared up is being used, whether axis is in motion. Others: Please refer to summary of return values.

Related commands

Page 21: MS-Tech CNC System Connection Manual - ACC MOTION …accmotionsolutions.com/virtualoffice_files/Programming Manual of... · 4 Acc-3200 series motion controllers are developed for

21

short FollowSpace(short profile, short *pSpace, short fifo)

Function Get the free space of FIFO

Execution Executed immediately Parameters profile: Profile No. Positive integer

pSpace: The returned free space of FIFO memory fifo: FIFO which will be cleared , from 0 to 1. The default value is 0.

Return value Return 1: (1) Check whether current axis is in Following mode, if not, call

GT_PrfFollow to set axis as Following mode; Others: Please refer to summary of return values.

Related commands

short FollowStart(long mask, long option)

Function Start Following mode motion

Execution Executed immediately Parameters mask: No. of axis which will be started in Following mode by bit. The bit is 1

means the controller will start corresponding axis option: the FIFO memory which will be used by bit, default value is 0. When bit X=0, it means that the corresponding axis use FIFO1.When bit X=1, it means that the corresponding axis use FIFO2

Return value Return 1: (1) Check whether current axis is in Following mode, if not, call GT_PrfFollow to set axis as Following mode; (2) Check whether motion end, if not , call command failure; (3) Check whether specified axis is set to followmaster axis; (4) Check whether there is data in FIFO; (5) Check whether“mask”is set to start corresponding axis. Others :Please refer to summary of return values

Related commands

short FollowSwitch(long mask)

Function Switch FIFO from one to another Execution Executed immediately Parameters mask: the FIFO memory which will be switched into Following

mode by bit. When bitX=1, it means that controller will switch corresponding FIFO

Return value Return 1: (1) Check whether current axis is in Following mode, if not, call GT_PrfFollow to set axis as Following mode; (2) Check whether it is in motion, only in motion status ,FIFO can be switched; (3) Check whether the FIFO is clear up; (4) Check whether“mask” is set to start corresponding axis. Others :Please refer to summary of return values.

Related commands

short GearStart(long mask)

Function Start Electronic gear mode motion

Execution Executed immediately Parameters mask: the NO. of axis which will be started in Electronic gear

Page 22: MS-Tech CNC System Connection Manual - ACC MOTION …accmotionsolutions.com/virtualoffice_files/Programming Manual of... · 4 Acc-3200 series motion controllers are developed for

22

mode motion by bits When bit X=1 means corresponding axis will be started

Return value Return 1: (1) Check whether current axis is in electronic gear mode, if not, call GT_PrfGear to set axis as Gear mode; (2) Check whether master axis is set; (3) Check whether transmission ratio is set Others :Please refer to summary of return values

Related commands

short GetAdc(short adc, double *pValue, short count=1, unsigned long *pClock=NULL)

Function Get input voltage of adc

Execution Executed immediately Parameters adc: Start number of adc, from 1 to 4

pValue:Inout voltage of adc. Unit: V count: The number of adcs to be read. The default value is 1, and maximum value is 8. pClock: Get the clock of motion controller. Default is NULL

Return value Please refer to summary of return values Related commands

short GetAdcValue(short adc, double *pValue, short count=1, unsigned long *pClock=NULL)

Function Get input digital value of adc

Execution Executed immediately Parameters adc: Start number of adc, from 1 to 8

pValue: Input digital value of adc. Unit :bit, it value from -32768 to 32768, corresponding voltage ranging in[-10,10]V count: The number of adcs to be read. The default value is 1, and maximum value is 8. pClock: Get the clock of motion controller. Default is NULL

Return value Please refer to summary of return values Related commands

short GetAxisBand(short axis, long *pBand, long *pTime)

Function Get arrival error band

Execution Executed immediately Parameters axis: Axis No. Positive integer

pBand: Allowed scope. pTime: Error band holding time

Return value Please refer to summary of return values Related commands

short GetAxisEncAcc(short axis, double *pValue, short count=1, unsigned long *pClock=NULL)

Function Get scale transformed encoder acceleration of specified axis

Page 23: MS-Tech CNC System Connection Manual - ACC MOTION …accmotionsolutions.com/virtualoffice_files/Programming Manual of... · 4 Acc-3200 series motion controllers are developed for

23

Execution Executed immediately Parameters axis: Axis No. Positive integer

pValue: Scale transformed encoder acceleration. Unit: pulse/ms2. count: The number of axes to be read. The default value is 1. Positive integer pClock: Get the clock of motion controller. The default value is NULL, which means controller will not return the value of clock

Return value Please refer to summary of return values Related commands

short GetAxisEncPos(short axis, double *pValue, short count=1, unsigned long *pClock=NULL)

Function Get scale transformed encoder position of specified axis

Execution Executed immediately Parameters axis: Axis No. Positive integer

pValue: Scale transformed encoder position. Unit: pulse. count: The number of axes to be read. The default value is 1. Positive integer pClock: Get the clock of motion controller. The default value is NULL, which means controller will not return the value of clock

Return value Please refer to summary of return values Related commands

short GetAxisEncVel(short axis, double *pValue, short count=1, unsigned long *pClock=NULL)

Function Get scale transformed encoder velocity of specified axis

Execution Executed immediately Parameters axis: Axis No. Positive integer

pValue: Scale transformed encoder velocity. Unit: pulse/ms. count: The number of axes to be read. The default value is 1. Positive integer pClock: Get the clock of motion controller. The default value is NULL, which means controller will not return the value of clock

Return value Please refer to summary of return values Related commands

short GetAxisError(short axis, double *pValue, short count=1, unsigned long *pClock=NULL)

Function Get the error between scale transformed profile position and scale transformed encoder position

Execution Executed immediately Parameters axis: Beginning Axis No. Positive integer

pValue: Error between transformed profile position and transformed encoder position. Unit :pulse. count: The number of axes to be read. The default value is 1. Positive integer

Page 24: MS-Tech CNC System Connection Manual - ACC MOTION …accmotionsolutions.com/virtualoffice_files/Programming Manual of... · 4 Acc-3200 series motion controllers are developed for

24

pClock: Get the clock of motion controller. The default value is NULL, which means controller will not return the value of clock

Return value Please refer to summary of return values Related commands

short GetAxisPrfAcc(short axis, double *pValue, short count=1, unsigned long *pClock=NULL)

Function Get scale transformed profile acceleration of specified axis

Execution Executed immediately Parameters axis: Beginning Axis No. Positive integer

pValue: Scale transformed profile acceleration. Unit: pulse/ms2. count: The number of axes to be read. The default value is 1. Positive integer pClock: Get the clock of motion controller. The default value is NULL, which means controller will not return the value of clock

Return value Please refer to summary of return values Related commands

short GetAxisPrfPos(short axis, double *pValue, short count=1, unsigned long *pClock=NULL)

Function Get scale transformed PROFILE position of specified axis

Execution Executed immediately Parameters axis: Beginning Axis No. Positive integer

pValue: Scale transformed profile position. Unit: pulse. count: The number of axes to be read. The default value is 1. Positive integer pClock: Get the clock of motion controller. The default value is NULL, which means controller will not return the value of clock

Return value Please refer to summary of return values Related commands

short GetAxisPrfVel(short axis, double *pValue, short count=1, unsigned long *pClock=NULL)

Function Get scale transformed profile velocity of specified axis

Execution Executed immediately Parameters axis: Beginning Axis No. Positive integer

pValue: Scale transformed profile velocity. Unit: pulse/ms. count: The number of axes to be read. The default value is 1. Positive integer pClock: Get the clock of motion controller. The default value is NULL, which means controller will not return the value of clock

Return value Please refer to summary of return values Related commands

Page 25: MS-Tech CNC System Connection Manual - ACC MOTION …accmotionsolutions.com/virtualoffice_files/Programming Manual of... · 4 Acc-3200 series motion controllers are developed for

25

short GetBackLash(short axis, long compValue, doulet compChangeValue, long compDir )

Function Get the relative parameters of backlash compensation

Execution Executed immediately Parameters axis: Axis No. Positive integer

compValue: The value of backlash compensation. compChangeValue: The variation of backlash compensation compDir: The direction of backlash compensation

Return value Please refer to summary of return values Related commands

short GetCaptureRepeatPos(short encoder, long *pValue, short startNum, short count )

Function Get repeat capture position

Execution Executed immediately Parameters encoder: encoder No. of repeat capture Positive integer

pValue: Get value the encoder captured value, if there are multiple values, the length of array should be bigger than “count.”. startNum: Start number of capture position count:: Total number of return value. the maximum count is numbers already captured

Return value Please refer to summary of return values Related commands

short GetCaptureRepeatStatus(short encoder, short *pCount )

Function Get repeat capture status

Execution Executed immediately Parameters encoder: encoder No. of repeat capture Positive integer

pCount: Get the encoder capture triggered times. 0 means not triggered; Bigger than 0 means triggered The value is times already triggered

Return value Please refer to summary of return values Related commands

short GetCaptureMode(short encoder, short *pMode, short count )

Function Get encoder capture mode

Execution Executed immediately Parameters encoder: encoder No. Positive integer

pMode: Encoder capture mode count: The number of encoders to be read. The default value is 1, and maximum count is 8.

Return value Please refer to summary of return values Related commands SetCaptureMode

short GetCaptureStatus(short encoder, short *pStatus, long *pValue, short count,

Page 26: MS-Tech CNC System Connection Manual - ACC MOTION …accmotionsolutions.com/virtualoffice_files/Programming Manual of... · 4 Acc-3200 series motion controllers are developed for

26

unsigned long *pClock )

Function Get encoder capture status

Execution Executed immediately Parameters encoder: encoder No. Positive integer

pStatus: capture status. When the value of “pStatus” is 1, the corresponding axis has been triggered pValue: Value of encoder capture position. When the capture is triggered, the encoder capture position would be updated automatically count: The number of encoders to be read. The default value is 1, and maximum count is 8. pClock: Read the clock of motion controller

Return value Please refer to summary of return values Related commands SetCaptureMode

short GetCardNo(short*pIndex )

Function Get specified card number Execution Executed immediately Parameters pIndex: The specified using motion controller No.

Return value Please refer to summary of return values Related commands SetCardNo

short GetClock(unsigned long *pClock, unsigned long *pLoop=NULL )

Function Get the internal clock of motion controller Execution Executed immediately Parameters pClock: Clock of motion controller, unit: ms

pLoop: an interior parameter which is not valid to user. The default value is NULL.

Return value Please refer to summary of return values Related commands

short GetClockHighPrecision(unsigned long *pClock,unsigned long *pLoop=NULL )

Function Get the high precision value of internal clock of motion controller Execution Executed immediately Parameters pClock: Clock of motion controller, unit: 125µs

pLoop: an interior parameter which is not valid to user. The default value is NULL.

Return value Please refer to summary of return values

Related commands

short GetControlFilter(short control, short *pIndex)

Function Get the index of PID parameters

Execution Executed immediately Parameters control: control No. Positive integer

pIndex: Index of PID parameters, from 1 to 3.

Return value Please refer to summary of return values Related commands

Page 27: MS-Tech CNC System Connection Manual - ACC MOTION …accmotionsolutions.com/virtualoffice_files/Programming Manual of... · 4 Acc-3200 series motion controllers are developed for

27

short GetCrdPos(short crd, double *pPos)

Function Get current positions of the coordinate system. The returned value may not equal to profile position, which depends on whether origin of coordinate system is set as 0.

Execution Executed immediately Parameters crd: Coordinate system ID, from 1rto 3.

pPos: Returned profile position of “crd” coordinate, unit: pulse. This parameter is a pointer to the first element of an array. The number of elements in the array is decided by the dimension of the coordinate system.

Return value Please refer to summary of return values Related commands

short GetCrdPrm(short crd, TCrdPrm *pCrdPrm)

Function Get parameters of the coordinate system

Execution Executed immediately Parameters crd: Coordinate system ID, from 1rto 2.

pPos: Get parameters of the coordinate system. Please refer to GT_SetCrdPrm for definitions of the structure members

Return value Please refer to summary of return values Related commands SetCrdPrm

short GetCrdStopDec(short crd, double *pDecSmoothStop, double *pDecAbruptStop)

Function Get the resultant acceleration of smooth stop and emergency stop

Execution Executed immediately Parameters crd: Coordinate system ID, from 1rto 2.

pDecSmoothStop: Get resultant smooth stop acceleration, from 0 to 32767, unit: pulse/(ms*ms). pDecAbruptStop: Get resultant abrupt stop acceleration, from 0 to 32767, unit: pulse/(ms*ms).

Return value Return 1: check whether current coordinate system is maping to a axis Others :Please refer to summary of return values

Related commands

short GetCrdVel(short crd, double *pSynVel)

Function Get the resultant velocity of the coordinate system

Execution Executed immediately Parameters crd: Coordinate system ID, from 1rto 2.

pSynVel: Returned resultant velocity, unit: pulse/ms.

Return value Please refer to summary of return values Related commands

Page 28: MS-Tech CNC System Connection Manual - ACC MOTION …accmotionsolutions.com/virtualoffice_files/Programming Manual of... · 4 Acc-3200 series motion controllers are developed for

28

short GetDac(short dac, short *pValue, short count, unsigned long *pClock)

Function Get output voltage of dac

Execution Executed immediately Parameters dac: Start number of dac

pValue: Output voltage of dac count: The number of dacs to be read. The default value is 1, and maximum value is 8. pClock: Get the clock of motion controller

Return value Please refer to summary of return values Related commands SetDac

short GetDi(short diType, long *pValue)

Function Get digital IO input status

Execution Executed immediately Parameters diType: Type of digital IO input.

MC_LIMIT_POSITIVE (this macro is defined 0): positive limit. MC_LIMIT_NEGATIVE (this macro is defined 1): negative limit. MC_ALARM (this macro is defined 2): drive alarm. MC_HOME (this macro is defined 3): home. MC_GPI (this macro is defined 4): general input. MC_ARRIVE(this macro is defined 5) pValue: Status of digital input. It indicates the input level of digital IO by bit, this value depends on the reverse value in the di page of configulation tool. If reverse is 0, “1” represents high level and “0” represents low level. If reverse is 1, “1” represents low level and “0” represents high level.

Return value Please refer to summary of return values Related commands SetDac

short GetDiRaw(short diType, long *pValue)

Function Get the original digital input status

Execution Executed immediately Parameters diType: Type of digital IO input.

MC_LIMIT_POSITIVE (this macro is defined 0): positive limit. MC_LIMIT_NEGATIVE (this macro is defined 1): negative limit. MC_ALARM (this macro is defined 2): drive alarm. MC_HOME (this macro is defined 3): home. MC_GPI (this macro is defined 4): general input. MC_ARRIVE(this macro is defined 5) pValue: Origin Status of digital input. It indicates the input level of digital IO by bit. “1” represents high level and “0” represents low level

Return value Please refer to summary of return values Related commands SetDac

short GetDiReverseCount(short diType, short diIndex Unsigned long

Page 29: MS-Tech CNC System Connection Manual - ACC MOTION …accmotionsolutions.com/virtualoffice_files/Programming Manual of... · 4 Acc-3200 series motion controllers are developed for

29

*pReverseCount, short count)

Function Get reverse times of digital input Execution Executed immediately Parameters diType: Type of digital IO input.

MC_LIMIT_POSITIVE (this macro is defined 0): positive limit. MC_LIMIT_NEGATIVE (this macro is defined 1): negative limit. MC_ALARM (this macro is defined 2): drive alarm. MC_HOME (this macro is defined 3): home. MC_GPI (this macro is defined 4): general input. MC_ARRIVE(this macro is defined 5) diIndex: Index of digital input. Value range : If diType = MC_LIMIT_POSITIVE, the value from 1 to 8. If diType = MC_LIMIT_NEGATIVE, the value from 1 to 8. If diType = MC_ALARM, the value from 1 to 8. If diType = MC_HOME, the value from 1 to 8. If diType = MC_GPI, the value from 1 to 16. If diType= MC_ARRIVE, the value from 1 to 8. pReverseCount: Digital input reverses times count: The number of digital inputs reverse time to be counted. The default

value is 1,maximum value is 4

Return value Please refer to summary of return values Related commands SetDac

short GetDo(short doType, long *pValue)

Function Get digital output status

Execution Executed immediately Parameters doType: Type of digital output.

MC_ENABLE (this macro is defined 10): servo on. MC_CLEA (this macro is defined 11): clear alarm ouput. MC_GPO (this macro is defined 12): general output pValue: Status of digital output. By default case, “1” represents high level and “0” represents low level

Return value Please refer to summary of return values Related commands SetDac

short GetEncPos(short encoder, double *pValue short count, unsigned long *pClock)

Function Get encoder position

Execution Executed immediately

Parameters encoder: encoder No. Positive integer. pValue: Position of encoder count: “count” represents the number of encoders to be read. The default value is 1, and maximum value is 8. pClock: Get the clock of motion controller

Return value Please refer to summary of return values Related commands SetDac

short GetEncVel(short encoder, double *pValue short count, unsigned long

Page 30: MS-Tech CNC System Connection Manual - ACC MOTION …accmotionsolutions.com/virtualoffice_files/Programming Manual of... · 4 Acc-3200 series motion controllers are developed for

30

*pClock)

Function Get encoder velocity

Execution Executed immediately Parameters encoder: encoder No. Positive integer.

pValue:: velocity of encoder count: “count” represents the number of encoders to be read. The default value is 1, and maximum value is 8. pClock: Get the clock of motion controller

Return value Please refer to summary of return values Related commands SetDac

short GetFollowEventl(short profile, double *pEvent short *pMasterDir, long *pos)

Function Get the start condition of Following mode

Execution Executed immediately

Parameters profile: profile No. Positive integer. pEvent: Start condition of following action. FOLLOW_ENENT_START(this macro is defined 1): start immediately after calling GT_FollowStart. FOLLOW_EVENT_PASS(this macro is defined 2): start when master axis pass “pPos” pMasterDir: Motion action of master axis. 1: master axis motion forward -1: slave axis motion backward pPos: “pPos” is the position which is set by user, the slave axis will startup the following action. Unit: pulse Only when the “pEvent” is “FOLLOW_EVENT_PASS”, the “pPos” is effective

Return value Return 1:check whether motion mode is Following mode, if not, call GT_PrfFollow to set specified axis as Following mode. Others: Please refer to summary of return values

Related commands SetFollowEvent

short GetFollowLoop(short profile, long *pLoop)

Function Get the cycle numbers

Execution Executed immediately Parameters profile: profile No. Positive integer.

pLoop: Get cycle numbers of axis executed the Following mode

Return value Return 1:check whether motion mode is Following mode, if not, call GT_PrfFollow to set specified axis as Following mode. Others: Please refer to summary of return values

Related commands SetFollowLoop

short GetFollowMaster(short profile, short *pMasterIndex, short *pMasterType, short *pMasterItem)

Function Get the information of master axis

Execution Executed immediately Parameters profile: profile No. Positive integer.

pMasterIndex: Get The index of master axis Positive integer The master axis index can not be the same as profile axis index, it is suggested master axis index is smaller then profile axis index. For

Page 31: MS-Tech CNC System Connection Manual - ACC MOTION …accmotionsolutions.com/virtualoffice_files/Programming Manual of... · 4 Acc-3200 series motion controllers are developed for

31

example, if master axis index is ser as 1 ,then profile axis index must set bigger than 1. pMasterType: The type of master axis FOLLOW_ENENT_PROFILE(this macro is defined 2) means that the type of master axis is profile axis. FOLLOW_ENENT_ENCODER(this macro is defined 1) means that the type of master axis is encoder FOLLOW_ENENT_AXIS(this macro is defined 3) means that the type of master axis is axis. pMasterItem: The type of synthetic axis Actived when masterType=FOLLOW_MASTER_AXIS. 0 represents output of profile position , default is 0. 1 represents output of encoder position

Return value Return 1:check whether motion mode is Following mode, if not, call GT_PrfFollow to set specified axis as Following mode. Others: Please refer to summary of return values

Related commands SetFollowEvent

short GetFollowMemory(short profile, short *pMemory)

Function Get the information of master axis

Execution Executed immediately Parameters profile: profile No. Positive integer.

pMemory: Storage sign of memory in Following mode. 0: buffer can store 16 segments data in Following mode 1: buffer can store 512 segments data in Following mode

Return value Return 1:check whether motion mode is Following mode, if not, call GT_PrfFollow to set specified axis as Following mode. Others: Please refer to summary of return values

Related commands SetFollowMemory

short GetFunId(char *pFunName, short *pFunId)

Function Read function ID of motion program

Execution Executed immediately Parameters pFunName: Function name of motion program

pFunId: “pFunId” is the id of function searched by function name

Return value Return 1, 2007 or 2008: check whether call GT_DownLoad() successfully. If not, do as what return hints, till successful. Others: Please refer to summary of return values

Related commands

short GetGearMaster(short profile, short masterIndex, short masterType, short masterItem)

Function Get the information about the master axis

Execution Executed immediately Parameters profile: profile No. Positive integer

masterIndex: The index of master axis. Positive integer masterType: Master axis type GEAR_MASTER_ENCODER means that the type of master axis is encoder GEAR_MASTER_PROFILE means that the type of master axis is

Page 32: MS-Tech CNC System Connection Manual - ACC MOTION …accmotionsolutions.com/virtualoffice_files/Programming Manual of... · 4 Acc-3200 series motion controllers are developed for

32

profile axis GEAR_MASTER_AXIS means that the type of master axis is synthetic axis masterItem: Synthetic axis type, Actived when masterType=FOLLOW_MASTER_AXIS. 0 means the profile position of synthetic axis 1 means the encoder position of synthetic axis

Return value Return 1, 2007 or 2008: check whether call GT_DownLoad() successfully. If not, do as what return hints, till successful. Others: Please refer to summary of return values

Related commands SetGearMaster

short GetGearRatio(short profile, long *pMasterEven, long *pSlaveEven, long *pMasterSlope)

Function Get the electronic gear ratio

Execution Executed immediately Parameters profile: profile No. Positive integer

pMasterEven: The displacement of master axis. Unit: pulse pSlaveEven: The displacement of slave axis. Unit: pulse pMasterSlope: The displacement of clutch zone of master. Unit: pulse,

Return value Return 1:check whether motion mode is Gear mode, if not, call GT_PrfGear to set specified axis as Gear mode. Others: Please refer to summary of return values

Related commands SetGearRatio

short GetJogPrm(short profile, TJogPrm *pPrm)

Function Get parameters of Jog mode

Execution Executed immediately Parameters profile: profile No. Positive integer

pPrm: Parameters of Jog mode , the parameter is a structure parameter, including 3 parameters, detailed definition refer to GT_SetJogPrm,

Return value Return 1: (1) If specified axis in motion, call this command after called GT_Stop() (2) check whether motion mode is Jog mode, if not, call GT_PrfJog to set specified axis as Jog mode. Others: Please refer to summary of return values

Related commands SetJogPrm

short GetMtrBias(short dac, short *pBias)

Function Get the zero compensation value of dac

Execution Executed immediately Parameters dac: dac No. Positive integer

pBias: zero compensation value,

Return value Please refer to summary of return values

Page 33: MS-Tech CNC System Connection Manual - ACC MOTION …accmotionsolutions.com/virtualoffice_files/Programming Manual of... · 4 Acc-3200 series motion controllers are developed for

33

Related commands SetMtrBias

short GetMtrLmt(short dac, short *pLimit)

Function Get dac saturation limit Execution Executed immediately Parameters dac: dac No. Positive integer

pLimit: Get dac saturation limit

Return value Please refer to summary of return values Related commands SetMtrLmt

short GetPid(short control, short index, TPid *pPid)

Function Get the parameters of PID

Execution Executed immediately Parameters control: control No. Positive integer

Index: Index of PID parameters, its value from 1 to 3 pPid: Parameters of PID

Return value Please refer to summary of return values Related commands

short GetPos(short profile, long *pPos)

Function Get target position

Execution Executed immediately Parameters profile: profile No. Positive integer

pPos: Return target position, unit: pulse

Return value Return 1:check whether motion mode is Trap mode, if not, call GT_PrfTrop to set specified axis as Trap mode. Others: Please refer to summary of return values

Related commands SetPos

short GetPosErr(short control, long *pError)

Function Get following error limit Execution Executed immediately Parameters control: control No. Positive integer

pError: Returned following error limit, unit: pulse

Return value Please refer to summary of return values Related commands SetPosErr

short GetPrfAcc(short profile, double *pValue, short count, unsigned long *pClock)

Function Get profile acceleration of specified profile

Execution Executed immediately Parameters Profile: profile No. Positive integer

pValue: profile acceleration. Unit: pulse/ms*ms count: The number of profiles to be read. The default value is 1, Positive integer pClock: Get the clock of motion controller. The default value is NULL,

Page 34: MS-Tech CNC System Connection Manual - ACC MOTION …accmotionsolutions.com/virtualoffice_files/Programming Manual of... · 4 Acc-3200 series motion controllers are developed for

34

which means controller will not return the value of clock

Return value Please refer to summary of return values Related commands SetPosErr

short GetPrfMode(short profile, long *pValue, short count, unsigned long *pClock)

Function Get motion mode of specified axis

Execution Executed immediately Parameters Profile: profile No. Positive integer

pValue: “pValue” represents the motion mode of profile 0: T-curve, default value 1: Jog mode 2: PT mode 3: Electronic gear mode 4: Following mode 5: Crd mode 6: Pvt mode count: The number of profiles to be read. The default value is 1, Positive integer pClock: Get the clock of motion controller. The default value is NULL, which means controller will not return the value of clock

Return value Please refer to summary of return values Related commands SetPosErr

short GetPrfPos(short profile, long *pValue, short count, unsigned long *pClock)

Function Get profile position of specified axis

Execution Executed immediately Parameters Profile: profile No. Positive integer

pValue: Profile position , unit: pulse count: The number of profiles to be read. The default value is 1, Positive integer pClock: Get the clock of motion controller. The default value is NULL, which means controller will not return the value of clock

Return value Please refer to summary of return values Related commands SetPosErr

short GetPrfVel(short profile, long *pValue, short count, unsigned long *pClock)

Function Get profile velocity of specified axis

Execution Executed immediately Parameters Profile: profile No. Positive integer

pValue: Profile velocity , unit: pulse count: The number of profiles to be read. The default value is 1, Positive integer pClock: Get the clock of motion controller. The default value is NULL, which means controller will not return the value of clock

Return value Please refer to summary of return values Related commands SetPosErr

short GetPtLoop(short profile, long loop)

Page 35: MS-Tech CNC System Connection Manual - ACC MOTION …accmotionsolutions.com/virtualoffice_files/Programming Manual of... · 4 Acc-3200 series motion controllers are developed for

35

Function Get the cycle numbers This command is invalid, when the FIFO memory is in dynamic mode

Execution Executed immediately Parameters Profile: profile No. Positive integer

loop: Cycle numbers of PT mode. In dynamic mode, this parameter is invalid

Return value Return 1: check whether motion mode is Pt mode, if not, call GT_PrfPt to set specified axis as Pt mode. Others: Please refer to summary of return values

Related commands SetPtLoop

short GetPtMemory(short profile, short memory)

Function Get FIFO memory

Execution Executed immediately

Parameters Profile: profile No. Positive integer memory: “memory” is the sign of storage for each memory in PT mode.

Return value Return 1: check whether motion mode is Pt mode, if not, call GT_PrfPt to set specified axis as Pt mode. Others: Please refer to summary of return values

Related commands SetPtMemory

short GetPvtLoop(short profile, long *pLoopCount, long *pLoop)

Function Get the cycle numbers

Execution Executed immediately Parameters Profile: profile No. Positive integer

pLoopCount: Get the number of loops executed pLoop: Get the total number of loops

Return value Return 1:check whether motion mode is Pvt mode, if not, call GT_PrfPvt to set specified axis as Pvt mode. Others: Please refer to summary of return values

Related commands SetPvtLoop

short GetRemainderSegNum(short crd, long *pSegment, short fifo=0)

Function Get the number of unfinished segments

Execution Executed immediately Parameters crd: Coordinate system ID, from 1 to 2.

pSegment: Get the number of the unfinished Crd segments fifo: The number of fifo that to be queried, ranging in [0,1], default is 0

Return value Return 1:check whether specified coordinate system be mapped to axis Others: Please refer to summary of return values

Related commands

short GetSoftLimit(short axis, long *pPositive, long *pNegative)

Function Get positive soft limit and negative soft limit Execution Executed immediately Parameters axis: axis No. Positive integer

Page 36: MS-Tech CNC System Connection Manual - ACC MOTION …accmotionsolutions.com/virtualoffice_files/Programming Manual of... · 4 Acc-3200 series motion controllers are developed for

36

pPositive: Position of positive soft limit pNegative: Position of negative soft limit

Return value Please refer to summary of return values Related commands

short GetStopDec(short profile,double *pDecSmoothStop,double *pDecAbruptStop)

Function Get smooth stop decelerability and emergency stop decelerability

Execution Executed immediately Parameters profile: profile No. Positive integer

pDecSmoothStop: smooth stop decelerability. Unit: pulse/ms pDecAbruptStop: emergency stop decelerability. Unit: pulse/ms

Return value Please refer to summary of return values Related commands SetStopDec

short GetSts(short axis, long *pSts, short count, unsigned long *pClock)

Function Get the status of specified axis

Execution Executed immediately Parameters axis: axis No. Positive integer

pSts: 32 bits axis status characters. Tab 5-2 show detail info about of these status characters count: The number of profiles to be read. The default value is 1, Positive integer pClock: Get the clock of motion controller. The default value is NULL, which means controller will not return the value of clock

Return value Please refer to summary of return values Related commands ClrSts

short GetThreadSts(short thread, TThreadSts *pThreadSts)

Function Read thread status

Execution Executed immediately Parameters thread: Thread number, and its value from 0 to 31.

pThreadSts: Read the thread status. typedef struct ThreadSts { short run; // running status short error; // command return value double result; // function return value short line; // current command line number } TThreadSts

Return value Please refer to summary of return values Related commands

short GetTrapPrm(short profile, TTrapPrm *pPrm)

Function Get parameters of Point to Point mode

Execution Executed immediately Parameters profile: profile No. Positive integer

pPrm: Parameters of Point to Point mode , it is a structure type, including 4

Page 37: MS-Tech CNC System Connection Manual - ACC MOTION …accmotionsolutions.com/virtualoffice_files/Programming Manual of... · 4 Acc-3200 series motion controllers are developed for

37

parameters ,detailed definition refer to GT_SetTrapPrm

Return value Return 1:check whether motion mode is Trap mode, if not, call GT_Prf Trap to set specified axis as Trap mode. Others: Please refer to summary of return values

Related commands SetTrapPrm

short GetUserSegNum(short crd, long *pSegment, short fifo=0)

Function Get the user defined segment number Execution Executed immediately Parameters crd: Coordinate system ID, from 1 to 2

pSegment: Get the user defined segment number fifo: The number of fifo that to be queried, ranging in [0,1], default is 0.

Return value Return 1:check whether specified coordinate system be mapped with axes Others: Please refer to summary of return values.

Related commands SetUserSegNum

short GetVarId(char *pFunName, char *pVarName, TVarInfo *pVarInfo)

Function Read variable ID of motion program

Execution Executed immediately Parameters pFunName: If pVarName is a global variable, this parameter is Null

If pVarName is a local variable, this parameter is the corresponding function name pVarName:Variable name of motion program pVarInfo:Variable information searched by function name and variable name

Return value Return 1, 2007 or 2008: check whether call GT_DownLoad() successfully. If not, do as what return hints, till successful. Others: Please refer to summary of return values.

Related commands

short GetVarValue(short page, TVarInfo *pVarInfo, double *pValue, short count=1)

Function Get the variable value of motion program

Execution Executed immediately Parameters page: data page

pVarInfo: Variable information pValue: “pValue” is the value of read variable count:“count” is the number of variable which to be read, its value from 1 to 8

Return value Please refer to summary of return values. Related commands

short GetVel(short profile, double *pVel)

Function Get target velocity

Execution Executed immediately Parameters profile: profile No. Positive integer

pVel: Target velocity, unit: pulse/ms

Return value Return 1: check whether specified axis is Trap mode, if not ,set it as Trap mode by calling GT_PefTrap Others: Please refer to summary of return values

Page 38: MS-Tech CNC System Connection Manual - ACC MOTION …accmotionsolutions.com/virtualoffice_files/Programming Manual of... · 4 Acc-3200 series motion controllers are developed for

38

Related commands SetVel

short GetVrsionl(char **pVersion)

Function Get the firmware version of motion controller Execution Executed immediately Parameters pVersion: “pVersion” represents the character string of firmware

version in the motion controller

Return value Please refer to summary of return values Related commands

short GpiSns(unsigned short sense)

Function Set the logic electrical lever for digital input Execution Executed immediately Parameters sense: Set the digital input level by bit, bit0 to bit15 represents general input

1 to general input 16. It has effect on results get by calling GT_GetDi 0: original input level, the return of GT_GetDi() is same as the input level, 0 means the input is low level, 1 means the input is high level. 1: reverse input level, the return of GT_GetDi() is same as the reversed value of input level, 0 means the input is high level, 1 means the input is low level

Return value Please refer to summary of return values Related commands

short Home(short axis, long pos, double vel, double acc, long offset)

Function Start searching for zero point Execution Executed immediately Parameters axis: axis No. positive integer

pos: Searching distance, starts from the current position, if pos is positive,

search in the positive direction, if pos is negative, search in the negative direction. Unit: pulse vel: Searching velocity, unit: pulse/ms

acc: Searching acceleration, unit: pulse/(ms*ms).

offset: Origin offset, when the home switch triggered, update the current

axis’s target position to “origin+offset”, if offset is 0, the axis would smooth decelerate to 0, then move back to zero position

Return value Please refer to summary of return values Related commands

short HomeInit()

Function Initialize the automatic zero point searching function

Execution Executed immediately Parameters

Return value Please refer to summary of return values Related commands

Page 39: MS-Tech CNC System Connection Manual - ACC MOTION …accmotionsolutions.com/virtualoffice_files/Programming Manual of... · 4 Acc-3200 series motion controllers are developed for

39

short HomeStop(short axis, long pos, double vel, double acc)

Function Search for zero point, and then stop at that position

Execution Executed immediately Parameters axis: Axis No. positive integer

pos: Searching distance, starts from the current position, if pos is positive, search in the positive direction, if pos is negative, search in the negative direction. Unit: pulse. vel: Searching velocity, unit: pulse/ms acc: Searching acceleration, unit: pulse/(ms*ms).

Return value Please refer to summary of return values Related commands

short HomeSts(short axis, unsigned short *status)

Function Get the running status of Automatic homing

Execution Executed immediately Parameters axis: Axis No. positive integer

pStatus: Return value: 0: searching for zero point. 1: finished searching

Return value Please refer to summary of return values Related commands

short Index(short axis, long pos, double vel, double acc)

Function Set zero point searching in home+index mode

Execution Executed immediately Parameters axis: Axis No. positive integer

pos: Searching distance, starts from the current position, if pos is positive, search in the positive direction, if pos is negative, search in the negative direction. Unit: pulse. vel: Searching velocity, unit: pulse/ms acc: Searching acceleration, unit: pulse/(ms*ms).

Return value Please refer to summary of return values Related commands

short InitLookAhead(short crd, short fifo, double T, double accMax, short n, TCrdData *pLookAheadBuf)

Function Initialize the FIFO of look-ahead

Execution Executed immediately

Parameters crd: crd No. positive integer, from 1 to 2 fifo: Index of Crd buffer, positive integer, ranging in[0,1],default is 0 T: Turning time .unit: ms accMax:Maximum acceleration. Unit: pulse/(ms*ms) n: Size of look-ahead buffer, the value from 0 to 32767 pLookAheadBuf: Pointer of look-ahead buffer

Return value Please refer to summary of return values Related commands

short LmtSns(unsigned short sense)

Page 40: MS-Tech CNC System Connection Manual - ACC MOTION …accmotionsolutions.com/virtualoffice_files/Programming Manual of... · 4 Acc-3200 series motion controllers are developed for

40

Function Specify the effective electrical level for limit switch

Execution Executed immediately Parameters sense: Set effective electrical level ofr limit switch by bits. The follow table,

“+” represent s positive limit, “-” represents negative limit

Return value Please refer to summary of return values Related commands

short LmtsOff(short axis, short limitType=-1)

Function Disable the limit Execution Executed immediately Parameters axis: Axis No. positive integer

limitType: Disable limit type MC_LIMIT_POSITIVE(this macro is defined 0): Disable the positive limit of axis MC_LIMIT_NEGATIVE(this macro is defined 1): Disable the negative limit of axis -1:Disable both of positive and negative limit of axis, default value

Return value Return 1: check limit of axis limit, whether configuration file configuration limit disable. Others: Please refer to summary of return values

Related commands LmtsOn

short LmtsOn(short axis, short limitType=-1)

Function Enable the limit Execution Executed immediately Parameters axis: Axis No. positive integer

limitType: Enable limit type MC_LIMIT_POSITIVE(this macro is defined 0): Enable the positive limit of axis MC_LIMIT_NEGATIVE(this macro is defined 1): Enable the negative limit of axis -1:Enable both of positive and negative limit of axis, default value

Return value Return 1: check limit of axis limit, whether configuration file configuration limit disable. Others: Please refer to summary of return values

Related commands LmtsOn

short LnXY(short crd, long x, long y, double synVel, double synAcc, double velEnd=0, short fifo=0)

Function Buffer command, two-dimensional linear interpolation Execution Executed immediately Parameters crd: Coordinate system ID, from 1 to 2

x: x-Axis end-point, from -1073741823 to 1073741823, unit: pulse y: y-Axis end-point, from -1073741823 to 1073741823, unit: synVel: Programming resultant velocity of the Crd segment, from 0 to 32767, unit: pulse/ms synAcc: acceleration of the Crd segment, from 0 to 32767, unit: pulse/(ms*ms) velEnd: End velocity of the crd segment from 0 to 32767,unit:pulse/ms, The parameter is valid when look-ahead processing isn’t used,

Page 41: MS-Tech CNC System Connection Manual - ACC MOTION …accmotionsolutions.com/virtualoffice_files/Programming Manual of... · 4 Acc-3200 series motion controllers are developed for

41

otherwise is invalid, default:0 fifo: FIFO ID, from 0 to 1, default is 0.

Return value Return 1: (1) Check whether current coordinate system is mapped to correspondent axes (2) Check whether data is transferred to fifo 1. If so, check whether fifo0 is used and in motion, if in motion, return error. (3) Check whether fifo is full. Others: Please refer to summary of return values

Related commands

short LnXYG0(short crd, long x, long y, double synVel, double synAcc, short fifo=0)

Function two-dimensional linear interpolation with symmetry profile of velocity planning

Execution Executed immediately Parameters crd: Coordinate system ID, from 1 to 2

x: x-Axis end-point, from -1073741823 to 1073741823, unit: pulse y: y-Axis end-point, from -1073741823 to 1073741823, unit: pulse synVel: Programming resultant velocity of the Crd segment, from 0 to 32767, unit: pulse/ms synAcc: acceleration of the Crd segment, from 0 to 32767, unit: pulse/(ms*ms) fifo: FIFO ID, from 0 to 1, default is 0.

Return value Return 1: (1) Check whether current coordinate system is mapped to correspondent axes (2) Check whether data is transferred to fifo 1. If so, check whether fifo0 is used and in motion, if in motion, return error. (3) Check whether fifo is full. Others: Please refer to summary of return values

Related commands

short LnXYZ(short crd, long x, long y, long z, double synVel, double synAcc, double velEnd=0, short fifo=0)

Function Buffer command, three-dimensional linear interpolation Execution Executed immediately Parameters crd: Coordinate system ID, from 1 to 2

x: x-Axis end-point, from -1073741823 to 1073741823, unit: pulse y: y-Axis end-point, from -1073741823 to 1073741823, unit: pulse z: z-Axis end-point, from -1073741823 to 1073741823, unit: pulse synVel: Programming resultant velocity of the Crd segment, from 0 to 32767, unit: pulse/ms synAcc: acceleration of the Crd segment, from 0 to 32767, unit: pulse/(ms*ms) velEnd: End velocity of the crd segment from 0 to 32767,unit:pulse/ms, The parameter is valid when look-ahead processing isn’t used, otherwise is invalid, default:0 fifo: FIFO ID, from 0 to 1, default is 0.

Return value Return 1: (1) Check whether current coordinate system is mapped to correspondent axes

Page 42: MS-Tech CNC System Connection Manual - ACC MOTION …accmotionsolutions.com/virtualoffice_files/Programming Manual of... · 4 Acc-3200 series motion controllers are developed for

42

(2) Check whether data is transferred to fifo 1. If so, check whether fifo0 is used and in motion, if in motion, return error. (3) Check whether fifo is full. Others: Please refer to summary of return values

Related commands

short LnXYZA(short crd, long x, long y, long z, long a, double synVel, double synAcc, double velEnd=0, short fifo=0)

Function Buffer command, four-dimensional linear interpolation Execution Executed immediately Parameters crd: Coordinate system ID, from 1 to 2

x: x-Axis end-point, from -1073741823 to 1073741823, unit: pulse y: y-Axis end-point, from -1073741823 to 1073741823, unit: pulse z: z-Axis end-point, from -1073741823 to 1073741823, unit: pulse a: a-Axis end-point, from -1073741823 to 1073741823, unit: pulse synVel: Programming resultant velocity of the Crd segment, from 0 to 32767, unit: pulse/ms synAcc: acceleration of the Crd segment, from 0 to 32767, unit: pulse/(ms*ms) velEnd: End velocity of the crd segment from 0 to 32767,unit:pulse/ms, The parameter is valid when look-ahead processing isn’t used, otherwise is invalid, default:0 fifo: FIFO ID, from 0 to 1, default is 0.

Return value Return 1: (1) Check whether current coordinate system is mapped to correspondent axes (2) Check whether data is transferred to fifo 1. If so, check whether fifo0 is used and in motion, if in motion, return error. (3) Check whether fifo is full. Others: Please refer to summary of return values

Related commands

short LnXYZAG0(short crd, long x, long y, long z, long a, double synVel, double synAcc, short fifo=0)

Function four-dimensional linear interpolation with ending velocity is 0. Execution Executed immediately Parameters crd: Coordinate system ID, from 1 to 2

x: x-Axis end-point, from -1073741823 to 1073741823, unit: pulse y: y-Axis end-point, from -1073741823 to 1073741823, unit: pulse z: z-Axis end-point, from -1073741823 to 1073741823, unit: pulse a: a-Axis end-point, from -1073741823 to 1073741823, unit: pulse synVel: Programming resultant velocity of the Crd segment, from 0 to 32767, unit: pulse/ms synAcc: acceleration of the Crd segment, from 0 to 32767, unit: pulse/(ms*ms) fifo: FIFO ID, from 0 to 1, default is 0.

Return value Return 1: (1) Check whether current coordinate system is mapped to correspondent axes (2) Check whether data is transferred to fifo 1. If so, check whether fifo0 is used and in motion, if in motion, return error. (3) Check whether fifo is full.

Page 43: MS-Tech CNC System Connection Manual - ACC MOTION …accmotionsolutions.com/virtualoffice_files/Programming Manual of... · 4 Acc-3200 series motion controllers are developed for

43

Others: Please refer to summary of return values Related commands

short LnXYZG0(short crd, long x, long y, long z, double synVel, double synAcc, short fifo=0)

Function three-dimensional linear interpolation with ending velocity is 0. Execution Executed immediately Parameters crd: Coordinate system ID, from 1 to 2

x: x-Axis end-point, from -1073741823 to 1073741823, unit: pulse y: y-Axis end-point, from -1073741823 to 1073741823, unit: pulse z: z-Axis end-point, from -1073741823 to 1073741823, unit: pulse synVel: Programming resultant velocity of the Crd segment, from 0 to 32767, unit: pulse/ms synAcc: acceleration of the Crd segment, from 0 to 32767, unit: pulse/(ms*ms) fifo: FIFO ID, from 0 to 1, default is 0.

Return value Return 1: (1) Check whether current coordinate system is mapped to correspondent axes (2) Check whether data is transferred to fifo 1. If so, check whether fifo0 is used and in motion, if in motion, return error. (3) Check whether fifo is full. Others: Please refer to summary of return values

Related commands

short LoadConfig(char *pFile)

Function Download the configuration files into motion controller Execution Executed immediately Parameters pFile: The name of configuration file. File type is “*.cfg” or “*.CFG”

Return value Return1: motion controller is profiling motion, please call GT_Stop() and set again Others: Please refer to summary of return values

Related commands

short Open(short channel=0, short param=1)

Function Open motion controller Execution Executed immediately Parameters channel:Mode of open motion controller.

The default value is 0. “0” means open motion controller normally. “1” means interior debugging mode, which is disabled to user Param: When the value of “channel” is 1, this parameter is valid.

Return value Please refer to summary of return values Related commands

short PauseThread(short thread)

Function Pause the running thread Execution Executed immediately

Page 44: MS-Tech CNC System Connection Manual - ACC MOTION …accmotionsolutions.com/virtualoffice_files/Programming Manual of... · 4 Acc-3200 series motion controllers are developed for

44

Parameters thread: Thread number, and its value from 0 to 31.

Return value Return1: (1) check whether thread is bound; (2) check whether the data page overflows. Others: Please refer to summary of return values.

Related commands

short PrfFollow(short profile, short dir)

Function Set current axis as Following mode Execution Executed immediately Parameters profile: profile No. positive integer

dir: Following type of slave axis. 0 represents the following type is bidirectional follow; 1 represents the following type is positive follow; -1 represents the following type is negative follow

Return value Return1: (1) if specified axis is in profile motion , recall the command after calling GT_Stop (2) if specified axis is Following mode already, check whether “dir” is not same with the current one. Others: Please refer to summary of return values

Related commands

short PrfGear(short profile, short dir)

Function Set an axis as Electronic gear mode Execution Executed immediately Parameters profile: profile No. positive integer

dir: Following type of slave axis. 0 represents the following type is bidirectional follow; 1 represents the following type is positive follow; -1 represents the following type is negative follow

Return value Return1: (1) if specified axis is in profile motion , recall the command after calling GT_Stop (2) if specified axis is Gear mode already, check whether “dir” is not same with the current one. Others: Please refer to summary of return values

Related commands

short PrfJog(short profile)

Function Set an current axis as Jog mode Execution Executed immediately Parameters profile: profile No. positive integer

Return value Return1:if specified axis is in profile motion , recall the command after calling GT_Stop Others: Please refer to summary of return values

Related commands

short PrfPt(short profile, short mode)

Page 45: MS-Tech CNC System Connection Manual - ACC MOTION …accmotionsolutions.com/virtualoffice_files/Programming Manual of... · 4 Acc-3200 series motion controllers are developed for

45

Function Set an axis as PT mode Execution Executed immediately Parameters profile: profile No. positive integer

mode: Set the FIFO mode of PT mode. “PT_MODE_STATIC” is the static mode(default mode) of FIFO; “PT_MODE_DYNAMIC” is the dynamic mode of FIFO

Return value Return1:if specified axis is in profile motion , recall the command after calling GT_Stop Others: Please refer to summary of return values

Related commands

short PrfPvt(short profile)

Function Set an axis as PVT mode Execution Executed immediately Parameters profile: profile No. positive integer

Return value Return1:if specified axis is in profile motion , recall the command after calling GT_Stop Others: Please refer to summary of return values

Related commands

short PrfTrap(short profile)

Function Set an axis as point to point mode Execution Executed immediately Parameters profile: profile No. positive integer

Return value Return1:if specified axis is in profile motion , recall the command after calling GT_Stop Others: Please refer to summary of return values

Related commands

short ProfileScale(short axis, short alpha, short beta)

Function Set the profile scale of axis. Attention : the value of “alpha” is larger than “beta”

Execution Executed immediately Parameters profile: profile No. positive integer

alpha: alpha value of profile scale,from -32768 to 32767, beta: beta value of profile scale,from -32768 to 32767,

Return value Return1:if specified axis is in profile motion , recall the command after calling GT_Stop Others: Please refer to summary of return values

Related commands EncScale

short PtClear(short profile, short fifo)

Function Clear FIFO data. This command is invalid when the axis is in motion or the FIFO memory is in dynamic mode

Execution Executed immediately Parameters profile: profile No. positive integer

fifo: The FIFO which will be cleared off. The default value is 0. In

Page 46: MS-Tech CNC System Connection Manual - ACC MOTION …accmotionsolutions.com/virtualoffice_files/Programming Manual of... · 4 Acc-3200 series motion controllers are developed for

46

dynamic mode, this parameter is invalid,

Return value Return1: (1) if in static mode, check whether FIFO is used or in motion (2) if in dynamic mode, FIFO can not be cleared in motion (3) check whether current axis is in PT mode, if not, call GT_PrfPt Others: Please refer to summary of return values.

Related commands

short PtData(short profile, double pos, long time, short type, short fifo)

Function Add data to FIFO Execution Executed immediately Parameters profile: profile No. positive integer

pos: Ending position of segment, unit: pulse time: Ending time of segment, unit:pulse/ms type: Segments type “PT_SEGMENT_NORMAL” represents the normal segment (default type); “PT_SEGMENT_EVEN” represents constant speed segments; “PT_SEGMENT_STOP” represents the segment with ending velocity as zero. fifo: The FIFO which will be cleared off. The default value is 0. In dynamic mode, this parameter is invalid,

Return value Return1: (1) check whether space is smaller than 0, if yes, waiting for space bigger than 0; (2) check whether current axis is PT mode, if not, call GT_PrfPt to set current axis as PT mode. Others: Please refer to summary of return values

Related commands

short PtSpace(short profile, short *pSpace, short fifo)

Function Get the free space of FIFO Execution Executed immediately Parameters profile: profile No. positive integer

pSpace: Free space of FIFO memory fifo: The FIFO which will be cleared off. The default value is 0. In dynamic mode, this parameter is invalid,

Return value Return1: check whether current axis is PT mode, if not, call GT_PrfPt to set current axis as PT mode. Others: Please refer to summary of return values

Related commands

short PtStart(long mask, long option)

Function Start PT mode motion Execution Executed immediately Parameters mask: “mask” represents specified axis No., which will be started by bit.

Start the specified axis when the bit X is 1. option: “option” represents FIFO No. which will be used by axis in bit

Return value Return1: check whether there is data in FIFO of current axis , if not, add data . Others: Please refer to summary of return values

Related commands

Page 47: MS-Tech CNC System Connection Manual - ACC MOTION …accmotionsolutions.com/virtualoffice_files/Programming Manual of... · 4 Acc-3200 series motion controllers are developed for

47

short PvtContinuousCalculate(long count, double *pTime, double *pPos, double *pPercent, double velBegin, double *pVel)

Function Calculate the velocity in Percent description mode Execution Executed immediately Parameters count: Number of data points. This instruction is used to calculate the

velocity of each data point. The data points are not downloaded to the motion controller pTime: Time array of data points, unit: ms, length of array: count pPos: Position array of data points, unit: pulse, length of array: count pPercent: Percent array of data points, length of array: count from 0 to 100 velBegin: Start velocity, unit: pulse/ms pVel: Return the velocity of each data point, unit: pulse/ms

Return value Please refer to summary of return values

Related commands

short PvtPercentCalculate(long count, double *pPos, double *pVel, double *pPercent, double *pVelMax, double *pAcc, double *pDec, double *pTime)

Function Calculate the time in Continuous description mode Execution Executed immediately Parameters count: Number of data points. This instruction is used to calculate the

time of each data point. The data points are not downloaded to the motion controller pPos: Position array of data points, unit: pulse, length of array: count pVel: Velocity array of data points, unit: pulse/ms, length of array: count pPercent: Percent array of data points, length of array: count from 0 to 100 pVelMax: Max. velocity array of data points, unit: pulse/ms, length of array: count pAcc: Acceleration array of data points, unit: pulse/ms2, length of array: count pDec: Deceleration array of data points, unit: pulse/ms2, length of array: count pTime: Time array of data points, unit: ms, length of array: count

Return value Return1: (1) check whether current axis is PVT mode, if not, call GT_PrfPvt to set current axis as PVT mode; (2) .if the current axis is in motion, recall the command after calling GT_Stop; (3) Check whether number of transfer data exceed 1024. Others: Please refer to summary of return values

Related commands

short PvtStart(long mask)

Function Start motion Execution Executed immediately Parameters mask: “mask” represents the axis No., which will be started in Pvt mode by

bit. When bit X is 1, it means that the controller will start the corresponding axis

Return value Return1: (1)check whether the table is null. (2)check whether current axis is in PVT mode, if not, call GT_PrfPvt to set current axis as PVT mode; Others: Please refer to summary of return values

Related commands

Page 48: MS-Tech CNC System Connection Manual - ACC MOTION …accmotionsolutions.com/virtualoffice_files/Programming Manual of... · 4 Acc-3200 series motion controllers are developed for

48

short PvtStatus(short profile, short *pTableId, double *pTime, short count)

Function Get PVT Status Execution Executed immediately Parameters profile: profile No. Positive integer

pTableId:ID of the table in use pTime: Motion time of the axis, unit: ms count: Number of axis read

Return value Return1: check whether current axis is in PVT mode, if not, call GT_PrfPvt to set current axis as PVT mode; Others: Please refer to summary of return values

Related commands

short PvtTable(short tableId, long count, double *pTime, double *pPos)

Function Transfer data to the table in PVT description mode Execution Executed immediately Parameters tableId: table ID. Positive integer

count: Number of data points. 1024 memory blocks each table, and 1 memory block for 1 data point pTime: Time array of data points, unit: ms, length of array: count pPos: Position array of data points, unit: pulse, length of array: count

Return value Return1: (1)check whether current axis is in PVT mode, if not, call GT_PrfPvt to set current axis as PVT mode; (2)if current axis is in motion, recall the command after calling GT_Stop (3) check whether the number of data points is bigger than 1024 Others: Please refer to summary of return values

Related commands

short PvtTableComplete(short tableId, long count, double *pTime, double *pPos, double *pA, double *pB, double *pC, double velBegin, double velEnd)

Function Transfer data to the table in Complete description mode Execution Executed immediately Parameters tableId: table ID. Positive integer

count: Number of data points. 1024 memory blocks each table, and 1 memory block for 1 data point pTime: Time array of data points, unit: ms, length of array: count pPos: Position array of data points, unit: pulse, length of array: count pA,pB,pC: Working array, for internal use, length of array: count Users need not assign for the array velBegin: Start velocity, unit: pulse/ms velEnd: Terminal velocity, unit: pulse/ms

Return value Return1: (1)check whether current axis is in PVT mode, if not, call GT_PrfPvt to set current axis as PVT mode; (2)if current axis is in motion, recall the command after calling GT_Stop (3) check whether the number of data points is bigger than 1024 Others: Please refer to summary of return values

Related commands

Page 49: MS-Tech CNC System Connection Manual - ACC MOTION …accmotionsolutions.com/virtualoffice_files/Programming Manual of... · 4 Acc-3200 series motion controllers are developed for

49

short PvtTableContinuous(short tableId, long count, double *pPos, double *pVel, double *pPercent, double *pvelMax, double *pAcc, double *pDec, double *timeBegin)

Function Transfer data to the table in Continuous description mode Execution Executed immediately Parameters tableId: table ID. Positive integer

count: Number of data points. 1024 memory blocks each table, and 1 memory block for 1 data point pPos: Position array of data points, unit: pulse, length of array: count pVel: Velocity array of data points, unit: pulse, length of array: count pPercent: Percent array of data points, length of array: count Range of percent: [0,100] pVelMax: Max velocity array of data points, length of array: count pAcc: acceleration array of data points, unit: pulse, length of array: count pDec: deceleration array of data points, unit: pulse, length of array: count timeBegin: Start time, unit: ms

Return value Return1: (1)check whether current axis is in PVT mode, if not, call GT_PrfPvt to set current axis as PVT mode; (2)if current axis is in motion, recall the command after calling GT_Stop (3) check whether the number of data points is bigger than 1024 Others: Please refer to summary of return values

Related commands

short PvtTablePercent(short tableId, long count, double *pTime, double *pPos, double *pPercent, double *velBegin)

Function Transfer data to the table in percent description mode Execution Executed immediately Parameters tableId: table ID. Positive integer

count: Number of data points. 1024 memory blocks each table, and 1 memory block for 1 data point pTime: time array of data points, unit: pulse, length of array: count pPos: Position array of data points, unit: pulse, length of array: count pPercent: Percent array of data points, length of array: count Range of percent: [0,100] velBegin: Start velocity, unit: pulse/ ms

Return value Return1: (1)check whether current axis is in PVT mode, if not, call GT_PrfPvt to set current axis as PVT mode; (2)if current axis is in motion, recall the command after calling GT_Stop (3) check whether the number of data points is bigger than 1024 Others: Please refer to summary of return values

Related commands

short PvtTableSelect(short profile, short tableId)

Function Select the table Execution Executed immediately Parameters Profile:profile No. positive integer

tableId: table ID. Positive integer

Return value Return1: check whether the table is null.

Page 50: MS-Tech CNC System Connection Manual - ACC MOTION …accmotionsolutions.com/virtualoffice_files/Programming Manual of... · 4 Acc-3200 series motion controllers are developed for

50

Others: Please refer to summary of return values

Related commands

short Reset()

Function Reset the motion controller Execution Executed immediately Parameters Return value Please refer to summary of return values

Related commands

short RunThread(short thread)

Function Start a thread Execution Executed immediately Parameters Thread: thread number, the value from 0 to 31 Return value Return1:

(1) Check whether thread number is banded (2) Check whether corresponding data page is overflow Others: Please refer to summary of return values

Related commands

short SetAdcFilter(short adc, short filterTime)

Function Set the filter time parameter of adc input Execution Executed immediately Parameters adc: adc number, the value from 0 to 8

filterTime: time parameter of the digital input filter, from 1 to 50 Return value Please refer to summary of return values

Related commands

short SetAxisBand(short axis, long band, long time)

Function Set arrival error band.When the error between profile position and encoder position less than allowed scope, and the profile will be stopped, the arrival bit of motor will be set as 1.

Execution Executed immediately Parameters axis: axis number, positive integer

band: allowed scope. Unit: pulse time: Error band holding time, unit: 250us

Return value Please refer to summary of return values

Related commands

short SetBackLash(short axis, long compValue, double compChangeValue, long compDir)

Function Set the relative parameters of backlash compensation Execution Executed immediately Parameters axis: axis number, positive integer

compValue:The value of backlash compensation, 0 means disable backlash compensation, ranging in [0, 1073741824], unit: pulse

Page 51: MS-Tech CNC System Connection Manual - ACC MOTION …accmotionsolutions.com/virtualoffice_files/Programming Manual of... · 4 Acc-3200 series motion controllers are developed for

51

compChangeValue: The variation of backlash compensation, ranging in [0, 1073741824], unit: pulse/ms. If this parameter is 0 or no less than compValue, the compensation value would add to the profile position suddenly, without a gradually process compDir: The direction of backlash compensation: If compDir is 1: Only compensate for negative movement, compensation is added when the motor moves at the negative direction, compensation is not added when the motor moves at the positive direction. If compDir is 0: Only compensate for positive movement, compensation is added when the motor moves at the positive direction, compensation is not added when the motor moves at the negative direction

Return value Return 1:if current axis is in profile motion, recall the command after calling GT_Stop Please refer to summary of return values

Related commands

short SetCaptureMode(short encoder, short mode)

Function Set encoder capture mode, and start capture Execution Executed immediately Parameters encoder: encoder number, positive integer

mode: Encoder capture mode. “CAPTURE_HOME” (this macro is defined 1): home capture. “CAPTURE_INDEX” (this macro is defined 2): index capture. “CAPTURE_PROBE” (this macro is defined 3): probe capture. CAPTURE_HSIO0(this macro is defined 6): HSIO0 capture CAPTURE_HSIO1(this macro is defined 7): HSIO1 capture

Return value Please refer to summary of return values

Related commands GetCaptureMode

short SetCaptureRepeat(short encoder, short count)

Function Set encoder repeated capture, and start capture Execution Executed immediately Parameters encoder: encoder number, positive integer

count: Maximum capture times Return value Please refer to summary of return values

Related commands

short SetCaptureSense(short encoder, short mode, short sense)

Function Set sense value of encoder capture Execution Executed immediately Parameters encoder: encoder number, positive integer

mode: “mode” represents the encoder capture mode. “CAPTURE_HOME” (this macro is defined 1): home capture. “CAPTURE_INDEX” (this macro is defined 2): index capture. “CAPTURE_PROBE” (this macro is defined 3): probe capture sense: Capture sense. “0”: falling edge detection.

Page 52: MS-Tech CNC System Connection Manual - ACC MOTION …accmotionsolutions.com/virtualoffice_files/Programming Manual of... · 4 Acc-3200 series motion controllers are developed for

52

“1”: rising edge detection Return value Please refer to summary of return values

Related commands

short SetCardNo(short index)

Function Set motion card number Execution Executed immediately Parameters index: The current using motion controller No.

Its value range from 0 to 15 Return value Please refer to summary of return values

Related commands GetCardNo

short SetControlFilter(short control, short filterTime)

Function Set the index of PID parameters. Maximum value of index is 3. Execution Executed immediately Parameters control: control number. Positive integer

filterTime: Return value Please refer to summary of return values

Related commands

short SetCrdPrm(short crd, TCrdPrm *pCrdPrm)

Function Set parameters of the coordinate system Execution Executed immediately Parameters crd: Coordinate system ID, from 1 to 2

pCrdPrm:Set parameters of the coordinate system. typedef struct CrdPrm { short dimension; short profile[8]; double synVelMax; double synAccMax; short evenTime; short setOriginFlag; long originPos[8]; }TCrdPrm; dimension: dimension of the coordinate system, ranging in [1,4]. profile[8]: mapping relation of coordinate system and profile. Profile[0..7]: mapped to 1~8 profile axis. For example, if profile axis is not used in coordinate system, the value of profile[x] is 0; if profile axis1 is used as X axis, the value of profile[x] is 1. Similarity axis is 2, Z axis is 3, A axis is 4. Multi-profile axes are to be mapped to the same coordinate axis is not allowed. And a profile axis be mapped to different axes is not allowed too, otherwise ,the command return error. Coordinate system’s axis number ranges in [1,4]. synVelMax: maximum synthetical velocity of the coordinate system. If the velocity user input is bigger than the velocity, it will be limited at synVelMax. ranging in (0,32767), unit: pulse/ms synAccMax: maximum resultant acceleration of the coordinate system, If the acceleration user input is bigger than the acceleration, it will be limited at synAccMax. ranging in (0,32767), unit: pulse/(ms*ms).

Page 53: MS-Tech CNC System Connection Manual - ACC MOTION …accmotionsolutions.com/virtualoffice_files/Programming Manual of... · 4 Acc-3200 series motion controllers are developed for

53

setOriginFlag: it indicates whether the profile origin position needs to be specified, the parameter is used to set machining coordinate system which is from machine coordinate system. 0: no, origin is the current profile position; 1: yes, origin is the profile position given by originPos. originPos[8]: specify the profile position of origin

Return value Return 1: (1) If axis is in motion, recall the command after calling GT_Stop (2) Check whether profile is active, if not, return error (3) Check whether axis is mapped in coordinate system. Others: Please refer to summary of return values

Related commands GetCrdPrm

short SetCrdStopDec(short crd, double decSmoothStop, double decAbruptStop)

Function Set the resultant acceleration of smooth stop and emergency stop Execution Executed immediately Parameters crd: Coordinate system ID, from 1 to 2

decSmoothStop: Set resultant smooth stop acceleration, ranging in (0,32767), unit: pulse/ms

2.

decAbruptStop: Set resultant emergency stop acceleration, ranging in (0,32767), unit: pulse/ms

2

Return value Return 1: check whether current coordinate system have mapped axes. Others: Please refer to summary of return values

Related commands GetCrdStopDec

short SetDac(short dac, short *pValue, short count)

Function Set output voltage of dac Execution Executed immediately Parameters dac: dac number

pValue: Output voltage of dac. The value of “-32768” represents -10V, and “32767” represents +10V. count: represents how many dacs will be read

Return value Please refer to summary of return values

Related commands GetDac

short SetDiReverseCount(short diType, short diIndex, unsigned long *pReverseCount, short count)

Function Set initial value of digital input reverse times Execution Executed immediately

Parameters diType: Type of digital input. MC_LIMIT_POSITIVE (this macro is defined 0): positive limit. MC_LIMIT_NEGATIVE (this macro is defined 1): negative limit. MC_ALARM (this macro is defined 2): drive alarm. MC_HOME (this macro is defined 3): home. MC_GPI (this macro is defined 4): general input. MC_ARRIVE(this macro is defined 5) motor arrive(GTS-400-PX only) diIndex: Index of digital input. Value range : If diType= MC_LIMIT_POSITIVE, the value ranging in [1, 8]. If diType= MC_LIMIT_NEGATIVE, the value ranging in [1, 8]. If diType= MC_ALARM, the value ranging in [1, 8].

Page 54: MS-Tech CNC System Connection Manual - ACC MOTION …accmotionsolutions.com/virtualoffice_files/Programming Manual of... · 4 Acc-3200 series motion controllers are developed for

54

If diType= MC_HOME, the value ranging in [1, 8]. If diType= MC_GPI, the value ranging in [1,16]. If diType= MC_ARRIVE, the value ranging in [1,8]. pReverseCount: Initial value of digital input reverse times count: Set the number of digital input which will be set the initial value of reversing times. The default value is 1, and maximum value is 4.

Return value Please refer to summary of return values

Related commands GetDiReverseCount

short SetDo(short doType, long value)

Function Set digital output status Execution Executed immediately Parameters doType:Type of digital output.

MC_ENABLE (this macro is defined 10): servo on. MC_CLEAR (this macro is defined 11): clear alarm output. MC_GPO (this macro is defined 12): general output value: Status of digital output. By default, “1” represents high level and “0” represents low level

Return value Please refer to summary of return values

Related commands

short SetDoBit(short doType, short doIndex, short value)

Function Set digital output status Execution Executed immediately Parameters doType:Type of digital output.

MC_ENABLE (this macro is defined 10): servo on. MC_CLEAR (this macro is defined 11): clear alarm output. MC_GPO (this macro is defined 12): general output doIndex: Index of digital output. Value range : If doType = MC_ENABLE, the value ranging in [1, 8]. If doType = MC_CLEAR, the value ranging in [1, 8]. If doType = MC_GPO, the value ranging in [1, 16]. value: Status of digital output. By default, “1” represents high level and “0” represents low level

Return value Return 1: check whether the bit is connected with a axis, if do ,it can not output directly Please refer to summary of return values

Related commands

short SetDoBitReverse(short doType, short doIndex,short value,short reverseTime)

Function Set digital output status Execution Executed immediately Parameters doType:Type of digital output.

MC_ENABLE (this macro is defined 10): servo on.

Page 55: MS-Tech CNC System Connection Manual - ACC MOTION …accmotionsolutions.com/virtualoffice_files/Programming Manual of... · 4 Acc-3200 series motion controllers are developed for

55

MC_CLEAR (this macro is defined 11): clear alarm output. MC_GPO (this macro is defined 12): general output doIndex: Index of digital output. Value range : If doType = MC_ENABLE, the value ranging in [1, 8]. If doType = MC_CLEAR, the value ranging in [1, 8]. If doType = MC_GPO, the value ranging in [1, 16]. value: Status of digital output. By default, “1” represents high level and “0” represents low level reverseTime: The time that the value output level lasts, ranging in [0,32767], unit: 250μs

Return value Return 1: check whether the bit is connected with a axis, if do ,it can not output directly Please refer to summary of return values

Related commands

short SetEncPos(short encoder, long encPos)

Function Set encoder position Execution Executed immediately Parameters encoder: encoder number. Positive integer

encPos: position of encoder Return value Please refer to summary of return values

Related commands

short SetFollowEvent(short profile, short event, short masterDir, long pos )

Function Set the start condition of Following mode Execution Executed immediately Parameters profile: profile number. Positive integer

event: Start condition of following action. FOLLOW_ENENT_START(this macro is defined 1): start immediately after calling GT_FollowStart. FOLLOW_EVENT_PASS(this macro is defined 2): start when master axis pass “pPos” masterDir: Motion action of master axis. 1: master axis motion forward -1: slave axis motion backward pos: “Pos” is the position which is set by user, the slave axis will startup the following action. Unit: pulse Only when the “pEvent” is “FOLLOW_EVENT_PASS”, the “pPos” is effective

Return value Return 1:check whether motion mode is Following mode, if not, call GT_PrfFollow to set specified axis as Following mode. Others: Please refer to summary of return values

Related commands GetFollowEvent

Page 56: MS-Tech CNC System Connection Manual - ACC MOTION …accmotionsolutions.com/virtualoffice_files/Programming Manual of... · 4 Acc-3200 series motion controllers are developed for

56

short SetFollowLoop(short profile, long loop )

Function Set the cycle numbers Execution Executed immediately Parameters profile: profile number. Positive integer

loop: Set cycle numbers of axis executed the Following mode Its value ranging in [-32768,32767]. Attention: loop less than 1 indicate infinite loop

Return value Return 1:check whether motion mode is Following mode, if not, call GT_PrfFollow to set specified axis as Following mode. Others: Please refer to summary of return values

Related commands GetFollowLoop

short SetFollowMaster(short profile, short masterIndex, short masterType, short masterItem )

Function Set the information of master axis Execution Executed immediately Parameters profile: profile number. Positive integer

masterIndex: The index of master axis. Positive integer For GTS-400-PG/PV series controller , ranging in [1,4]. For GTS-800-PG/PV series controller , ranging in [1,8]. Index of master axis can not be same with index of profile, it is recommended to set the index of master axis smaller than the index of profile. for example: master axis is axis 1, and profile axis is axis 2. masterType: The type of master axis FOLLOW_ENENT_PROFILE(this macro is defined 2) means that the type of master axis is profile axis, profile axis would follow the master axis’s profile position. FOLLOW_ENENT_ENCODER(this macro is defined 1) means that the type of master axis is encoder, profile axis would follow the master axis’s encoder position FOLLOW_ENENT_AXIS(this macro is defined 3) means that the type of master axis is axis, profile axis would follow the master axis’s axis output position masterItem: The type of synthetic axis Actived when masterType=FOLLOW_MASTER_AXIS. 0 represents output of profile position , default is 0. 1 represents output of encoder position

Return value Return 1: (1) check whether motion mode is in motion , if so, recall the command after calling GT_Stop (2) check whether specified axis is inFollowing mode, if not, call GT_PrfFollow to set specified axis as Following mode. Others: Please refer to summary of return values

Related commands GetFollowMaster

short SetFollowMemory(short profile, long memory )

Function Set the memory in follow mode Execution Executed immediately Parameters profile: profile number. Positive integer

memory: Storage sign of memory in Following mode. 0: buffer can store 16 segments data in Following mode 1: buffer can store 512 segments data in Following mode

Page 57: MS-Tech CNC System Connection Manual - ACC MOTION …accmotionsolutions.com/virtualoffice_files/Programming Manual of... · 4 Acc-3200 series motion controllers are developed for

57

Return value Return 1: (1)check whether motion mode is in motion , if so, recall the command after calling GT_Stop (2)check whether specified axis is in Following mode, if not, call GT_PrfFollow to set specified axis as Following mode. Others: Please refer to summary of return values

Related commands GetFollowMemory

short SetGearMaster(short profile, short masterIndex, short masterType, short masterItem )

Function Set the information of master axis Execution Executed immediately Parameters profile: profile number. Positive integer

masterIndex: The index of master axis. Positive integer For GTS-400-PG/PV series controller , ranging in [1,4]. For GTS-800-PG/PV series controller , ranging in [1,8]. Index of master axis can not be same with index of profile, it is recommended to set the index of master axis smaller than the index of profile. For example: master axis is axis 1,and profile axis is axis 2 masterType: Master axis type GEAR_MASTER_ENCODER (this macro is defined 2) means that the type of master axis is encoder, profile axis would follow the master axis’s encoder position. Default is the type GEAR_MASTER_PROFILE(this macro is defined 1) means that the type of master axis is profile axis, profile axis would follow the master axis’s profile position. GEAR_MASTER_AXIS (this macro is defined 3) means that the type of master axis is synthetic axis, profile axis would follow the master axis’s axis position, refer to the masterItem parameter masterItem: Synthetic axis type, Actived when masterType=GEAR_MASTER_AXIS. 0 means the profile position of synthetic axis 1 means the encoder position of synthetic axis

Return value Return 1: (1)check whether motion mode is in motion , if so, recall the command after calling GT_Stop (2)check whether specified axis is in Following mode, if not, call GT_PrfGear to set specified axis as Gear mode. Others: Please refer to summary of return values

Related commands GetGearMaster

short SetGearRatio(short profile, long masterEven, long slaveEven, long masterSlope)

Function Set the electronic gear ratio Execution Executed immediately Parameters profile: profile number. Positive integer

masterEven: The displacement of master axis. Positive integer,Unit:pulse slaveEven: The displacement of slave axis. Unit: pulse masterSlope: The displacement of clutch zone of master. Unit: pulse. cannot less than 0 or equal with 1

Return value Return 1:check whether motion mode is Gear mode, if not, call GT_PrfGear to set specified axis as Gear mode.

Page 58: MS-Tech CNC System Connection Manual - ACC MOTION …accmotionsolutions.com/virtualoffice_files/Programming Manual of... · 4 Acc-3200 series motion controllers are developed for

58

Others: Please refer to summary of return values

Related commands GetGearRatio

short SetJogPrm(short profile, TJogPrm *pPrm)

Function Set parameters of Jog mode Execution Executed immediately Parameters profile: profile number,positive integer

pPrm: Parameters of Jog mode , the parameter is a structure parameter, including 3 parameters, typedef struct JogPrm { double acc; double dec; double smooth; } TJogPrm;

acc: acceleration of Point to Point motion, positive integer, unit: pulse/ms2。 dec: deceleration of Point to Point motion, positive integer, unit: pulse/ms2, the value is same with acc if not be set

smooth:smooth coefficient. Ranging in[0,1], the large the value ,the stabler

the process Return value Return 1:

(1)If specified axis in motion, call this command after called GT_Stop() (2)check whether motion mode is Jog mode, if not, call GT_PrfJog to set specified axis as Jog mode Others: Please refer to summary of return values

Related commands GetJogPrm

short SetMtrBias(short dac, short bias)

Function Set the zero compensation value of dac Execution Executed immediately Parameters dac: dac number. Positive integer

bias: zero compensation value, its value ranging in[-32768,32767] Return value Please refer to summary of return values

Related commands GetMtrBias

short SetMtrLmt(short dac, short limit)

Function Set dac saturation limit Execution Executed immediately Parameters dac: dac number. Positive integer

limit: zero Set dac saturation limit. Its value ranges in (0,32767), if the

value is 32767, the permit rang of output voltage is -10V~10V. if be set 16384, the range of output voltage is -5V~5V

Return value Please refer to summary of return values

Related commands GetMtrLmt

short SetOverride(short crd, double synVelRatio)

Function Set the Programming resultant velocity Execution Executed immediately

Page 59: MS-Tech CNC System Connection Manual - ACC MOTION …accmotionsolutions.com/virtualoffice_files/Programming Manual of... · 4 Acc-3200 series motion controllers are developed for

59

Parameters crd: Coordinate system ID, from 1 to 2. synVelRatio: Target velocity rate, ranging in (0,1], default is 1

Return value Return 1: check whether specified coordinate system map to a axis Please refer to summary of return values

Related commands

short SetPid(short control, short index, TPid *pPid)

Function Set the parameters of PID Execution Executed immediately Parameters control: control number, positive integer

index: index of PID parameters, its value from 1 to 3. pPid: Parameters of PID typedef struct Pid { double kp; double ki; double kd; double kvff; double kaff; long integralLimit; long derivativeLimit; short limit; }TPid;

kp:scale gain;

ki:integral gain;

kd:differential gain;

kvff:parameter of velocity feed-forward

kaff:parameter of acceleration feed-forward integralLimit:integral

saturation limit

derivativeLimit:differential saturation limit

limit:saturation limit of control quantity;

Return value Others: Please refer to summary of return values

Related commands GetPid

short SetPos(short profile, long pos)

Function Set target position Execution Executed immediately Parameters profile: The index of profile axis. Positive integer

pos: Target position, unit: pulse .unit: pulse. Its value ranging in [-1073741823, 1073741823]

Return value Return 1: check whether current axis is in Trap mode, if not, call GT_PrfTrap to set as Trap mode Please refer to summary of return values

Related commands GetPos

Page 60: MS-Tech CNC System Connection Manual - ACC MOTION …accmotionsolutions.com/virtualoffice_files/Programming Manual of... · 4 Acc-3200 series motion controllers are developed for

60

short SetPosErr(short control, long error)

Function Set tracking error limit Execution Executed immediately Parameters control: The index of control axis. Positive integer

error: Tracking error limit, range: (0,2147483648], unit :pulse Return value Please refer to summary of return values

Related commands GetPosErr

short SetPrfPos(short profile, long prfPos)

Function Modify the profile position Execution Executed immediately Parameters profile: The index of profile axis. Positive integer

prfPos: profile position Return value Please refer to summary of return values

Related commands GetPrfPos

short SetPtLoop(short profile, long loop)

Function Set the cycle numbers. This command is invalid, when the FIFO memory is in dynamic mode

Execution Executed immediately Parameters profile: The index of profile axis. Positive integer

loop: Repeat times of PT mode. The loop mode is infinite loop when “loop” is 0, and the default value of “loop” is 0. In dynamic mode, this parameter is invalid

Return value Return 1 Check whether specified axis is PT mode, if not, call GT_PrfPt to set the axis as PT mode Others: Please refer to summary of return values

Related commands GetPtLoop

short SetPtMemory(short profile, short memory)

Function Set FIFO memory Execution Executed immediately Parameters profile: The index of profile axis. Positive integer

memory:“memory” is the sign of storage for each memory in PT mode. “0” represents the each memory can store 32 segments of PT data. When in dynamic mode, “0” represents 64. “1” represents the each memory can store 1024 segments of PT data. When in dynamic mode, “1” represents 2048

Return value Return 1: (1) If specified axis is in motion, recall the command after calling GT_Stop (2) Check whether specified axis is PT mode, if not, call GT_PrfPt to set the axis as PT mode Others: Please refer to summary of return values

Related commands GetPtMemory

short SetPvtLoop(short profile, long loop)

Page 61: MS-Tech CNC System Connection Manual - ACC MOTION …accmotionsolutions.com/virtualoffice_files/Programming Manual of... · 4 Acc-3200 series motion controllers are developed for

61

Function Set the number of loops Execution Executed immediately Parameters profile: The index of profile axis. Positive integer

loop: Number of loops. 0 denotes infinite loop Return value Return 1: check whether specified axis is PVT mode, if not , recall the

command after calling GT_PrfPvt Others: Please refer to summary of return values

Related commands GetPvtLoop

short SetSoftLimit(short axis, long positive, long negative)

Function Set soft limit Execution Executed immediately Parameters axis: axis number. Positive integer

positive: Positive soft limit. When profile position is greater than this value, the positive limit will be triggered. The default value: 0x7fffffff. Which means the positive soft limit is invalid negative: Negative soft limit. When profile position is less than this value, the negative limit will be triggered. The default value: 0x80000000. Which means the negative soft limit is invalid

Return value Please refer to summary of return values

Related commands

short SetStopDec(short profile, double decSmoothStop, double decAbruptStop)

Function Set smooth stop decelerability and emergency stop decelerability Execution Executed immediately Parameters profile: profile number. Positive integer

decSmoothStop: smooth stop decelerability,range: (0,32767] decAbruptStop: emergency stop decelerability,range: (0,32767]

Return value Please refer to summary of return values

Related commands GetStopDec

short SetStopIo(short axis, short stopType, short inputType, short inputIndex)

Function Set the input mode of smooth stop and emergency stop Execution Executed immediately Parameters axis: axis number. Positive integer

stopType: Stop mode

0:emergency stop

1:smooth stop

inputType: Digital input MC_LIMIT_POSITIVE(this macro is defined 0) positive limit MC_LIMIT_NEGATIVE(this macro is defined 1) negative limit MC_ALARM(this macro is defined 2) drive alarm MC_HOME(this macro is defined 3) home MC_GPI(this macro is defined 4) general input MC_ARRIVE(this macro is defined 5) motor arrive(GTS-400-PX only) inputIndex: Index of digital input, its range depends on inputType For GTS-800-PG/PV serial cards:

If inputType= MC_LIMIT_POSITIVE its value ranging in [1, 8];

If inputType= MC_LIMIT_NEGATIVE its value ranging in [1, 8];

Page 62: MS-Tech CNC System Connection Manual - ACC MOTION …accmotionsolutions.com/virtualoffice_files/Programming Manual of... · 4 Acc-3200 series motion controllers are developed for

62

If inputType= MC_ALARM its value ranging in [1, 8];

If inputType= MC_HOME its value ranging in [1, 8];

If inputType= MC_GPI its value ranging in [1, 16]。 For GTS-400-PG/PV serial cards:

If inputType= MC_LIMIT_POSITIVE its value ranging in [1, 4];

If inputType= MC_LIMIT_NEGATIVE its value ranging in [1, 4];

If inputType= MC_ALARM its value ranging in [1, 4];

If inputType= MC_HOME its value ranging in [1, 4];

If inputType= MC_GPI its value ranging in [1, 16];

If inputType= MC_ARRIVE its value ranging in [1, 4]。

Return value Please refer to summary of return values

Related commands

short SetTrapPrm(short profile, TTrapPrm *pPrm)

Function Set parameters of Point to Point mode Execution Executed immediately Parameters profile: profile number, positive integer

pPrm: Parameters of Point to Point mode typedef struct TrapPrm { double acc; double dec; double velStart; // short smoothTime; } TTrapPrm; Acc: acceleration. Positive data, unit: pulse/ms2 Dec: deceleration, Positive data, unit: pulse/ms2,

Velstart:start velocity, Positive data, unit “pulse/ms” Smooth time: smooth time, Positive integer, unit: ms, the larger the value is, the smoother the moderating process is.

Return value Return 1:Check whether current axis is in Trap mode, if not, call GT_PrfTrap to set as Trap mode Others:Please refer to summary of return values

Related commands GetTrapPrm

short SetUserSegNum(short crd, long segNum, short fifo=0)

Function set the user defined segment number Execution Executed immediately Parameters crd: Coordinate system ID from 1 to 2

segNum:The user defined segment number” fifo: The number of fifo that to be queried, ranging in [0,1], default is 0.

Return value Return 1: (1) Check whether current coordinate system is mapped to correspondent axes (2) Check whether data is transferred to fifo 1. If so, check whether fifo0 is used and in motion, if in motion, return error. (3) Check whether fifo is full. Others: Please refer to summary of return values.

Related commands GetUserSegNum

Page 63: MS-Tech CNC System Connection Manual - ACC MOTION …accmotionsolutions.com/virtualoffice_files/Programming Manual of... · 4 Acc-3200 series motion controllers are developed for

63

short SetVarValue(short page, TVarInfo *pVarInfo, double *pValue, short count=1)

Function Set the variable value of motion program Execution Executed immediately Parameters page: Data page ID and its value ranging in [0,31].

Global variable is -1; local variable ranging in [0,31] segNum:The user defined segment number” pVarInfo: Variable information. pValue: the value of variable which will be written. count: the value of variable which will be written.

Return value Please refer to summary of return values.

Related commands

short SetVel(short profile, double vel)

Function Set target velocity Execution Executed immediately Parameters profile: The index of profile axis. Positive integer

vel: Target velocity, unit: pulse/ms Return value Return 1:Check whether current axis is in Trap mode, if not, call

GT_PrfTrap to set as Trap Please refer to summary of return values

Related commands GetVel

short StepDir(short step)

Function Set step to be "pulse+dir" mode Execution Executed immediately Parameters Step: step number. Positive integer Return value Return 1:

(1) The axis is in motion, recall the command after calling GT_Stop (2) If the servo on, recall the command after calling GT_AxisOff Others: Please refer to summary of return values

Related commands

short StepPulse(short step)

Function Set step to be "cw/ccw" mode Execution Executed immediately Parameters Step: step number. Positive integer Return value Return 1:

(1) The axis is in motion, recall the command after calling GT_Stop (2) If the servo on, recall the command after calling GT_AxisOff Others: Please refer to summary of return values

Related commands

short Stop(long mask, long option)

Function Stop one or more axes’ profile motion, stop the interpolation motion Execution Executed immediately Parameters mask: “mask” represents specified axis No. or coordinate No.,which will be

stopped by bit. Stop the specified axis or coordinate when the bit X is 1

Page 64: MS-Tech CNC System Connection Manual - ACC MOTION …accmotionsolutions.com/virtualoffice_files/Programming Manual of... · 4 Acc-3200 series motion controllers are developed for

64

option: “option” represents specified axis No. or coordinate No., which will be stopped in smooth or sudden mode by bit.

Return value Please refer to summary of return values

Related commands

short StopThread(short thread)

Function Stop the running thread Execution Executed immediately Parameters thread: Thread number, and its value ranges in [0,31]. Return value Return 1:

(1) Check whether thread is bound (2) Check whether the data page is overflow Others :Please refer to summary of return values

Related commands

short SynchAxisPos(long mask)

Function Synchronize synthetic profile position with related profile manager Execution Executed immediately Parameters mask: axis No. which will be synchronized by bit.

If the value of bit X is 1, the corresponding axis needs synchronize its position If the value of bit X is 0, the corresponding axis needs not synchronize its position

Return value Return 1: check whether current axis is in motion, if do ,recall the command after calling GT_Stop. Others: Please refer to summary of return values

Related commands

short Update(long mask)

Function Start point to point motion or Jog motion Execution Executed immediately Parameters Mask : When the bit X =1, the corresponding axis will be invoked.

Bit 0 represents axis1, bit 1 represents axis 2, and so on. Return value Please refer to summary of return values

Related commands

short ZeroPos(short axis, short count)

Function Set profile position and encoder position as zero, and zero drift compensation.

Execution Executed immediately Parameters Axis: axis number. Positive integer

.count: “count” represents how many axes’ position will be cleared. Return value Return 1: check whether current axis is in motion, if do ,recall the command

after calling GT_Stop. Others: Please refer to summary of return values

Related commands