AXOpen.Inspectors provides mechanism of inspection of different types of data. The input value is compared to required value. If input value is the same as required value for a stabilization time period, the inspection will succeed. If values are different, timeout will occur and inspection will fail.
Inspectors can integrate with coordination primitives like AxoSequencer. In consequence, inspectors offer extended capabilities in decision flow for failed checks.
Each inspector contains:
-
Inspectmethod, which input is current parent and inspection variable -
OnFailmethod, which provides methods for making a decision after a failed inspection (see Handling failure section) -
UpdateComprehensiveResultmethod, which input is object of typeAxoComprehesiveResult, which can be used to gather results of all inspections. -
Common dataabout inspection inputs and result. See below.
- Declare variables
- Set initial inspection pass and fail timers
- Run inspections
- Check each inspector's data for results
Note
Inspectors use AxOpen.Timers for counting time during inspections. Make sure, that PLC cycle time value in configuration.st is set accordingly to Pass and Fail timers (it should be in tens or hundreds milliseconds, the value shouldn't higher than lowest difference between pass and fail timers). If there are small differences (in ms) between pass and fail times and PLC cycle time is higher number (e.g. 1000 ms), unexpected behavior may occur and inspections can fail (even if they should pass).
Example of inspection within a sequencer in PLC:
- A _presenceInspector is created instance of
AxoDigitalInspector - A coordinator is passed to this inspector with
WithCoordinator(THIS)method, in this case it is a sequencer, a parent object. Inspectmethods takes parent and inspection variable, on which inspection is performing.- If inspection fails, the result is updated to
_comprehensiveResultobject withUpdateComprehensiveResultmethod. - If inspection fails,
OnFailmethod providesCarryOnmethod, which tells the coordinator to continue in execution.
Inspectors contain common data, which are used to store data about inspection. Each inspector contain following data:
[!INCLUDE AxoDigitalInspector]
[!INCLUDE AxoAnalogueInspector]
[!INCLUDE AxoDataInspector]
When an inspector fails, OnFail() provides a series of methods for making decisions about the process. In order for this is feature to work the inspector needs to be aware of the coordinator of IAxoCoordinator. The coordinator must be passed to the inspector by WithCoordinator(coordinator) method.
| Syntax | Description |
|---|---|
| Dialog(inRetryStep, inTerminateStep) | Opens dialog for the user to take a decision. Parameter inRetryStep represent state from which the inspection should start again. Parameter inTerminateStep represent terminate state of coordinator. |
| Retry(inRetryStep) | Retries the inspector. Retry state parameter tells from which state the inspection should start again. |
| Override() | Marks the inspection as failed but continues with the following states of the coordinator. |
| Terminate(inTerminateStep) | Marks the inspection as failed and aborts the execution of the coordinator. |
The following example specify, that when inspection fails, dialog is shown and is requesting user decision.
When RetryAttemptsCount is same as NumberOfAllowedRetries, no more inspection are allowed, as data are overinspected.
Overall result of a series of inspections can be preserved in AxoComprehensiveResult. Each inspector has UpdateComprehensiveResult method that provides the update function. Once the UpdateComprehensiveResult marks the overall result as Failed, successive inspection will not overwrite the result.

