Author Topic: DDCSV Control Language  (Read 3726 times)

Offline Will_D

  • Hero Member
  • *****
  • Posts: 668
  • Country: ie
    • National Homebrew Club of Ireland
DDCSV Control Language
« on: February 13, 2018, 10:14:52 AM »
AS you have seen from previous posts I have been trying to understand the control language that enhances G-Code.

I wrote a simple routine:

(Safe Block)
G17 G21 G90 G54 G40 G49 G80

(Read the current tool mechanical coordinate position i.e MACH workspace)
(#20 is X, #21 is Y, #22 is Z)

#20=#864
#21=#865
#22=#866

(I want things nice and slow)
F50.0

IF #22 LT 20 GOTO 1; If Z < 20
   G01 Y#21 - 10; Z is > 20 so Move Y minus 10
   GOTO 2

N1 G01 X#20 + 10; Z is < 20 so Move X plus 10
N2 M30
%


and it actually works!!

Next is to try to get subroutine calls working

BTW: I read on another forum that if you select a file on the memory stick and press start (i.e. the file is not loaded yet) you get the tool path window showing a simulation of the code!

Onwards and upwards
Engineer and Chemist to the NHC.ie
http://www.nationalhomebrewclub.ie/forum/

Offline Will_D

  • Hero Member
  • *****
  • Posts: 668
  • Country: ie
    • National Homebrew Club of Ireland
Re: DDCSV Control Language
« Reply #1 on: February 14, 2018, 07:44:05 AM »
How about loops:

(Safe Block)
G17 G21 G90 G54 G40 G49 G80

G00 X0.0 Y0.0 Z0.0

#11 = 3

F 50.0; Nice and slow

(Test Loop processing)

N5 WHILE #11 > 0 DO 13

   G01 X10.0

   G01 X0.0

   G04 P5000; 5 second delay

    #11 = #11-1;  The number of cycles decreases
END 13

M30
%


The above works a treat! :bugeye:
Engineer and Chemist to the NHC.ie
http://www.nationalhomebrewclub.ie/forum/

Offline Will_D

  • Hero Member
  • *****
  • Posts: 668
  • Country: ie
    • National Homebrew Club of Ireland
Re: DDCSV Control Language
« Reply #2 on: February 15, 2018, 07:51:27 AM »
And now here is a subroutine:

(Safe Block)
G17 G21 G90 G54 G40 G49 G80

(Investigate Subroutines)
 
(set initial X, Y  and Z)
G01 X0.0 Y0.0 Z0.0 F100

#1 = 3.888

G01 Z2.0
G01 X FIX[#1]; Round Down
G01 Y FUP[#1]; Round Up
G04 P5000; Little delay

(Note the above has nothing to do with testing the subroutine mechanism!!)

M98 P456 L3; Call subroutine 3 times

M30; End main Program
%

(Declare the Sub)
O456

G91
G01 X2.0 F50
G90
G04 P3000; Little delay

M99; End of Sub
%


Hope this helps

Cheers

Will

Engineer and Chemist to the NHC.ie
http://www.nationalhomebrewclub.ie/forum/

Offline Cosimo.83

  • Jr. Member
  • **
  • Posts: 9
  • Country: it
Re: DDCSV Control Language
« Reply #3 on: February 15, 2018, 01:03:32 PM »
Bravo..... Fantastico..... Hai provato a fare un probe e vedere se dentro al programma ti parte la sonda per ricercare lo zero pezzo e poi riparte? Tipo la torcia del plasma.... Grazie

Offline Will_D

  • Hero Member
  • *****
  • Posts: 668
  • Country: ie
    • National Homebrew Club of Ireland
Re: DDCSV Control Language
« Reply #4 on: February 16, 2018, 05:27:20 AM »
Engineer and Chemist to the NHC.ie
http://www.nationalhomebrewclub.ie/forum/