This shows you the differences between two versions of the page.
Both sides previous revision Previous revision Next revision | Previous revision | ||
wiki:en:ppedit [2019/10/10 11:57] admin |
wiki:en:ppedit [2019/10/11 13:33] (current) admin [REPETITIONS (LOOPS)] |
||
---|---|---|---|
Line 197: | Line 197: | ||
- | You can read more about control codes in the section called | + | You can read more about control codes in the section called |
Line 225: | 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 231: | 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 238: | 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 244: | 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 | + | '' |
- | '' | + | |
- | + | ||
Line 280: | Line 279: | ||
If we want a pair of brackets to be repeated controlled by a parameter we write: | If we want a pair of brackets to be repeated controlled by a parameter we write: | ||
- | < | + | '' |
which means that the contents of the brackets will be repeated as many times as the contents of the parameter. | which means that the contents of the brackets will be repeated as many times as the contents of the parameter. | ||
Line 286: | Line 285: | ||
Instead of the name of a parameter we can write a calculation, | Instead of the name of a parameter we can write a calculation, | ||
- | ''< | + | '' |
- | < | + | '' |
- | <V1> \\ | + | '' |
- | < | + | '' |
==== Example ==== | ==== Example ==== | ||
Line 478: | 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 491: | 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 508: | 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: |