0% found this document useful (0 votes)
2 views7 pages

Special Macro

The ADTECH9 Series CNC Programming Manual details extended special macro functions for CNC programming, including reading and writing workpiece and machine tool coordinates, setting speeds, and moving axes. It provides specific function descriptions, parameters, return values, and examples for each function, such as MOVEABS for single-axis movement and MOVEASC for multiple axes. Additionally, it covers reading and writing physical outputs and inputs, as well as waiting for motion completion and handling PLC interactions.

Uploaded by

phuchnd
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
2 views7 pages

Special Macro

The ADTECH9 Series CNC Programming Manual details extended special macro functions for CNC programming, including reading and writing workpiece and machine tool coordinates, setting speeds, and moving axes. It provides specific function descriptions, parameters, return values, and examples for each function, such as MOVEABS for single-axis movement and MOVEASC for multiple axes. Additionally, it covers reading and writing physical outputs and inputs, as well as waiting for motion completion and handling PLC interactions.

Uploaded by

phuchnd
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 7

ADTECH9 Series CNC Programming Manual

4.10 Extended special macro functions


4.10.1. RCOOR read workpiece coordinates
Function description: Read G54-G599 workpiece coordinates
Parameter: AXIS read axis No. 1-6 corresponding to
corresponding to
float RCOOR(INT8U AXIS,INT8U COOR)
Example: The program for reading the variable X-#100 in the G54 coordinates is as below:
#100=RCOOR[1,1]

4.10.2. RMACPOS read machine tool coordinates


Function description: Read machine tool
Parameter: AXIS No.
Returned value: It return the current machine to
float RMACPOS(INT8U AXIS)
Example: The program for reading the variable X-#100 in the machine tool coordinates is as below:
#100= RMACPOS[1]

4.10.3. WMACPOS write machine tool coordinates


Function description: Write tes
Parameter: AXIS NO. VAL writes coordinates Unit mm
Returned value 0
INT16U WMACPOS (INT8U AXIS,float VAL)
Example: The program for reading the variable X-#100 in the machine tool coordinates is as below:
#100=20 (the input value for the X mathine tool is 20)
WMACPOS [1,#100]

4.10.4. SPEEDS set interpolation speed


Function description: Set the interpolation speed
Parameter: STARTV initial speed of interpolation mm/min set to 0 in default
SPEEDV drive speed of interpolation mm/min set to 0 in default
Returned value 0
INT16U SPEEDS(INT32U START,INT32U speed)
Example: If the set initial interpolation speed is 200, the drive speed is 1500, the usage is as follows:
SPEEDS[200,1500]
ADTECH9 Series CNC Programming Manual

4.10.5. SPEEDA set positioning speed


Function description: Set positioning speed
Parameter: AXIS No.
STARTV the initial speed of AXIS mm/min set to 0 in default
SPEEDV the drive speed of AXIS mm/min set to 0 in default
Returned value 0
INT16U SPEEDA(INT8U AXIS,INT32U START,INT32U speed)
Example: Set No. 7 AXIS, the initial speed and running speed as 200 and 2000 respectively, as follows
SPEEDA[7,200,2000]

4.10.6. MOVEABS single axis moves to the machine


Function description: Single axis moving to the machine
POS mm Move osition
Parameter MODE: 0: Waiting for the end of the motion 1: Not waiting for the end of the motion
AXIS: Number of the motion axis
POS: Move the machine
Returned value: If correct, it returns 0; If error, it returns the value >1
INT16U MOVEABS(INT8U MODE,INT8U AXIS,float POS)
Example: set the position of , the program is as follows:
SPEEDA[7,200,2000] (Set the running speed)
MOVEABS[0,7,100]

4.10.7. MOVEREL relative moved position of single axis


Function description: Relative moved position of single axis AXIS Number of the moved single axis
POS mm Relatively moved position
Parameter: MODE: 0: wait for the end of the motion 1: not wait for the end of the motion
AXIS: Number of the motion axis
POS: Relatively moved position Unit: mm
Returned value: If correct, it returns 0; If error, it returns the value >1
INT16U MOVEREL (INT8U MODE, INT8U AXIS, float POS)

4.10.8. MOVEASA two axes


interpolation)
Function description: Two axes move to the machine
ADTECH9 Series CNC Programming Manual

Parameter MODE: Motion mode MODE motion mode (0: Positioning - wait for the end of the motion; 1:
interpolation - wait for the end of the motion; 2: positioning - not wait for the end of the motion; 3:
interpolation not wait for the end of the motion)
AXIS: A1: Number of the motion axis 1 P1: motion displacement 1 mm A2: Number of the motion axis
2 p2: motion displacement 2 mm
Returned value: If correct, it returns 0; If error, it returns the value >1
INT16U MOVEASA(INT8U MODE,INT8U A1,float P1,INT8U A2,float P2)

4.10.9. MOVERSA relative moved position of two axes (positioning or


interpolation)
Function description: Relative moved position of two axes
Parameter: MODE: Motion mode MODE motion mode (0: Positioning - wait for the end of the motion 1:
Interpolation - wait for the end of the motion 2: Posiioning - not wait for the end of the motion 3:
Interpolation - not wait for the end of the motion)
AXIS: A1: Number of the motion axis 1 P1: Motion displacement 1 mm A2: Number of the motion axis 2
p2: Motion displacement 2mm)
Returned value: If correct, it returns 0; If error, it returns the value >1
INT16U MOVERSA(INT8U MODE,INT8U A1,float P1,INT8U A2,float P2)

4.10.10. MOVEASB three axes


interpolation)
Function description: Three axes move to the machine
Parameter: MODE: Motion mode MODE motion mode (0: Positioning wait for the end of the motion 1:
Interpolation wait for the end of the motion 2: Positioning not wait for the end of the motion 3:
Interpolation not wait for the end of the motion)
AXIS: A1 Number of the motion axis 1 P1: Motion displacement 1mm A2: Number of the motion
axis
Returned value: If correct, it returns 0; If error, it returns the value >1

INT16U MOVEASB(INT8U MODE,INT8U A1,float P1,INT8U A2,float P2,INT8U A3,float P3)

4.10.11. MOVERSB Relative Position of Motion of Three axes


Function description: Relative position of motion of three axes
ADTECH9 Series CNC Programming Manual

Parameter MODE: Motion mode MODE motion mode (0: Positioning wait for the end of the motion 1:
Interpolation wait for the end of the motion 2: Positioning not wait for the end of the motion 3:
Interpolation not wait for the end of the motion)
AXIS: A1 Number of the motion axis 1 P1: Motion displacement 1mm A2: Number of the motion
axis
Returned value: If correct, it returns 0; If error, it returns the value >1
INT16U MOVERSB(INT8U MODE,INT8U A1,float P1,INT8U A2,float P2,INT8U A3,float P3)

4.10.12. MOVEASC absolute position of motion of multiple axes (positioning


or interpolation)
Function description: Absolute position of motion of multiple axes
Parameter: MODE: Motion mode MODE motion mode (0: Positioning wait for the end of the motion 1:
Interpolation wait for the end of the motion 2: Positioning not wait for the end of the motion 3:
Interpolation not wait for the end of the motion)
AXISTOTAL Total motion axis (pay attention to the six maximum a
parameter (for example, No. 1 axis Position 1 No. 2 axis Position 2 No. 3 axis Position 3)
Example: Two-axis motion MOVEASC[0,2,1,100,2,100]
Example: Three-axis motion MOVEASC[0,3,1,100,2,100,3,100]
Example: Four-axis motion MOVEASC[0,4,1,100,2,100,3,100,4,100]
Example: Five-axis motion MOVEASC[0,5,1,100,2,100,3,100,4,100,5,100]
Example: Six-axis motion MOVEASC[0,6,1,100,2,100,3,100,4,100,5,100,6,100]
Returned value: If correct, it returns 0; If error, it returns the value >1

4.10.13. MOVERSC relative position of motion of multiple axes (positioning or


interpolation)
Function description: Relative position of motion of multiple axes
Parameter: MODE: Motion mode MODE motion mode (0: Positioning wait for the end of the motion 1:
Interpolation wait for the end of the motion 2: Positioning not wait for the end of the motion 3:
Interpolation not wait for the end of the motion)
AXISTOTAL Total motion axis able
parameter (for example, No. 1 axis Position 1 No. 2 axis Position 2 No. 3 axis Position 3)
Example: Two-axis motion MOVEASC[0,2,1,100,2,100]
Example: Three-axis motion MOVEASC[0,3,1,100,2,100,3,100]
Example: Four-axis motion MOVEASC[0,4,1,100,2,100,3,100,4,100]
Example: Five-axis motion MOVEASC[0,5,1,100,2,100,3,100,4,100,5,100]
ADTECH9 Series CNC Programming Manual

Example: Six-axis motion MOVEASC[0,6,1,100,2,100,3,100,4,100,5,100,6,100]


Returned value: If correct, it returns 0; If error, it returns the value >1

4.10.14. WRITEOUT Write Physical Output


Function description: Write physical output (OUT)
Parameter NUM Port No. VALUE output level (0 or 1)
Returned value: If correct, it returns 0; If error, it returns the value >1
INT16U WRITEOUT(INT32U NUM,INT8U VALUE)

4.10.15. WRITELED Write Physical LED


Function description: Write physical LED
Parameter NUM: Port No. VALUE output level (0 or 1)
Returned value: If correct, it returns 0; If error, it returns the value >1
INT16U WRITELED(INT32U NUM,INT8U VALUE)

4.10.16. READOUT Read Physical Output


Function description: Read the status of physical output (OUT)
Parameter NUM: Port No.
Returned value: If correct, it returns 0 for low electrical level or 1 for high electrical level;If error, it returns the
value>1
INT16U READOUT(INT32U NUM)

4.10.17. READIN Read Physical Input


Function description: Read the status of Physical Input (IN)
Parameter NUM: Port No.
Returned value: If correct, it returns 0 for low electrical level or 1 for high electrical level;If error, it returns the
value>1
INT16U READIN(INT32U NUM)

4.10.18. READLED Read Physical LED


Function description: Read the output status of the physical LED
Parameter NUM: Port No.
ADTECH9 Series CNC Programming Manual

Returned value: If correct, it returns 0 for low electrical level or 1 for high electrical level;If error, it returns the
value>1
INT16U READLED(INT32U NUM)

4.10.19. MOVEWAITIN Search and Wait for the Input Signals in Motion
Function description: Search and wait for the IN signal to effectively stop in motion
Parameter AXIS: Number of the motion axis SPEEDV: Searching speed POS: Searching distance
(relative distance Unit mm) IN: Wait input signals TIMEOUT: timeout Unit ms wait continuously
when it is 0
Returned value: 0: Detect the IN stop the motion of the axis Timeout: 1 Error: Return>1
INT16U MOVEWAITIN(INT8U AXIS,INT32U SPEEDV,float POS,INT8U IN, INT32U TIMEOUT)

4.10.20. WAITMOVE Wait for the End of the Motion of All Axes
Function description: Wait for the end of the motion of all axes
Parameter: Number of the axis A1 A2 A3 and A4 after the end of motion (Note: Inputting 0 for A1, A2, A3
and A4 results to invalid axis which will not wait)
Returned value: If all axes end the motion, it returns 0; If error, it returns the value>1.
INT16U WAITMOVE(INT8U A1,INT8U A2,INT8U A3,INT8U A4)

4.10.21. WAITMOVED Wait for the End of Motion of All Axes


Function description: Wait for the end of the motion of all axes (Note: This function is used together with the
MOVExxx command and will err when it is used alone.)
Parameter: AXISTOTAL Total number of the axis that wait to end the motion (pay attention to the six
maximum axis
Eample: See below
WAITMOVE[1,2] Wait for No. 2 AXIS
WAITMOVE[2,2,3] Wait for No. 2 and No. 3 AXIS
WAITMOVE[3,4,5,6] Wait for No. 3, No. 4, No. 5 and No. 6 AXIS
WAITMOVE[4,1,2,3,5] Wait for No. 1, No. 2, No. 3 and No. 5 AXIS
WAITMOVE[5,1,2,3,5,6] Wait for No. 1, No. 2, No. 3, No. 5 and No. 6 AXIS
WAITMOVE[6,1,2,3,4,5,6] Wait for No. 1, No. 2, No. 3, No. 4, No. 5 and No. 6 AXIS
Returned value: If all axes end the motion, it returns 0; If it errs, it returns the value>1.
ADTECH9 Series CNC Programming Manual

4.10.22. WRITEPLC Write Physical or Auxiliary Output Point


Function description: Write the auxiliary point with the signal quantity interacting with PLC and larger than
1024
Parameter: NUM: Port No. VAL Output Signal value (0 or 1)
Note: (NUM<512 Write physical output point OUT)
(NUM >=1024 NUM < = 7999 write auxiliary point, which is the auxiliary point with the signal quantity
interacting with PLC)
Returned value: If correct, it returns 0; If error, it returns the value >1
INT16U WRITEPLC(INT32U NUM,INT8U VAL)

4.10.23. READPLC Read Physical or Auxiliary Output Point


Function description: Read physical or auxiliary output point
Note: (NUM < 512 Read physical input point)
(NUM >=1024 NUM < = 7999 Read auxiliary output point, which is the auxiliary point with the signal
quantity interacting with PLC)

If correct, it returns the auxiliary output coil value 0 or 1; If error, it returns value>1
INT16U READPLC(INT32U NUM)

4.10.24. WAITPLC Timeout Waiting for Read of Physical or Auxiliary Input


Point
Function description: Timeout waiting for read of physical or auxiliary input point
Parameter NUM physical input point 0-511 or the auxiliarypoint 1024-7999 with signal quantity interacting
with PLC VAL read effective value (0 or 1) TIMEOUT>0 Timeout (ms) 0 Wait continuously until the
signal is detected or [Press the Reset to quit]
Returned value In case of VAL, it returns 0 In case of no VAL after timeout, returns 1; In case of error, it
returns the value>1
INT16U WAITPLC(INT32U NUM,INT8U VAL, INT32U TIMEOUT)

4.11 Special M Code


M Code for axis synchronization and dynamic mapping

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy