DDCS V3.1 SUBPROGRAM - DDCSV3.1 Standalone CNC Motion Controller - Digital Dream Technology support
View: 4649|Reply: 4
Print Previous Topic Next Topic

DDCS V3.1 SUBPROGRAM

[Copy Link]

2

Threads

2

Posts

10

Credits

Newbie Member

Rank: 1

Credits
10
Jump to the specified floor
Landlord
Posted at 2021-7-15 21:44:16 | Only Author Replies reward |Descending browser |Read mode
Hi, I am learning DDCS v3.1. Can you tell me how I can call subroutines/subprograms in gcode? What should the subroutine/subprogram look like? I am asking for some examples
Reply

Use props Report

2

Threads

3

Posts

16

Credits

Newbie Member

Rank: 1

Credits
16
Sofa
Posted at 2021-7-21 16:44:55 | Only Author
I found this solution :

G90
G54
M98P1001
M30

O1001
G01Y-2
M98P1003
G01Y2
M99

But I don't know how to launch a subprogram out of my main file.
Reply Support Opposition

Use props Report

2

Threads

8

Posts

36

Credits

Newbie Member

Rank: 1

Credits
36
Bench
Posted at 2021-11-3 22:54:57 | Only Author
A subroutine is called in your Gcode file.  and is referring to a line number
Reply Support Opposition

Use props Report

2

Threads

8

Posts

36

Credits

Newbie Member

Rank: 1

Credits
36
Floor
Posted at 2021-11-3 23:05:04 | Only Author
Last edited by weitling In 2021-11-3 23:06 Editor

A subroutine is called in your Gcode file.  and is referring to a line number M98 start the subprogram and M99 return to the main program.

N5 M5 (Stop Spindel)
N10 M98 P100 (Call subprogram O100)
N15 G00 Z20 ( Goto Z safe)
M3 ( Start Spindel)
M30 (End of program)
O100 (O indicates that the subprogram start here)
N105 G38 2 (Probe command)
N110 M99 (Return to Main program N15)
I hope this helps
Reply Support Opposition

Use props Report

7

Threads

10

Posts

43

Credits

Newbie Member

Rank: 1

Credits
43
5#
Posted at 2021-11-5 10:28:45 | Only Author
I use M98 in most of my turning programs for my lathe. The following example calls the sub 5 times, cutting .005" each pass.

G20 (inches)
G91 (incremental)
G18 (xz plane)
M3 S1000 (start spindle 1000 rpm)
M98 P1234 L5 (call sub 5 times)
M5 (stop spindle)
M30 (end program)

O1234
G0 X.005 (cut depth)
G1 Z-2.500 F10 (turning)
G0 X-.005 (backout)
G0 Z2.500 (return to start)
G0 X.005 (back in)
M99 (end sub)

Reply Support Opposition

Use props Report

You need to log in before you can reply Login | Register now

This forum Credits Rules

Shenzhen Digital Dream Numerical Technology Co., Ltd. support
Adress:507,A Building,Leibo Industry Zone,No. 22 Jinxiu East Road,Kengzi Street,Pingshan district,Shenzhen City,P.R. of China
Phone:13244704799
E-mail:info@ddcnc.com

TEL

0755-87654321

Wchat

Website designed by DigitalDream Technology Support
Quick Reply Back to top Back to list