Please enable JavaScript to view this site.

ESL Documentation

Response Definition

Allow an external DLL to invoke responses in an ESL program.

[interrupt] response to stimulus STIMULUS_NAME

[*|EVENT_FILTER] [*|PARM_FILTER]

[ACTION_STATEMENT] ...

interrupt

Allow ESL to leave and return to any block currently executing, except a guarded block, when the response is stimulated. ESL will first finish any current action statements in the block, then execute the actions in the interrupt response, and finally return to the block and await a stimulus from within the original block.

STIMULUS_NAME

The identifier for the stimulus.

*

Any event number/parameter will match.

EVENT_FILTER

A numeric constant, variable, or literal. For the response to be invoked, this value must match the event number provided by the DLL when it invokes the response.

PARM_FILTER

A numeric constant, variable, or literal. For the response to be invoked, this value must match the event parameter provided by the DLL when it invokes the response.

ACTION_STATEMENT

An action statement.

Description

Use this statement when you want to allow an external Dynamic Link Library (DLL) to invoke responses in an ESL program.

The stimulus must be declared before it can be referenced in a response.

When searching for a matching response to a stimulus event, ESL executes the first response that matches the given event number and parameter. ESL searches all currently active blocks for a matching response, until either the outermost block has been searched or a guarded block has been reached. If a matching response is not found, no response is executed and the event is discarded.

If you use a variable for the event filter or the parameter filter when you define a response to stimulus definition, the numeric variable cannot be a local subroutine variable or parameter.

The response to stimulus response definition can perform an interrupt response.

The following built-in functions can be used in a response to stimulus response definition:

Function

Value Returned

eventnumber

An integer value representing the event number provided by the DLL invoking the response. The meaning of this value is dependent on the DLL.

eventparam

An integer value representing the event parameter provided by the DLL invoking the response. The meaning of this value is dependent on the DLL and the eventnumber.

Example

# This response will be executed only when

# eventnumber = F1 and eventparam = F2.

response to stimulus StimulusName F1 F2

...

# This response will be executed whenever

# eventnumber = F1.

response to stimulus StimulusName F1

...

# This response will be executed whenever

# eventparam = F2.

response to stimulus StimulusName * F2

...

# This matches any stimulus event

response to stimulus StimulusName

...

See Also

stimulus Declaration