Switch Point (H Function)

Function: The switch point functionality or H function activates binary, path-dependent switches. A maximum number of three switch points (MAX_SWITCHES) can be processed for each path element.

Syntax

[G command] H O/L

First, the switch point number H<number> is defined, and then the position of the switch point in the path element is defined as either absolute (word L<position>) or relative (word O<position>).

G Code Word

Description

H{-}<number>

Number of the H function. If the H number is positive, then the respective switch function is switched on. If the H number is negative, then the switch function is switched off. The H number is non-zero and in the range of -32768 to 32767.

O<position>

Relative position [0...1] in the path element

  • 0: Start of the element

  • 1: End

L<position>

  • L>0: Distance to the start point

  • L<0: Distance to the end point

Graphical representation

In the graphical editor, you can use the mouse to move the switch points along the path. When the mouse is moved over the H function, a tooltip is displayed with the H number of the H function.

Effect on the SMC_Interpolator function block

  • The interpolator sends the last switched H number to the iLastSwitch output.iLastSwitch is positive when the H function is switched on.

  • The dwSwitches output is a bit mask. Bit number i indicates whether or not the H function (i+1) is currently set.

  • If the H number is between 1 and 32, then the corresponding bit is set in the interpolator dwSwitches output. A negative value between -1 and -32 resets the bit. The iLastSwitch output has the number of the last run switch point, even if the value is outside the range of -32 to 32.

Examples

Switching off switch point 2 with position relative to the element

Switch point 2 is switched off at position X=40/Y=25 after the first quarter of the element.

N90 G1 X20 Y20
N100 G1 X100 Y40 H-2 O0.25

Switching on and off switch point 2 with position relative to start and end point

Switch point 2 is switched on at position X=40, which is 20 units after the start point of the path element. Switch point 2 is switched off at position X=90, which is 10 units before the end point.

N90 G1 X20
N100 G1 X100 H2 L20 H-2 L-10

See also