User Tools

Site Tools


wiki:en:ppedit

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
Next revision Both sides next revision
wiki:en:ppedit [2019/10/10 11:31]
admin
wiki:en:ppedit [2019/10/10 11:57]
admin
Line 1: Line 1:
-====== PPEdit ======+====== Post processor language ======
  
 We begin by looking at the different types of definitions accessible in the post processor file.  All definitions begin with a letter and then a number, the letter deciding what type of definition it is and the number being an address to distinguish between the definitions. We begin by looking at the different types of definitions accessible in the post processor file.  All definitions begin with a letter and then a number, the letter deciding what type of definition it is and the number being an address to distinguish between the definitions.
Line 57: Line 57:
 ===== MACROS (M) ===== ===== MACROS (M) =====
  
-M-definitions or macros are used to "bundle together" several instructions. A function which is to be used many times is normally written in a macro  which can then be used by other macros. There are a number of mandatory macros used by the CamModule for instance to introduce a program (M1) or to create an arc clockwise (M6). In addition to these the user could create his own macros, so-called  "User macros" (M101-M255). Such a macro could for instance contain the sequence for creating a block number or a change of tools.+M-definitions or macros are used to "bundle together" several instructions. A function which is to be used many times is normally written in a macro  which can then be used by other macros. There are a number of mandatory macros used by the software for instance to introduce a program (M1) or to create an arc clockwise (M6). In addition to these the user could create his own macros, so-called  "User macros" (M101-M255). Such a macro could for instance contain the sequence for creating a block number or a change of tools.
  
  
  Mandatory Macros  Mandatory Macros
  
-''M1 Programstart                          \\ +''%%M1 Programstart                          %%'' \\ 
- :<$file> "(Filname:#$)#b" <$date> "(Date:#$" <$time> \\ +''%%   :<$file> "(Filname:#$)#b" <$date> "(Date:#$" <$time> %%'' \\ 
-   "\ Time:#$)#b" <$progtxt> "(#$)#b" <xlength>           \\ +''%%     "\ Time:#$)#b" <$progtxt> "(#$)#b" <xlength>           %%'' \\ 
-   "(Partsize X:#x" <ylength>" Y:#x" <zlength>         \\ +''%%     "(Partsize X:#x" <ylength>" Y:#x" <zlength>         %%'' \\ 
-   " Z:#x)#b"<$prognr> "%#$" $F6                         \\ +''%%     " Z:#x)#b"<$prognr> "%#$" $F6                         %%'' \\ 
-'' + 
 ===== PARAMETERS ===== ===== PARAMETERS =====
  
Line 77: Line 77:
 The parameters are: The parameters are:
  
-''<xstarta>  Startpoint in X absolute \\ +^Parameter^Description^ 
-<ystarta>  Startpoint in Y absolute \\ +|<xstarta>  |Startpoint in X absolute| 
-<zstarta>  Startpoint in Z absolute \\ +|<ystarta>  |Startpoint in Y absolute| 
-<xstopa>    Endpoint in X absolute \\ +|<zstarta>  |Startpoint in Z absolute| 
-<ystopa>    Endpoint in Y absolute \\ +|<xstopa>    |Endpoint in X absolute| 
-<zstopa>    Endpoint in Z absolute \\ +|<ystopa>    |Endpoint in Y absolute | 
-<xstopi>    Endpoint in X incremental \\ +|<zstopa>    |Endpoint in Z absolute | 
-<ystopi>    Endpoint in Y incremental \\ +|<xstopi>    |Endpoint in X incremental | 
-<zstopi>    Endpoint in Z incremental \\ +|<ystopi>    |Endpoint in Y incremental | 
-<xcenta>    Centerpoint in X absolute \\ +|<zstopi>    |Endpoint in Z incremental | 
-<ycenta>    Centerpoint in Y absolute \\ +|<xcenta>    |Centerpoint in X absolute | 
-<xcenti>    Centerpoint in X incremental \\ +|<ycenta>    |Centerpoint in Y absolute | 
-<ycenti>    Centerpoint in Y incremental \\ +|<xcenti>    |Centerpoint in X incremental | 
-<zsnabbh>  Rapid travel height \\ +|<ycenti>    |Centerpoint in Y incremental | 
-<radie>    Arc radius \\ +|<zsnabbh>  |Rapid travel height | 
-<diamet>    Arc diameter \\ +|<radie>    |Arc radius | 
-<xradie>    Arc radius with X-scale \\ +|<diamet>    |Arc diameter | 
-<xdiamet>  Arc diameter with X-scale \\ +|<xradie>    |Arc radius with X-scale | 
-<yradie>    Arc radius with Y-scale \\ +|<xdiamet>  |Arc diameter with X-scale | 
-<ydiamet>  Arc diameter with Y-scale \\ +|<yradie>    |Arc radius with Y-scale | 
-<astartp>  Arc startangle (0° - 360°) \\ +|<ydiamet>  |Arc diameter with Y-scale | 
-<astopp>    Arc endangle  (0° - 360°) \\ +|<astartp>  |Arc startangle (0° - 360°) | 
-<astartm>  Arc startangle (-180° till +180°) \\ +|<astopp>    |Arc endangle  (0° - 360°) | 
-<astopm>    Arc endangle  (-180° till +180°) \\ +|<astartm>  |Arc startangle (-180° till +180°) | 
-<abow>      Arc total angle (-360° till +360°) \\ +|<astopm>    |Arc endangle  (-180° till +180°) | 
-<bnum>      Block number \\ +|<abow>      |Arc total angle (-360° till +360°) | 
-<feed>      Feed \\ +|<bnum>      |Block number | 
-<speed>    Rotation speed of spindle \\ +|<feed>      |Feed | 
-<spirot>    Rotation direction 0=Clockw. 1=Counter Clockw. \\ +|<speed>    |Rotation speed of spindle | 
-<toolnr>    Tool number \\ +|<spirot>    |Rotation direction 0=Clockw. 1=Counter Clockw. | 
-<tooldi>    Tool diameter \\ +|<toolnr>    |Tool number | 
-<toolra>    Tool radius \\ +|<tooldi>    |Tool diameter | 
-<toolle>    Tool length \\ +|<toolra>    |Tool radius | 
-<toolreg>  Tool register number \\ +|<toolle>    |Tool length | 
-<$tooltxt> Tool name \\ +|<toolreg>  |Tool register number | 
-<tooxnr>    Next tool number \\ +|<$tooltxt> |Tool name | 
-<tooxdi>    Next tool diameter \\ +|<tooxnr>    |Next tool number | 
-<tooxra>    Next tool radius \\ +|<tooxdi>    |Next tool diameter | 
-<tooxle>    Next tool length \\ +|<tooxra>    |Next tool radius | 
-<tooxreg>  Next tool register number \\ +|<tooxle>    |Next tool length | 
-<$tooxtxt> Next tool name \\ +|<tooxreg>  |Next tool register number | 
-<rkomp>    Cutter comp. \\ +|<$tooxtxt> |Next tool name | 
- 0=Off 1=Left 2=Right \\ +|<rkomp>    |Cutter comp. 0=Off 1=Left 2=Right | 
-<water>    Cool.water 0=Off 1=On \\ +|<water>    |Cool.water 0=Off 1=On | 
-<xlength>  Part X-length \\ +|<xlength>  |Part X-length | 
-<ylength>  Part Y-length \\ +|<ylength>  |Part Y-length | 
-<zlength>  Part Z-length \\ +|<zlength>  |Part Z-length | 
-<cyclnum>  Number of point in cycle \\ +|<cyclnum>  |Number of point in cycle | 
-<cyclend>  1 if last point in cycle \\ +|<cyclend>  |1 if last point in cycle | 
-<opval1>    Option value 1 (from option-window) \\ +|<opval1>    |Option value 1 (from option-window) | 
-<opval2>    Option value 2 \\ +|<opval2>    |Option value 2 | 
-<opval3>    Option value 3 \\ +|<opval3>    |Option value 3 | 
-<opval4>    Option value 4 \\ +|<opval4>    |Option value 4 | 
-<opval5>    Option value 5 \\ +|<opval5>    |Option value 5 | 
-<opval6>    Option value 6 \\ +|<opval6>    |Option value 6 | 
-<$optxt1>  Option text  1 (from option-window) \\ +|<$optxt1>  |Option text  1 (from option-window) | 
-<$optxt2>  Option text  2 \\ +|<$optxt2>  |Option text  2 | 
-<$optxt3>  Option text  3 \\ +|<$optxt3>  |Option text  3 | 
-<$date>    Date of today (from computer date) \\ +|<$date>    |Date of today (from computer date) | 
-<$time>    Time of day (from computer time) \\ +|<$time>    |Time of day (from computer time) | 
-<$file>    Filename \\ +|<$file>    |Filename | 
-<$prognr>  Program number \\ +|<$prognr>  |Program number | 
-<$progtxt> Program comments''+|<$progtxt> |Program comments|
  
 NB. It is possible to write the name of the parameter in capitals as well as small letters but we use small letters as our standard. NB. It is possible to write the name of the parameter in capitals as well as small letters but we use small letters as our standard.
Line 152: Line 152:
 It is important to understand the way the Cam program thinks when post processing a BEA file to enable you to produce a functioning post processor. Notice that the program does NOT read the macros in numerical order (M1,M2,M3 etc.) but jumps between these depending on which type of machining is involved. It is important to understand the way the Cam program thinks when post processing a BEA file to enable you to produce a functioning post processor. Notice that the program does NOT read the macros in numerical order (M1,M2,M3 etc.) but jumps between these depending on which type of machining is involved.
  
 +{{:wiki:en:ppedit:ppedit2.png|}}
    
 ===== THE MACRO LANGUAGE ===== ===== THE MACRO LANGUAGE =====
Line 157: Line 158:
 In our macro a special language is used which we have chosen to call "The Macro Language". In this language we can output parameters, perform calculations, set conditions, etc. We use different signs to do different things. It may look confusing to begin with but it will become clearer quite soon once you have begun working with the post processors. We will begin by describing how to output a simple text  in a macro. Text strings such as these are always initiated and concluded by a quotation mark ("). If we want to output the word Kalle in our nc-program by means of a macro called M125 we simply write: In our macro a special language is used which we have chosen to call "The Macro Language". In this language we can output parameters, perform calculations, set conditions, etc. We use different signs to do different things. It may look confusing to begin with but it will become clearer quite soon once you have begun working with the post processors. We will begin by describing how to output a simple text  in a macro. Text strings such as these are always initiated and concluded by a quotation mark ("). If we want to output the word Kalle in our nc-program by means of a macro called M125 we simply write:
  
-M125  My own macro :  KALLE+''%%M125  My own macro :  "KALLE"%%''
  
 We will try to write some macros of our own a little further on in this booklet. Remember that even the spaces are counted as long as they are found inside the quotation marks so if we want a space character after Kalle we will have to write it like this: We will try to write some macros of our own a little further on in this booklet. Remember that even the spaces are counted as long as they are found inside the quotation marks so if we want a space character after Kalle we will have to write it like this:
  
-M125  My own macro :  KALLE  +''%%M125  My own macro :  "KALLE  "%%''
  
 Inside the "" signs we can besides ordinary texts also insert special control codes to determine the appearance of the output. Control codes are always preceded by a # sign followed by a letter and sometimes digits, too. As an example of a control code can be adduced #b which implies row pitch or block end. If we want to output the text Kalle Andersson but we want these two words to end up each on its own line in the nc-program we simply write Inside the "" signs we can besides ordinary texts also insert special control codes to determine the appearance of the output. Control codes are always preceded by a # sign followed by a letter and sometimes digits, too. As an example of a control code can be adduced #b which implies row pitch or block end. If we want to output the text Kalle Andersson but we want these two words to end up each on its own line in the nc-program we simply write
  
-M125  My own macro :  KALLE#bANDERSSON+''%%M125  My own macro :  "KALLE#bANDERSSON"%%''
  
 Another control code is used to output the contents of a parameter and is called #x. This control code prints out the contents of the last-mentioned parameter. Mentioning a parameter implies printing it outside the "" signs. If, for instance, we want to print out an S followed by the number of spindle revolutions, we print the following macro: Another control code is used to output the contents of a parameter and is called #x. This control code prints out the contents of the last-mentioned parameter. Mentioning a parameter implies printing it outside the "" signs. If, for instance, we want to print out an S followed by the number of spindle revolutions, we print the following macro:
  
-M125 Print spindle rotation speed : <spirot>  S#x+''%%M125 Print spindle rotation speed : <spirot>  "S#x"%%''
  
 Other control codes can be used to decide the appearance of a number  at the output. An example could be #d indicating the minimum of decimals to be printed. If for instance, we want a macro that outputs the absolute x-value  with at least two decimals added, the macro will look like this: Other control codes can be used to decide the appearance of a number  at the output. An example could be #d indicating the minimum of decimals to be printed. If for instance, we want a macro that outputs the absolute x-value  with at least two decimals added, the macro will look like this:
  
-M125 Print out X : <xstopa>  X#d2#x+''%%M125 Print out X : <xstopa>  "X#d2#x"%%''
    
-Below you will find a lists of control codes: +==== Lists of control codes ====
  
-#b      end-of-block +^Code^Description^ 
-#nnn    prints the asciisign nnn (e.g. #003) +|#b      |end-of-block| 
-##      prints # +|#nnn    |prints the ascii sign nnn (e.g. #003)| 
-#"      prints " +|##      |prints #| 
-#x         prints active parameter +|#"      |prints "| 
-#$        prints active text parameter +|#x         |prints active parameter| 
-#Dn      max. n number of decimals (3) +|#$        |prints active text parameter| 
-#dn      min. n number of decimals  +|#Dn      |max. n number of decimals (3)| 
- (-1 =no decimal point) +|#dn      |min. n number of decimals (-1 =no decimal point)| 
-#Rt      fills in concluding zeros by t  +|#Rt      |fills in concluding zeros by t (ä = none)| 
- (ä = none) +|#Hn      |max. n-number of integers (9)| 
-#Hn      max. n-number of integers (9) +|#hn      |min. number of integers (1| 
-#hn      min. number of integers (1 +|#Lt      |fills in introductory zeros by t | 
-#Lt      fills in introductory zeros by t  +|#Pt      |sign for decimal point  (ä= no decimal point (.))| 
-#Pt      sign for decimal point   +|#Tt      |sign at positive number (ä=none)| 
- (ä= no decimal point (.)) +|#Nt      |sign at negative number (-)| 
-#Tt      sign at positive number (ä=none) +|#Fn      |fills in to the right to the number of positions with the sign indicated by #R (0).|
-#Nt      sign at negative number (-) +
-#Fn      fills in to the right to the number    of positions with the sign  indicated by #R (0).+
  
  
Line 253: Line 252:
 '' ''
    
-====== Examples ====== 
  
-====== SETTING VARIABLES AND FLAGS ======+ 
 +===== SETTING VARIABLES AND FLAGS =====
  
 The $-sign is used to set unconditionally a variable at a value or to set a flag. If for instance we want to set variable 10 with the contents of <xstope> we write: The $-sign is used to set unconditionally a variable at a value or to set a flag. If for instance we want to set variable 10 with the contents of <xstope> we write:
Line 274: Line 273:
  
  
-====== REPETITIONS (LOOPS) ======+===== REPETITIONS (LOOPS) =====
  
 By means of the *-character we can perform repetitions or loops as they are also called. By means of the *-character we can perform repetitions or loops as they are also called.
Line 290: Line 289:
 <5+toolnr> \\ <5+toolnr> \\
 <V1> \\ <V1> \\
-<V1+toolnr> \\ +<V1+toolnr> '' \\
-  +
-''+
  
 ==== Example ==== ==== Example ====
Line 358: Line 355:
 Besides checking if a parameter and a variable are equal we can also check if they are greater or smaller and then we write it like this: Besides checking if a parameter and a variable are equal we can also check if they are greater or smaller and then we write it like this:
  
-''<parameter> >>V5()'' +''%%<parameter> >>V5()%%'' 
  
 or  or 
  
-''<parameter> <<V5()''+''%%<parameter> <<V5()%%''
  
  
Line 369: Line 366:
 We can also use an integer and then we write it like this: We can also use an integer and then we write it like this:
  
-''<parameter> >>10()''+''%%<parameter> >>10()%%''
  
 meaning: IF THE PARAMETER IS GREATER THAN 10 CARRY OUT BRACKETS. meaning: IF THE PARAMETER IS GREATER THAN 10 CARRY OUT BRACKETS.
Line 375: Line 372:
 or or
  
-''<parameter> <<10()''+''%%<parameter> <<10()%%''
  
 IF THE PARAMETER IS LESS THAN 10 CARRY OUT THE BRACKETS IF THE PARAMETER IS LESS THAN 10 CARRY OUT THE BRACKETS
Line 397: Line 394:
 Then we can write a new macro calculating the X,Y coordinates according to the values input in V12 and V13: Then we can write a new macro calculating the X,Y coordinates according to the values input in V12 and V13:
  
-''M120 Calculate X, Y coordinates  \\ +''%%M120 Calculate X, Y coordinates %%'' \\ 
-  : $V10<V12*cos(V13)> \\ +''%%  : $V10<V12*cos(V13)>%%'' \\ 
-    $V11<V12*sin(V13)>  \\ +''%%    $V11<V12*sin(V13)> %%'' \\ 
-''+
 When calling macro 120 our coordinate will be found stored in V10 and V11. When calling macro 120 our coordinate will be found stored in V10 and V11.
  
Line 523: Line 520:
 To look like this: To look like this:
  
-''M6 Clockwise arc < than 180° \\ +''%%M6 Clockwise arc < than 180° %%'' \\ 
- : M108 M103 " G02" M104 M105 <radie> ” R#x” M101 M109 \\ +''%% : M108 M103 " G02" M104 M105 <radie> R#xM101 M109 %%'' \\ 
-M7 Clockwise arc > than 180° \\ +''%%M7 Clockwise arc > than 180° %%'' \\ 
- : M108 M103 " G02" M104 M105 <xcenti>" I#x" <ycenti>    " J#x" M101 M109 \\+''%% : M108 M103 " G02" M104 M105 <xcenti>" I#x" <ycenti>    " J#x" M101 M109 %%'' \\
  \\  \\
-M8 C.Clockwise arc < than 180° \\ +''%%M8 C.Clockwise arc < than 180° %%'' \\ 
- : M108 M103 " G03" M104 M105 <radie> ” R#x” M101 M109 \\+''%% : M108 M103 " G03" M104 M105 <radie> R#xM101 M109 %%'' \\
  \\  \\
-M9 C.Clockwise arc > than 180° \\ +''%%M9 C.Clockwise arc > than 180° %%'' \\ 
- : M108 M103 " G03" M104 M105 <xcenti>" I#x" <ycenti>    " J#x" M101 M109'' \\+''%% : M108 M103 " G03" M104 M105 <xcenti>" I#x" <ycenti>    " J#x" M101 M109%%'' \\
  
 Notice that your macros may not look exactly like the above and then of course you will have to consider this when changing your macros. Notice that your macros may not look exactly like the above and then of course you will have to consider this when changing your macros.
Line 540: Line 537:
 ANSWER: ANSWER:
  
-There is a position at the beginning of the post processor indicating where the nc-programs will be stored. This position is called I102. Enter the search way into the catalogue where you want to store your programs after the colon of  I102.+There is a position at the beginning of the post processor indicating where the NC-programs will be stored. This position is called I102. Enter the search way into the catalogue where you want to store your programs after the colon of  I102.
  
-''I102 File path  : c:\ncprog''+''%%I102 File path  : c:\ncprog%%''
    
 //-My machine writes all values in thousandths and without decimals. How do I fix this?// //-My machine writes all values in thousandths and without decimals. How do I fix this?//
Line 550: Line 547:
 Change the positions I3-I5 at the beginning of the post processor so that it says 1000 instead of 1 on these: Change the positions I3-I5 at the beginning of the post processor so that it says 1000 instead of 1 on these:
  
-''I3 X scale : 1000 \\ +''%%I3 X scale : 1000%%'' \\ 
-I4 Y scale : 1000 \\ +''%%I4 Y scale : 1000%%'' \\ 
-I5 Z scale : 1000'' \\+''%%I5 Z scale : 1000%%'' \\
  
 Then change the macros that write out the X,Y, Z values (usually M104-M106) so that it says #D0 in front of # in them. Then check if X, Y, Z-values are entered into any more positions of the post processor and change those too, if necessary. Then change the macros that write out the X,Y, Z values (usually M104-M106) so that it says #D0 in front of # in them. Then check if X, Y, Z-values are entered into any more positions of the post processor and change those too, if necessary.
  
-''M104 Set new X-pos             : &V1<xstopa>(" X#D0#x") \\ +''%%M104 Set new X-pos             : &V1<xstopa>(" X#D0#x")%%'' \\ 
-M105 Set new Y-pos             : &V2<ystopa>(" Y#D0#x") \\ +''%%M105 Set new Y-pos             : &V2<ystopa>(" Y#D0#x")%%'' \\ 
-M106 Set new Z-pos             : &V3<zstopa>(" Z#D0#x")'' \\+''%%M106 Set new Z-pos             : &V3<zstopa>(" Z#D0#x")%%'' \\
  
-//-I want my first change of tools to look different from the subsequent ones in my nc-program. Can I change this?//+//-I want my first change of tools to look different from the subsequent ones in my NC-program. Can I change this?//
  
 ANSWER: ANSWER:
Line 566: Line 563:
 Yes, look up the section on conditions at the beginning of this booklet. A similar case is described there. Yes, look up the section on conditions at the beginning of this booklet. A similar case is described there.
  
-''- I have problems when I want to test-run my post processor. A red square appears where it says "Wrong character"  or "Macro M99 missing" or suchlike. What is to be done?''+//- I have problems when I want to test-run my post processor. A red square appears where it says "Wrong character"  or "Macro M99 missing" or suchlike. What is to be done?//
  
 ANSWER: ANSWER:
wiki/en/ppedit.txt · Last modified: 2019/10/11 13:33 by admin