Conditional Wait
WAIT_FOR_SIGNAL · V4.23Choose Variables & Flow > Conditional Wait. Its two operands and dropdowns match Conditional Jump, with no target Mark or row. Select a user error code from 128 to 255 already defined in the data dictionary, including when timeout is zero. System codes cannot be selected; distinct machine faults use their own descriptions instead of a generic wait-timeout code.
Hexadecimal notation is used for IDs, indexes, modes and sentinel values where applicable. Physical quantities (such as pulses, milliseconds and pulse/s) remain in their native units. Macro names are shown only when defined by the firmware.
Input parameters
| Parameter | Initial value | Meaning |
|---|---|---|
Value 1 / sensorinput_index | X0 | First operand: input, variable, output or current-task timer value/state, as offered by the dropdown. |
Value 2compare_source | XSTATE_CLOSE | Second operand or manual numeric value. A manual value is unsigned 32-bit. |
Comparisoncondition | = | =, <>, <, >, <= or >=. The row advances only when the comparison is true. |
Timeouttimeout_ms | 0 | 0 to 2147483647 ms. Zero waits indefinitely without a timeout alarm. |
Timeout outputtimeout_output | 0x04U (Y4) | No Output, or Y4-Y31 on 32Y / Y4-Y23 on 24Y. No Output still records the timeout and pauses tasks; it does not change a Y output. MTGM_SIGNAL_WAIT_NO_OUTPUT = 0xFFU. |
Timeout user error codetimeout_error_code | Required / select value | Defined user code 128-255 only; mandatory even with timeout 0. |
Initial values are editor defaults for a newly inserted instruction; configure them for the actual machine.
Firmware macro definitions
Hexadecimal equivalents of the firmware definitions; numeric values are unchanged.
#define MTGM_SIGNAL_WAIT_NO_OUTPUT 0xFFUExecution and usage
- True advances immediately. False keeps only this task at the same row until the condition becomes true or the timeout is reached; other tasks and communication can continue. If the condition is true at the timeout boundary, the satisfied condition takes precedence.
- On timeout the MCU pauses all running tasks, retains the waiting row and records the selected user error code. A chosen Y output stays active for an external lamp or sounder; No Output leaves every Y unchanged. The Host shows codes with dictionary descriptions and offers Keep Paused or Continue. Enter, Escape and closing the prompt keep the pause. With no Host, the MCU still pauses and records the error; an external alarm requires a selected Y output.
- Continue clears this kind of timeout error and its held output, resumes tasks affected by the pause and retries the same row with a fresh interval. It neither bypasses the comparison nor starts stopped/completed tasks. Without a Host, resolve the cause and use the configured physical Continue input. The MCU uses internal fault types to permit recovery; a user-selected number cannot change fault severity or override other blocking faults. A shared output stays active while another timeout holds it.
- The Host checks firmware support before task/project writes, including waits inside functions. No Output and user error codes each need matching firmware capabilities. Update unsupported firmware first. Legacy wait records without a valid user code need an explicit selection before saving again. Conditional Wait does not consume T0 to T3. Its summary omits repeated Timeout and Alarm labels, for example Variable1 Feed flag == 0 None No Output 128 Material arrival timeout; None means unlimited waiting.