|
||
|
|
||
CAM Expert uses so called machine generators for specifying individual NC formats. A machine generator is a configuration file in the sub directory "machines" of CAM Expert. This file contains different sections which start with a line in squared brackets.
| Section | Description |
| [Description] | Brief description of the generator file |
| [Standards] | Standard values for general settings for sorting, optimizations, and other parameters. |
| [Parameter] | Machine dependent parameters. |
| [LayerParameter] | Machine dependent parameters which can have individual values for each layer. |
| [Code] | The code for all orders of this machine. |
Example
[Description]
{Machine generator for LASER cutting machine}
This section is just for your own information. Put your comments about this machine generator in this section. The section must be surrounded by curly braces.
Example
[Standards] Extension = NC ContourStartInHeader = 1 LayerStartInHeader = 0 Optimization = 1 ContourCenter = 0 Sorting = c Direction = n StartNumber = 10 NumberStep = 5 MaxArcAngle = 0 MaxArcLength = 0 Tolerance = 0.001 Digits = 2 Factor = $c LineLength = 100
In this section you can define standard values for some general conversion options. The following table describes all options more detailed.
| Option Name | Description |
| Extension | File extension for the output. E.g. "NC". |
| ContourStartInHeader | Defines, if the program header in the [Code] section contains the start of the first contour or not. It can be useful to define the contour start of the first contour in the header if it is different than the other contour starts. This value must be '1' or '0'. |
| LayerStartInHeader | Defines, if the program header in the [Code] section contains the start of the first layer or not. It can be useful to define the layer start of the first layer in the header if it is different than the other layer starts. This value must be '1' or '0' |
| Optimization | Standard setting for optimization. '1'=on, '0'=off. Changeable by the user. |
| ContourCenter | Standard setting for cutting the contours from their center. '1'=on, '0'=off. Changeable by the user. |
| Sorting | Standard setting for sorting. 'n'=No sorting, 'a'=Layers in alphabetic order, 'l'=Layer after layer, 'c'=Contours from inside to outside. Changeable by the user. |
| Direction | Standard setting for contour direction. 'n'=No special direction, '2'=Clockwise, '3'=Counter-clockwise, 's'=Longer side first. Changeable by the user. |
| StartNumber | Start number for numbering the NC program. |
| NumberStep | Step between the numbers of the NC program. |
| MaxArcAngle | The maximum angle arcs can have. Some machines don't allow arcs which have more then 180 degrees. You can limit the angle to any desired value. All arcs which have a bigger angle get divided into smaller arcs. A value of zero means that there's no limit for angles. |
| MaxArcLength | The maximum length arcs can have. Usually this option is used for machines which can't make arcs at all. The NC order used for arcs can be an order for a straight line in such cases. If you choose the maximum angle length to be very small, arcs will be formed with lots of small straight lines. |
| Tolerance | The maximum gap between elements of the same contour. It's usually no good idea to type zero here because there's mostly a very small gap between elements. If there is a gap which is within this given tolerance, a small element is put between to build a bridge between the elements. |
| Digits | The number of digits coordinates should have after the point (decimal points). E.g. if the coordinate is 2.3567 and "Digits" has a value of '2', the NC program will contain the number 2.36. |
| Factor | Scale factor of the output. If the output format must be in a different unit or should be created with a different scale than the drawing, this value can be used. |
| LineLength | Use this option to force an equal line length for all lines. It has only an effect when used together with the Order <LineLength> which defines where in the line the spaces are inserted for filling it up. |
Some of these options can be changed by the user for every conversion in the CAM dialog. If you wish that the user can change even more options, you can type a parameter instead of a value. However, you need to define the parameter in the [Parameter] section below. For example if you wish that the user can choose the factor of the output for each conversion, type '$c' instead of a fixed value. Later in the [Parameter] section you need to define the parameter '$c' as the factor of the output.
Example
[Parameter] Parameter free $f Feedrate 150 200 300 400 500 1000 Parameter fixed $l Support_Layers No Yes Parameter free $c Factor 1 1/2 2 Parameter free $u Clearance 2.0 1.0 3.0 4.0 5.0
In this section you can define individual parameters. These parameters are shown in the left part of the CAM dialog. A typical definition of a parameter is:
Parameter free $f Feedrate 150 200 300 400 500 1000
The definition must start with "Parameter". Then follows "free" or "fixed". "free" means that the user can type whatever he wants. "fixed" allows the user only to choose a value from the given list. "$f" is the parameter variable. Wherever you wish to insert the parameter in this file, you can type this variable in exactly this form "$f". "Feedrate" is the label, shown for the user. It should be as short and significant as possible. Spaces are not allowed. You can use "_" (underscores) instead. "150" is the default value. It's used if the user doesn't change anything. Afterwards follows a list of other values the user can choose from. If the parameter is "fixed", the user can only choose from this list.
Please note that the parameter "$_" is reserved for the name of the current layer.
Example
[LayerParameter] LayerParameter free $d Cuttingdepth -0.2 -0.1 -0.25 LayerParameter fixed $p Include_Points Yes No
This section is very similar to the section [Parameter]. The only difference is that the user can choose different values for these parameter for each layer of the drawing. That's usually used is the different layers must be cut with different feed rates or in individual cutting depths.
Please note that the parameter "$_" is reserved for the name of the current layer.
The parameter "$_" was introduced with CAM Expert version 2.4.6. It's used to refer to the layer name of the current element. However, this parameter must be updated in an order using the order "<UpdateLayer>". This way you can for example control, if the parameter "$_" still contains the layer name of the last element in an "<OrderToolUp>" or already the layer name of the next element. Usually it is convenient to call "<UpdateLayer>" in the order "<OrderContourEnd>" or "<OrderToolUp>" or in the order in which you do the rapid movement between contours (e.g. "<OrderRapidMove>").
The parameter "$_" can be used to insert the name of the current layer or in if constructs to insert a code part only for certain layers. An example for the second use could be:
<if:$_=contour>Only do that for elements on layer "contour"</if>
This feature can have various uses. Some use two different layers for two spindles of your machine. Please note that for layer dependent values you can often use the layer parameters instead.
The parameters "$@" and "$#" can be used to insert the name or the path and name of the currently generated file. You can also use them in if-constructs to create file name dependent parts (not recommended). More likely you want to use the file extension in if-constructs to check for the chosen file type. It is stored in the parameter "$%".
That's the main section of a machine configuration. It contains the definitions for all orders for the output file. An order is defined in the form:
OrderName
{...}
There are four types of orders: predefined orders, special orders, standard orders and additional orders. To make the whole section more clear, it's often a good idea to create your own additional orders which can then be included inside the other orders.
Predefined Orders
The following table shows the predefined orders which are used very often in other orders. Note: relative coordinates relate to the current position.
| Order Name | Description |
| <NewLine> | Makes a linefeed in the output file at this place. Please note, that making a linefeed in the configuration file, doesn't automatically result in a linefeed in the output file. |
| <Number> | Inserts the current number. This number starts with the given start number in the [Standards] section and gets increased by the given number step on each use. |
| <X1Abs> <Y1Abs> | The start point of the current element in absolute coordinates. |
| <X2Abs> <Y2Abs> | The end point of the current element in absolute coordinates. |
| <X1Rel> <Y1Rel> | The start point of the current element in relative coordinates. |
| <X2Rel> <Y2Rel> | The end point of the current element in relative coordinates. |
| <IAbs> <JAbs> | The center point of the current arc/ circle in absolute coordinates. |
| <IRel> <JRel> | The center point of the current arc/ circle in relative coordinates. |
| <A1> <A2> | Start and end angle of the current arc in degrees. |
| <A> | Angle amount of the current arc. |
| <Radius> | Radius of the current arc/ circle. |
| <Diameter> | Diameter of the current arc/ circle. |
| <MinX> | Left border coordinate of the current element. |
| <MaxX> | Right border coordinate of the current element. |
| <MinY> | Bottom border coordinate of the current element. |
| <MaxY> | Top border coordinate of the current element. |
| <UpdateLayer> | This order doesn't actually insert any code. It's used to update the special parameter "$_" which is described in detail above. |
| <FillLine> | This order is used to achieve an equal line length
for every line. The line length can be set using the option "LineLength" in
section [Standards].
E.g.: If you want to achieve that all lines get filled up with spaces in the end of the line up to a length of 100 characters, you can define your own line feed order which would look like that: MyNewLine {<FillLine><NewLine>} Then call <MyNewLine> instead of <NewLine> for line breaks in other orders. |
Special Orders
| Order Name | Description |
| <if:...>...</if> | This order pair is used to build an if
construct around other orders. If must contain a condition. If this
condition is true, the contents between <if:...> and </if>
is active. Otherwise it's not processed. Possible conditions are:
<if:poschanged1>...</if> Only processed if the start point of the current element differs from the current position. <if:poschanged2>...</if> Only processed if the end point of the current element differs from the current position. <if:contourbegin>...</if> Only processed if the current element is the first element of a contour. <if:contourend>...</if> Only processed if the current element is the last element of a contour. <if:contourmiddle>...</if> Only processed if the current element is not the first and not the last element of a contour. <if:$p=Yes>...</if> Only processed if the parameter (here: "$p") equals the string given at the right (here: "Yes"). <if:$n!=Blah>...</if> Only processed if the parameter (here: "$n") does not equal the string given at the right (here: "Blah"). |
| <mod:1>...</mod:1> | The string between this order pair
is only processed if it differs from the last processed string in
the same order pair. This is used for modal order parts which
remain active once they're used until an other order comes. For
example a G01 order remains active until a G02, G03 or G00 command
comes.
Valid numbers range from 1 to 9. Example: <mop:1>G01 </mod:1> |
| <delmod:1> | This order is used for resetting
a <mod:1>...</mod:1> order pair. For example it can be
used after a G02 if the G02 command deactivates a G01, G00 or G03
but doesn't stay active itself.
Valid numbers range from 1 to 9. Example: G02 <delmod:1> |
Standard Orders
Standard orders are called by CAM Expert. You need to define at least some of these orders to get a convenient result.
| Order Name | Description |
| <OrderProgramStart> | Called before the first element. With this order the machine
must be made ready for cutting the first element. It must move to the first coordinate (usually
done with a call of <OrderRapidMove>) and move the tool down (call of <OrderToolDown>)
Example: OrderProgramStart {N<Number> M05 <NewLine>N<Number> G90 <NewLine>N<Number> G00 X0.0 Y0.0 <OrderRapidMove> <OrderToolDown>} |
| <OrderProgramEnd> | Called after the last element. This order must bring the
machine to it's initial status.
Example: OrderProgramEnd {<NewLine>N<Number> G00 Z100.0 <NewLine>N<Number> M30 <NewLine>} |
| <OrderLayerStart> | Called before every element which is on
a different layer than the last one. Use this order to change layer dependent
settings. E.g. you can change the feed rate to the feed rate of the new layer.
Example (Let's suppose $l is a parameter which lets the user choose whether he wants to support layers ("Yes") or not ("No") and $f is a layer dependent parameter for the feed rate): OrderLayerStart OrderLayerStart {<if:$l=Yes> <NewLine>N<Number> F$f</if>} |
| <OrderLayerEnd> | Called after the last element of a layer if the
next element is on a different layer. Maybe you want to put in a comment
to the program here.
Example: OrderLayerEnd OrderLayerEnd {<if:$l=Yes> <NewLine>N<Number> (Layer ends here)</if>} |
| <OrderContourStart> | Called if the current element is the first element
of a new contour. This order must contain all necessary orders to move to the
first point (usually <OrderRapidMove>) of the new contour and move the
tool down (usually <OrderToolDown>).
OrderContourStart {<OrderRapidMove> <OrderToolDown>} |
| <OrderContourEnd> | Called after the last element of a contour.
This order must contain all necessary orders to move the tool up (usually
<OrderToolUp>) or somehow else make the machine ready to rapidly move
to the start point of the next contour.
OrderContourEnd {<OrderToolUp>} |
| <OrderRapidMove> | Called between contours. Usually that's just a G00 to the new coordinate.
Example: OrderRapidMove {<NewLine>N<Number> G00 X<X1Abs> Y<Y1Abs>} |
| <OrderPoint> | Called for every point object. You might want to make a tool down followed
by a tool up for points or leave it empty if you don't want to process points at all.
Example: OrderPoint {<OrderContourStart> <OrderContourEnd>} |
| <OrderLine> | Called for every line object. Usually that contains a G01 order.
Example: OrderLine {<NewLine>N<Number><mod:1> G01</mod:1> X<X2Abs> Y<Y2Abs>} |
| <OrderArcCW0_180> | Called for every clockwise arc object with a total angle of
less than 180 degrees. Usually a G02.
Example: OrderArcCW0_180 {<NewLine>N<Number> G02<delmod:1> X<X2Abs> Y<Y2Abs> R<Radius>} |
| <OrderArcCW180_360> | Called for every clockwise arc object with a total angle of
more than 180 degrees. On some machines this must be a G12 if the arc is radius-programmed.
Example: OrderArcCW180_360 {<NewLine>N<Number> G12<delmod:1> X<X2Abs> Y<Y2Abs> R<Radius>} |
| <OrderArcCW> | Called for every clockwise arc object. This order is only
called if the orders <OrderArcCW0_180> and <OrderArcCW180_360> are not defined.
Example: OrderArcCW {<NewLine>N<Number> G02<delmod:1> X<X2Abs> Y<Y2Abs> I<IRel> J<JRel>} |
| <OrderArcCCW0_180> | Called for every counter-clockwise arc object with a
total angle of
less than 180 degrees. Usually a G03.
Example: OrderArcCCW0_180 {<NewLine>N<Number> G03<delmod:1> X<X2Abs> Y<Y2Abs> R<Radius>} |
| <OrderArcCCW180_360> | Called for every counter-clockwise arc object with a total angle of
more than 180 degrees. On some machines this must be a G13 if the arc is radius-programmed.
Example: OrderArcCCW180_360 {<NewLine>N<Number> G13<delmod:1> X<X2Abs> Y<Y2Abs> R<Radius>} |
| <OrderArcCCW> | Called for every counter-clockwise arc object. This order is only
called if the orders <OrderArcCCW0_180> and <OrderArcCCW180_360> are not defined.
Example: OrderArcCCW {<NewLine>N<Number> G03<delmod:1> X<X2Abs> Y<Y2Abs> I<IRel> J<JRel>} |
| <OrderToolUp> | Never called by CAM Expert itself. Nevertheless, this order
can be useful to call in other orders like <OrderContourEnd>
OrderToolUp {<NewLine>N<Number> <mod:1> G00</mod:1> Z$u} |
| <OrderToolDown> | Never called by CAM Expert itself but might be useful
to call in other orders like <OrderContourStart>
OrderToolDown {<NewLine>N<Number> <mod:1> G01</mod:1> Z$d} |
Special Characters
As the special sign '$' is used in the configuration file to insert parameters, you need to type '$$' for writing one '$' sign in the output.
Further, the brackets ' {', ' }', ' <' and ' >' are used for formatting the configuration file. If you need to produce such brackets, you must type the substitutions from the following table. Please note also that multiple spaces result in just one space in the output. If you need to write more than one space, you must use the substitution for it.
| Sign | Substitution |
| { | &lbra; |
| } | &rbra; |
| < | ⟨ |
| > | ⟩ |
| ' ' (Space) | &spac; |
| Any character (printable or binary) | �   ... ÿ (The decimal code of the character) |
![]() ![]() ![]() ![]() ![]() |