Click or drag to resize

ModalVariable Interface

Represents a modal variable in the woodwork automation system. A modal variable is a stateful output control that outputs a value only when it changes from the previous state, reducing redundant code in NC files by suppressing repeated identical values. Modal variables maintain state between calls and can be forced to output on demand, enabling efficient modal group management (G-codes, M-codes, feed rates) in CNC programming where values persist until explicitly changed.

Namespace: Woodwork.Automation
Assembly: WoodworkAutomation (in WoodworkAutomation.dll) Version: 10.2.1+e3fd5885edfa7211ba46258e0eed5ac221a54381
Syntax
public interface ModalVariable

The ModalVariable type exposes the following members.

Properties
 NameDescription
Public propertyCurrentValue Returns the formatted text string representation of the current value. This reflects the most recent value that has been processed by the Format method.
Public propertyForce Gets and sets a value indicating whether the variable forces output on every format call. When true, the formatted value is output even if it has not changed from the previous value; when false (default), output occurs only when the value changes. Force enables explicit modal group output.
Public propertyPrefix Gets and sets the prefix text string prepended to the formatted output value.
Public propertyShaper Gets and sets the Format(Double) object that defines how numeric values are formatted for output.
Public propertySuffix Gets and sets the suffix text string appended to the formatted output value.
Top
Methods
 NameDescription
Public methodFormat Formats the specified numeric value and returns the formatted text string if the value has changed from the previous call. If the value has not changed and Force is false, returns an empty string to avoid redundant output. This modal behavior reduces NC file size by eliminating repeated modal values.
Public methodReset Resets the variable to force output on the next format call, overriding normal modal output rules. This ensures the next Format call produces output regardless of whether the value has changed.
Top
See Also