This shows you the differences between two versions of the page.
Both sides previous revision Previous revision Next revision | Previous revision Last revision Both sides next revision | ||
wiki:en:ppedit [2019/10/10 11:34] admin [REPETITIONS (LOOPS)] |
wiki:en:ppedit [2019/10/11 13:33] admin [FAQ] |
||
---|---|---|---|
Line 1: | Line 1: | ||
- | ====== | + | ====== |
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 " | + | M-definitions or macros are used to " |
Line 77: | Line 77: | ||
The parameters are: | The parameters are: | ||
- | '' | + | ^Parameter^Description^ |
- | < | + | |< |
- | < | + | |< |
- | < | + | |< |
- | < | + | |< |
- | < | + | |< |
- | < | + | |< |
- | < | + | |< |
- | < | + | |< |
- | < | + | |< |
- | < | + | |< |
- | < | + | |< |
- | < | + | |< |
- | < | + | |< |
- | < | + | |< |
- | < | + | |< |
- | < | + | |< |
- | < | + | |< |
- | < | + | |< |
- | < | + | |< |
- | < | + | |< |
- | < | + | |< |
- | < | + | |< |
- | < | + | |< |
- | < | + | |< |
- | < | + | |< |
- | < | + | |< |
- | < | + | |< |
- | < | + | |< |
- | < | + | |< |
- | < | + | |< |
- | < | + | |< |
- | < | + | |< |
- | < | + | |< |
- | < | + | |< |
- | < | + | |< |
- | < | + | |< |
- | < | + | |< |
- | < | + | |< |
- | < | + | |< |
- | < | + | |< |
- | < | + | |< |
- | 0=Off 1=Left 2=Right | + | |< |
- | < | + | |< |
- | < | + | |< |
- | < | + | |< |
- | < | + | |< |
- | < | + | |< |
- | < | + | |< |
- | < | + | |< |
- | < | + | |< |
- | < | + | |< |
- | < | + | |< |
- | < | + | |< |
- | < | + | |< |
- | < | + | |< |
- | < | + | |< |
- | < | + | |< |
- | < | + | |< |
- | < | + | |< |
- | < | + | |< |
- | < | + | |< |
- | < | + | |< |
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. | ||
+ | {{: | ||
===== 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 our macro a special language is used which we have chosen to call "The Macro Language" | ||
- | M125 My own macro : | + | '' |
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 : | + | '' |
Inside the "" | Inside the "" | ||
- | M125 My own 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 "" | 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 "" | ||
- | M125 Print spindle rotation speed : < | + | '' |
Other control codes can be used to decide the appearance of a number | Other control codes can be used to decide the appearance of a number | ||
- | M125 Print out X : < | + | '' |
- | Below you will find a lists of control codes: | + | ==== Lists of control codes ==== |
- | #b end-of-block | + | ^Code^Description^ |
- | #nnn prints the asciisign | + | |#b |end-of-block| |
- | ## prints # | + | |#nnn |prints the ascii sign nnn (e.g. #003)| |
- | #" | + | |## |prints #| |
- | #x prints active parameter | + | |#" |
- | #$ | + | |#x |prints active parameter| |
- | #Dn | + | |#$ |prints active text parameter| |
- | #dn | + | |#Dn |max. n number of decimals (3)| |
- | (-1 =no decimal point) | + | |#dn |min. n number of decimals (-1 =no decimal point)| |
- | #Rt | + | |#Rt |fills in concluding zeros by t (ä = none)| |
- | (ä = none) | + | |#Hn |max. n-number of integers (9)| |
- | #Hn | + | |#hn |min. number of integers (1| |
- | #hn | + | |#Lt |fills in introductory zeros by t | |
- | #Lt | + | |#Pt |sign for decimal point (ä= no decimal point (.))| |
- | #Pt | + | |#Tt |sign at positive number (ä=none)| |
- | (ä= no decimal point (.)) | + | |#Nt |sign at negative number (-)| |
- | #Tt | + | |#Fn |fills in to the right to the number of positions with the sign indicated by #R (0).| |
- | #Nt | + | |
- | #Fn | + | |
- | You can read more about control codes in the section called | + | You can read more about control codes in the section called |
Line 226: | Line 225: | ||
It now remains to create the condition which will output code M66 the first time: | It now remains to create the condition which will output code M66 the first time: | ||
- | ''& | + | '' |
This means: //IF FLAG 25 IS NOT SET OUTPUT M66 AND SET FLAG 25.// | This means: //IF FLAG 25 IS NOT SET OUTPUT M66 AND SET FLAG 25.// | ||
Line 232: | Line 231: | ||
The flag being zero (not set) when we start the post processor the condition will be met the first time and since we use the & | The flag being zero (not set) when we start the post processor the condition will be met the first time and since we use the & | ||
- | '' | + | '' |
- | &F25(” M66”)'' | + | '' |
Notice that we use the | Notice that we use the | ||
Line 239: | Line 238: | ||
We can also indicate what we want to happen if the condition is not met (OR ELSE). If we want to change the macro for the change of tools so that M66 is output at the first change of tools and M67 (notice that this example is not necessarily logical but only used to explain the functions of the language) is output at all subsequent changes of tools we must add a pair of brackets to be executed if the condition is not met. This is done like this: | We can also indicate what we want to happen if the condition is not met (OR ELSE). If we want to change the macro for the change of tools so that M66 is output at the first change of tools and M67 (notice that this example is not necessarily logical but only used to explain the functions of the language) is output at all subsequent changes of tools we must add a pair of brackets to be executed if the condition is not met. This is done like this: | ||
- | ''& | + | '' |
This means: IF FLAG 25 IS NOT SET OUTPUT M66 OTHERWISE OUTPUT M67 AND SET THE FLAG. | This means: IF FLAG 25 IS NOT SET OUTPUT M66 OTHERWISE OUTPUT M67 AND SET THE FLAG. | ||
Line 245: | Line 244: | ||
After all types of conditions we can print an alternative pair of brackets separately with a comma sign to be executed if the first pair of brackets was not executed. Those who know some BASIC would picture the above line like this: | After all types of conditions we can print an alternative pair of brackets separately with a comma sign to be executed if the first pair of brackets was not executed. Those who know some BASIC would picture the above line like this: | ||
- | '' | + | '' |
- | PRINT ” M66” | + | '' |
- | ELSE | + | '' |
- | PRINT ” M67” | + | '' |
- | END IF \\ | + | '' |
- | F25=1 | + | '' |
- | '' | + | |
- | + | ||
- | ====== 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 < | 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 < | ||
Line 274: | Line 272: | ||
- | ====== 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 395: | Line 393: | ||
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: | ||
- | '' | + | '' |
- | : $V10< | + | '' |
- | $V11< | + | '' |
- | '' | + | |
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 479: | Line 477: | ||
Before: \\ | Before: \\ | ||
- | '' | + | '' |
After: \\ | After: \\ | ||
- | '' | + | '' |
//- How do I get a decimal point after all numbers, even integers? My machine requires this otherwise the numbers will be interpreted as thousandths. | //- How do I get a decimal point after all numbers, even integers? My machine requires this otherwise the numbers will be interpreted as thousandths. | ||
Line 492: | Line 490: | ||
Before: \\ | Before: \\ | ||
- | '' | + | '' |
- | M105 Set new Y-pos : & | + | '' |
- | M106 Set new Z-pos : & | + | '' |
After: \\ | After: \\ | ||
- | '' | + | '' |
- | M105 Set new Y-pos : & | + | '' |
- | M106 Set new Z-pos : & | + | '' |
It could be that coordinate values are written out in several places in the post processor and then you will have to find these and enter the code #d0 there too. | It could be that coordinate values are written out in several places in the post processor and then you will have to find these and enter the code #d0 there too. | ||
Line 509: | Line 507: | ||
Change the macros M6-M9 from looking like this: | Change the macros M6-M9 from looking like this: | ||
- | '' | + | '' |
- | : M108 M103 " G02" M104 M105 < | + | '' |
- | '' | + | '' |
- | '' | + | '' |
- | : M108 M103 " G03" M104 M105 < | + | '' |
- | '' | + | '' |
To look like this: | To look like this: | ||
- | '' | + | '' |
- | : M108 M103 " G02" M104 M105 < | + | '' |
- | M7 Clockwise arc > than 180° \\ | + | '' |
- | : M108 M103 " G02" M104 M105 < | + | '' |
\\ | \\ | ||
- | M8 C.Clockwise arc < than 180° \\ | + | '' |
- | : M108 M103 " G03" M104 M105 < | + | '' |
\\ | \\ | ||
- | M9 C.Clockwise arc > than 180° \\ | + | '' |
- | : M108 M103 " G03" M104 M105 < | + | '' |
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 538: | Line 536: | ||
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. |
- | '' | + | '' |
//-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 548: | Line 546: | ||
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: | ||
- | '' | + | '' |
- | I4 Y 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. | ||
- | '' | + | '' |
- | M105 Set new Y-pos : & | + | '' |
- | M106 Set new Z-pos : & | + | '' |
- | //-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 564: | Line 562: | ||
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" |
ANSWER: | ANSWER: |