Welcome Back!
This is the second installment in our brief introduction to the SmartCAM Code Generator. If you haven’t done so yet, check out the first post here.
In this topic, we’ll be covering:
- Editing the machine file/Machine Define
- Numeric formats
Editing the machine file/Machine Define
In our previous post, we gave you a quick look at the .cgt and .smf files. These files contain information specific to your machine and its controller.
In an attempt to make editing the .smf easier, we also created the Machine Define app. This shows all the available questions in the .smf and allows you to edit them easily. In recent years, we have moved towards editing the .cgt directly so there are many questions that are no longer available in Machine Define but you can still edit that data directly in the .cgt. For example:
In Machine Define, Question 65 is shown as Deprecated:
Here you can see from the lsmill.cgt, that data is now in the @DECLARE section of the .cgt using the #FMT data type:
While there are still plenty of Questions you can use to format your machine file, editing the .cgt directly gives you more control. You will want to edit the .cgt file directly when you want to change settings for the tool you are using.
Numeric formats
Since different cnc machines use different numeric formats, SmartCAM lets you define the appropriate format needed in the .cgt file. The numeric format structure is as follows:
|
Data Format Type:
|
Sign Control (Optional): |
Digits allowed to the left and right of decimal: |
Field Width (Optional): |
Sign position (Optional): |
|
D: Decimal F: Filled T: Trailing L: Leading P: Padded Z: Zero W: Whole E: Everything
|
If a sign is required for output, add it in this position
|
These fields specify the size and accuracy of the numbers. Values are rounded to the appropriate accuracy during formatting. |
Specifies the width of the numeric field, for right justification of the formatted values. This is useful when the decimal points need to line up. SmartCAM fills the left of the field with space characters.
|
Determines the location of the sign character, as counted from the left. If you do not specify a value, SmartCAM positions the sign against the formatted value. A setting of 1 will place the sign character in the first column. |
To change the numeric format, you
can the update numeric format in the @DECLARE section of the .cgt. Here is an example. In
the lsmill.cgt file, the default value for the ToolNumber format is T2.0.
When you create code using that format, it outputs the code something like this:
However, if you change the ToolNumber format to T2.2:
…the code that is output would look more like this:
The following lists different expressions for the different formats. These are different expressions of 10.75.
Format Expression
D3.4 10.75
T3.4 107500
L3.4 01075
F3.4 0107500
P3.4 10.7500
E3.4 010.7500
We encourage you to use the default cgt files found in the default location C:\ProgramData\SmartCAM\Common\<product>\Machine to test editing the different settings and getting familiar with how different changes behave with your machines.
That’s it for editing the machine file/Machine Define and Numeric formats. We hoped you learned some new information! In our next post, we’ll look at:
- Variables, Commands and Functions
- Debugging
Please comment here or email us at CustomerServices@SmartCAMcnc.com if you have questions or would like us to write about anything specific.
No comments:
Post a Comment