Available Methods
Depending on the current state of the vision system, that is, MERLIC, different methods are available for a call in the OPC UA server.
The following table shows which methods are available for the VisionStateMachine and in which states these methods can be called. If you call a method in an incorrect state, you will get an error "(BadNotExecutable") and nothing will happen.
|
Method |
Preoperational |
Operational |
Error |
Halted |
||||
|---|---|---|---|---|---|---|---|---|
|
Initialized |
Ready |
SingleExecution |
ContinuousExecution |
FrontendAccess |
||||
|
Abort |
|
|
|
✔ |
✔ |
This state can only be entered or left using the Frontend. |
|
|
|
GetRecipeListFiltered |
|
✔ |
✔ |
✔ |
✔ |
|
|
|
|
GetResultById |
|
✔ |
✔ |
✔ |
✔ |
|
|
|
|
GetResultComponentsById |
|
✔ |
✔ |
✔ |
✔ |
|
|
|
|
GetResultListFiltered |
|
✔ |
✔ |
✔ |
✔ |
|
|
|
|
Halt |
✔ |
✔ |
✔ |
✔ |
✔ |
✔ |
|
|
|
PrepareRecipe |
|
✔ |
✔ |
✔ |
✔ |
|
|
|
|
Reset |
|
✔ |
✔ |
✔ |
✔ |
✔ |
✔ |
|
|
SelectModeAutomatic |
✔ |
|
|
|
|
|
|
|
|
StartContinuous |
|
|
✔ |
|
|
|
|
|
|
StartSingleJob |
|
|
✔ |
|
|
|
|
|
|
Stop |
|
|
|
✔ |
✔ |
|
|
|
|
UnprepareRecipe |
|
✔ |
✔ |
✔ |
✔ |
|
|
|
|
Method |
Preoperational |
Operational |
|||
|---|---|---|---|---|---|
|
Initialized |
Ready |
SingleExecution |
ContinuousExecution |
||
|
Abort |
|
|
|
✔ |
✔ |
|
GetRecipeListFiltered |
|
✔ |
✔ |
✔ |
✔ |
|
GetResultById |
|
✔ |
✔ |
✔ |
✔ |
|
GetResultComponentsById |
|
✔ |
✔ |
✔ |
✔ |
|
GetResultListFiltered |
|
✔ |
✔ |
✔ |
✔ |
|
Halt |
✔ |
✔ |
✔ |
✔ |
✔ |
|
PrepareRecipe |
|
✔ |
✔ |
✔ |
✔ |
|
Reset |
|
✔ |
✔ |
✔ |
✔ |
|
SelectModeAutomatic |
✔ |
|
|
|
|
|
StartContinuous |
|
|
✔ |
|
|
|
StartSingleJob |
|
|
✔ |
|
|
|
Stop |
|
|
|
✔ |
✔ |
|
UnprepareRecipe |
|
✔ |
✔ |
✔ |
✔ |
|
Method |
Operational |
Error |
Halted |
|---|---|---|---|
|
FrontendAccess |
|||
|
Abort |
This state can only be entered or left using the Frontend. |
|
|
|
GetRecipeListFiltered |
|
|
|
|
GetResultById |
|
|
|
|
GetResultComponentsById |
|
|
|
|
GetResultListFiltered |
|
|
|
|
Halt |
✔ |
|
|
|
PrepareRecipe |
|
|
|
|
Reset |
✔ |
✔ |
|
|
SelectModeAutomatic |
|
|
|
|
StartContinuous |
|
|
|
|
StartSingleJob |
|
|
|
|
Stop |
|
|
|
|
UnprepareRecipe |
|
|
Besides these methods, the "VisionCompanion" add-in provides some further methods, for example, "SetJobParameters". These methods can be called as soon as the respective "JobExecutor" object is active. For more information on these methods, see Starting and Stopping the Execution and Getting Results from the OPC UA Server.
Calling a Method
In this section, we describe how to call a method. We will demonstrate this using the UaExpert®. However, you can use any other client of your choice.
Calling a method in the UaExpert® client is always done in the same way.
- Right-click on the method within the "Address Space" of the client to open the context menu and select "Call...".
- A new window opens that shows the available input and output arguments of the method. Most of them are very self-explanatory.
- Specify the input arguments for your method call.
- Click the "Call" button to execute the method with your arguments.
If the call was successful, the respective "Statuscode" attribute returns "Good". If it was not successful, the OPC UA status code "BadNotFound" or "BadTimeout" is usually returned. However, in some cases, an error might be returned in the "Error" output argument of the method. It is the responsibility of the caller to check this "Error" output. If it differs from 0, the call failed.
The error codes are the negated values of those, that are provided by the plug-in development SDK as listed in the documentation of mv_error_def.h in the Communication Plug-in Development Manual. Example: If the API returns "0x01" as a status code, the error code is "-0x01".
The input and output arguments may differ for each method. For more information on the different methods for the most common tasks, see the following pages: