Cam Segment File Format (.dat)
Motion Sizer can export cam diagrams to .dat files and import cam diagrams from .dat files.
o.dat files are text files with UTF-8 encoding.
oThe end of line is encoded in Windows style by a CR LF (carriage return, line feed).
oThe dot (.) is used as decimal separator character for numbers. Double precision is used, as defined in https://msdn.microsoft.com/en-us/library/678hzkk9.aspx. Exponent notation is allowed (for example, 1.91446788459615E-05).
oInformation on the cam diagram itself (such as cycle time or x offset) is not included in the file.
o.dat files encode cam segments that are based on motion laws.
Cam segments with user-defined motion profiles are not supported.
o.dat files can only encode segments with consistent segment borders: The end point of one segment is identical to the start point of the next segment.
A .dat file consists of two types of data:
oHeader data in lines 1 and 2.
oSegment data in lines 3 and following. Each segment is described by 12 lines in the file. The number of lines of a .dat file is determined by the number of segments in the file.
.dat files contain one more section than segments in the cam diagram. This additional data block at the end of the file identifies the end point of the last segment of the cam diagram.
The following example shows the contents of a .dat file with two segments (encoded in three data blocks). It contains:
oHeader data (lines 1 and 2).
oData block 1 (lines 3...14) describes the first segment and its start point.
oData block 2 (lines 15...26) describes the second segment and its start point (which is also the end point of the first segment).
oData block 3 (lines 27...38) describes the end point of the second segment.
Line |
Content |
---|---|
1 |
Version=4.2 |
The header data in lines 1 and 2 of each .dat file contains the following information:
Line of .dat file |
Type of information |
Admissible values |
Description |
Example |
---|---|---|---|---|
1 |
Software identification |
Text |
Identifies the software version that was used to create this .dat file. |
Version=4.2 |
2 |
Number of data blocks |
An integer number ≥ 2 |
Identifies the number of data blocks that are included in this .dat file. This value corresponds to the number of cam segments in the cam diagram +1. The additional data block is used to describe the end point of the last segment (refer to the description of the segment data). |
2 |
Lines 3 and following of each .dat file define the individual cam segments. Each segment is described by a data block of 12 lines, plus one additional data block at the end of the file to describe the end point of the last segment. The number of segments is not restricted. Thus, the maximum number of lines of a .dat file is not restricted either.
X, Y, slope, and curvature of a data block describe the start point of the corresponding cam segment only. The end point of the cam segment is described by the values for X, Y, slope, and curvature of the next data block.
Each segment is described by 12 lines encoding the following information:
Lines of .dat file |
Type of information |
Admissible values |
Description |
Example |
---|---|---|---|---|
3, 15, 27, 39, ... |
Motion law |
ostraight for Straight line oquadparabel for Quadratic parabola osimplsin for Simple sine opoly5 for Polynomial of the 5th degree omodisin for Modified sine omodacctr for Modified acceleration trapezoid opoly5com for General polynomial of the 5th degree |
Identifies the motion law that applies to the cam segment. It depends on the motion law selected with this parameter, which of the following parameters are evaluated. In the last data block of a .dat file, this parameter is set to straight. |
simplsin |
4, 16, 28, 40, ... |
X |
A decimal number. |
Identifies the X coordinate of the start point of this cam segment and of the end point of the previous cam segment. In the last data block of a .dat file, this parameter identifies the X coordinate of the end point of the last cam segment. |
5 |
5, 17, 29, 41, ... |
Y |
A decimal number. |
Identifies the Y coordinate of the start point of this cam segment and of the end point of the previous cam segment. In the last data block of a .dat file, this parameter identifies the Y coordinate of the end point of the last cam segment. |
-10 |
6, 18, 30, 42, ... |
Slope |
A decimal number. |
Identifies the slope at the start point of this cam segment and at the end point of the previous cam segment. In the last data block of a .dat file, this parameter identifies the slope at the end point of the last cam segment. |
0 |
7, 19, 31, 43, ... |
Curvature |
A decimal number. |
Identifies the curvature at the start point of this cam segment and at the end point of the previous cam segment. In the last data block of a .dat file, this parameter identifies the curvature at the end point of the last cam segment. |
0 |
8, 20, 32, 44, ... |
Reserved |
0 |
Reserved for internal use only. If creating a file, set this value to 0. |
0 |
9, 21, 33, 45, ... |
Lambda |
A decimal number in range 0...1. |
Identifies the lambda parameter of this cam segment. In the last data block of a .dat file, the value is 0. |
0.5 |
10, 22, 34, 46, ... |
C |
A decimal number in range 0...1. |
Identifies the C parameter of this cam segment. In the last data block of a .dat file, the value is 0. |
1 |
11, 23, 35, 47, ... |
Start condition |
o0 for Dwell o1 for Velocity o2 for Return o3 for Motion |
Identifies the condition that applies at the start point of this segment. In the last data block of a .dat file, the value is 0. |
0 |
12, 24, 36, 48, ... |
End condition |
o0 for Dwell o1 for Velocity o2 for Return o3 for Motion |
Identifies the condition that applies at the end point of this segment. In the last data block of a .dat file, the value is 0. |
0 |
13, 25, 37, 49, ... |
Reserved |
0 |
Reserved. |
0 |
14, 26, 38, 50, ... |
Reserved |
0 |
Reserved. |
0 |
When you import a .dat file, Motion Sizer ignores the values of some parameters, depending on the selected motion law, start condition, and end condition. For further information, refer to the chapter Cam Diagrams.