Parameterized programming. Example 3: Personalised Macros G995-G999

The contents of the Macro, written in PELD programming (Programming Extended Language for DECO) will be entered in a special clients' file.
Swiss type machine high precision turning numerically controlled machine cam machine tools single spindles monospindles multiple spindles multispindles high precision parts lathes NC numerically controlled multi-spindles lathe multispindles machining
0

Tips and Tricks

Parameterized programming.
Example 3: Personalised Macros G995-G999

Technology
•  PNC
•  TB-DECO
•  Software Hotline
•  Tips and Tricks

We shall now program a recess with the aid of a Macro, as opposed to parameterized programming for one operation.

The contents of the Macro, written in PELD programming (Programming Extended Language for DECO) will be entered in a special clients' file.

For the machining operation, we only write the name of the Macro used, together with its parameters. It is the program itself that reads the ISO code within the Macro.

The big advantage of programming with macros is that it can be used not only several times within the same program, but also for any other program written for the same machine. The following example was executed for a DECO 13, but it can equally well be applied to a DECO 10, DECO 20/26 or a MULTIDECO.

The user may enter the following data using the parameters of Macro G995:
P1     Initial diameter.
P2     Feed diameter (base of recess).
P3     Depth of hobbing between each back movement.
P4     Rate of feed for the various hobbing passes.
P5     Feed for the final pass (finish).

Continuation of operations and contents of the Macro G995 parameters.

1)

P1    –► Initial diameter (mm)
Macro G995
2)

P3    –► Depth of hobbing between each back movement (mm)
P4    –► Feed value during hobbing (mm/t)
Macro G995
3)

0.1 mm back movement to crush the swarf
Macro G995
4)

#2206    –► Diameter at the base of the recess + 1 mm (blank)
Macro G995
5)

P2    –► Diameter at the base of the recess (finish)
P5    –► Feed value for finishing (mm/t)
Macro G995
6)

#2032    –► Back movement to bar diameter + safety distance
Macro G995


Program :

Program


Operation 1:6
G995 P1=10 P2=2.8 P3 P3=1 P4=0.04 P5=0.015

P1    –► Mandatory parameter.
P2    –► Mandatory parameter.
P3    –► Mandatory parameter.
P4    –► Optional parameter.
P5    –► Optional parameter.

If the optional parameters are not added after G995, then the default values will automatically be entered by the system.
P4=0,03 mm/t (default value)
P5=0,01 mm/t (default value)


Access path to the file containing the DECO 13 Macros reserved for clients clients :

C:/Documents and Settings/All Users/Application Data/Tornos/DECO_ADV/Macros Cust13aImp.peld is the file we shall be using to write our Macro G995. If you wish to write a macro for any other machine other than the DECO 13, you must select the Cust... file corresponding to the machine for which the Macro is written.

Access path

Remark: This file can also be found using the Windows "Search" function.

The figure below shows the file as it would appear before writing the Macro.
Macro


Macro G995 :
The following 4 lines are reserved for the Macro G995.

FUNCTION ON_G995()
BEGIN
    DPL_ALM(1039,"");
ENDFUNC;

Explanations :
FUNCTION ON_G995() –► Declaration of Macro G995
BEGIN –► Start of the Macro
DPL_ALM(1039,""); –► Defines the alarm message (see below) which will appear if you call up
          the Macro in the program, without having defined it beforehand.
  Macro
ENDFUNC; –► End of Macro


When writing the Macro, the DPL_ALM(1039,""); line must be replaced by the code written in red below.
FUNCTION ON_G995()
BEGIN
#2150:=GET_P_LIM (Inch, "G995", "P1=",1,16); // external diameter of the recess (between 1 and 16 mm)
#2151:=GET_P_LIM (Inch, "G995", "P2=",1,15); // diameter of the base of the recess (between 1 and 15 mm)
#2152:=GET_P_LIM (Inch, "G995", "P3=",0,4); // depth of pass (between 0 and 4 mm)
#2153:=CHECK_P (Inch, "P4=",0.03); // hobbing rate (mm/t) default value: 0.03 mm/t
#2154:=CHECK_P (Inch, "P5=",0.01); // finishing rate (mm/t) default value: 0. 01 mm/t
]  
G1 X1=#2150 G100  
[  
#2205:=#2150;  
#2206:=#2151+1;  
WHILE(#2205>#2206)DO  
]  
G1 X1=#2205 F#2153  
G1 X1=0.1 G100 G91  
G90  
[  
#2205:=#2205-#2152;  
ENDWHILE;  
]  
G1 X1=#2151 F#2154  
G1 X1=#2032 F.5  
[  
ENDFUNC;  



Studying the GET_P_LIM and CHECK_P functions

1. GET_P_LIM  
GET_P_LIM is a function that must contain 5 parameters. These parameters are symbolised by the letters a,b,c,d,e in the example below. This function allows you to test whether the Macro has a P parameter and its value. If there is no P parameter, an alarm will come on when generating the tables. P is a mandatory parameter.

  GET_P_LIM (a,"b","c=",d,e);
    a: Formatting
    b: Name of the macro
    c: Parameter number being tested
    d: Min. permitted value
    e: Max. permitted value


Description of the GET_P_LIM function applied to our example :

  GET_P_LIM (Inch, "G995", "P1=",1,16);
    a:    –► Inch. (this means that the value entered can be in inches)
    b:    –► G995
    c:    –► P1
    d:    –► 1
    e:    –► 16


  Remark: Parameter a: may adopt 2 other forms - Abso or Rnd. These parameters can be combined by using the | symbol (cross bar). For example, if the parameter has to be converted to inches and absolute values, you would write GET_P_LIM (Inch|Abso, "G995", "P1=",1,16);
● Abso means that the system only adopts the absolute value of the parameter entered.
● Rnd means that the system will round up/down the parameter entered to the nerest full value.




2.

CHECK_P
 
CHECK_P is a function that must contain 3 parameters. These parameters are symbolised by the letters a,b,c in the example below. This function enables you to test whether the Macro has a P parameter and its value. If there is no P parameter then no alarm will appear when generating the tables. P is an optional parameter.

  CHECK_P (a,"b",c);
    a: formatting
    b: parameter number being tested
    c: default value


Description of the CHECK_P function applied to our example :

  CHECK_P (inch,"P4=",0.03);
    a:    –► Inch (this means that the value entered can be in inches)
    b:    –► P4
    c:    –► 0.03



Remarks :

This Macro can be entered directly in the Cust13aImp.peld file or in another text editor, such as WordPad™ or Notepad™. With regard to "automatic formatting", it would be preferable to use Word™ software only. If you use a text editor, it is sufficient to Copy and Paste the text to the area earmarked in the Cust13aImp.peld file.

THINK PARTS THINK TORNOS

Home   Company   Applications   Products    Technology   Investor   News    Contacts    Download   Site Map  
privacy    -    copyright-disclaimer © 1997 - 2008   -   Tornos   -   eMail:
ascl.com
 
Think Parts Think TORNOS
Tornos
Think Parts Think TORNOS
TORNOS SA
Rue Industrielle 111
CH-2740 Moutier
Switzerland
Tel.: +41 (0)32 494-4444
Fax: +41 (0)32 494-4903
www.tornos.com
Tornos
ENGLISH
FRANÇAIS
DEUTSCH