SMC_GEOINFO (STRUCT)

 

TYPE SMC_GEOINFO : STRUCT

This data type is designed to store a path object, i.e. a segment of the programmed path, for example a line, arc or spline segment. In addition to the geometry of these objects, further information can be stored as for example the velocity at the beginning/end of the path or as labels.

Note

As from V3.5 SP2 of the programming system, iSourceLine_No stores the line number of the CNC word and the sentence number is stored in diSentenceNo. In former versions, in particular CODESYS V2.3, the sentence number has been stored in iSourceLine_No.

The parameters dP1 -- dP18 are used for specific use cases.

Depending on iMoveType, these parameters contain different informa­tion:

LIN, LINPOS

Complete information stored in piStartPos and piDestPos

CLW, CCLW

The coordinates are stored in the coordinate system (vX, vY, vN).

  • dP1: X-coordinate of circle center

  • dP2: Y-coordinate of circle center

  • dP3: Circle radius

  • dP4: Z-coordinate of circle

SPLINE

  • dP1-dP8: Spline parameter

  • dP9-dP18: Additional spline parameter

ELLCLW, ELLCCLW

  • dP1: X-coordinate of circle center

  • dP2: Y-coordinate of circle center

  • dP3: X-component of the main axis unit vector

  • dP4: Y-component of the main axis unit vector

  • dP5: Length of the main axis

  • dP6: Length of the subaxis

  • dP7: Angle between main axis and X axis (in rad)

  • dP8: Ratio P6/P5

INITPOS

-- MCOMMAND: for M-commands (iMoveType = 120) the M-function number SMC_GetMParameters during Interpolation.

dT1 and dT2 are the start and end parameters for circle/spline.

LIN, LINPOS

Complete information stored in piStartPos and piDestPos

CLW, ELLCLW

  • dT1: Start angle in degree, oriented mathematically (0=east, 90=north, 180=west, 270=south)

  • dT2: Apex angle of circle in degree (e.g. 90=quarter of circle, 180 = semicircle)

CCLW, ELLCCLW

  • dT1: Start angle in degree oriented mathematically (0=east, 90=north, 180=west, 270=south)

  • dT2: Negative apex angle of circle in degree (e.g. -90=quarter of circle, -180 = semicircle)

SPLINE

Start and end value of parameter t, Spline, 0 and 1 by default.

INITPOS

--

InOut:

Name

Type

Initial

Comment

iObjNo

DINT

0

Arbitrary object number (irrelevant for current path description). It's a 1-based, consecutive ID.

iSourceLine_No

DINT

0

Stores the 0-based line number inside the CNC source file

diSentenceNo

DINT

0

Stores the G-code sentence number (value of the N-word)

iMoveType

SMC_MOVTYP

Value defining the geometrical type of the object. SMC_MOVTYP (ENUM)

piStartPos

SMC_POSINFO

Structure exactly describing the start position of the object. Will be ignored in case of iMoveType = INITPOS.

piDestPos

SMC_POSINFO

Structure exactly describing end position of the object

dP1

LREAL

0

dP2

LREAL

0

dP3

LREAL

0

dP4

LREAL

0

dP5

LREAL

0

dP6

LREAL

0

dP7

LREAL

0

dP8

LREAL

0

dP9

LREAL

0

dP10

LREAL

0

dP11

LREAL

0

dP12

LREAL

0

dP13

LREAL

0

dP14

LREAL

0

dP15

LREAL

0

dP16

LREAL

0

dP17

LREAL

0

dP18

LREAL

0

vX

SMC_Vector3D

STRUCT(dX := 1, dY := 0, dZ := 0)

X-axis of the local coordinate system, expressed in world coordinates.

vY

SMC_Vector3D

STRUCT(dX := 0, dY := 1, dZ := 0)

Y-axis of the local coordinate system, expressed in world coordinates.

vN

SMC_Vector3D

STRUCT(dX := 0, dY := 0, dZ := 1)

Z-axis of the local coordinate system, expressed in world coordinates.

dT1

LREAL

0

Start parameter for circle/spline

dT2

LREAL

1

End parameter for circle/spline

dToolRadius

LREAL

0

Information necessary for path processing with SMC_ToolCorr or SMC_RoundPath. Irrelevant else.

dVel

LREAL

0

Target velocity to be reached (in path units/sec)

dVelEnd

LREAL

0

Prescribed velocity at end of object (path units/sec)

dVelEndStored

LREAL

Maximum speed at end of segment before call to SMC_CheckVelocities.

dVelEndSafe

LREAL

0

Computed for the quadratic velocity profile: maximum <= dVelEnd that allows to reach dVelEndSafe of the next element. May be -1 if the next element has identical values for acceleration, deceleration, and velocity.

dAccel

LREAL

100

Maximum allowable acceleration (in path units/sec²)

dDecel

LREAL

100

Maximum allowable deceleration (in path units/sec²)

dLength

LREAL

0

Length of object in path units

wInternMark2

WORD

0

Intern marks for tool correction, rounding, etc.

byInternMark

BYTE

0

Start and end of path preprocessing actions:

  • Bit 0 set: Stop tool radius correction after this object

  • Bit 1 set: Start tool radius correction to the left of this object

  • Bit 2 set: Start tool radius correction to the right of this object

  • Bit 3 set: Stop path rounding/smoothing after this object

  • Bit 4 set: Stop path rounding/smoothing at this object

  • Bit 5 set: Start path rounding at this object

  • Bit 6 set: Stop avoiding loops after this object

  • Bit 7 set: Stop avoiding loops at this object

dwFeatureFlags

DWORD

If TRUE, the object is a 3D-object

b3DMode

BOOL

FALSE

Stores feature bits set by G38/G39

dHelpPos

ARRAY [0..MAX_IPOSWITCHES] OF LREAL

Relative position of auxiliary switches (0: object start, 1: object end, similar to G-code: O)

iHelpID

ARRAY [0..MAX_IPOSWITCHES] OF INT

ID (G-code: H) of auxiliary switches. If the current object is of type MCOMMAND, iHelpID[0] will contain the number of the M-option.

adVelAddAx

ARRAY [0..7] OF LREAL

If value <> 0, then it specifies the velocity values for following use:

  • [0]: all G0 commands

  • [1]: Z-axis

  • [2]: P-axis

  • [3]: Q-axis

  • [4]: U-axis/A-axis

  • [5]: V-axis/B-axis

  • [6]: W-axis/C-axis

adAccAddAx

ARRAY [0..7] OF LREAL

adDecAddAx

ARRAY [0..7] OF LREAL

aAdditionalParams

ARRAY [0..(SMC_MAX_ADDITIONAL_PARAMS - 1)] OF LREAL

Additional parameters set by G38 I/J/K

adToolLength

ARRAY [0..2] OF LREAL

Parameters for tool length compensation (set by G43 I/J/K)