Incoming Messages
In the following, you can get information on which types of incoming messages can be sent to the TCP Socket plug-in to control MERLIC.
You can use all actions that are available for the MERLIC Communicator when sending messages to the plug-in:
- PrepareRecipe and UnprepareRecipe
- StartSingleJob and StartContinuous
- Stop, Halt, Abort
- Reset
- SelectModeAutomatic
In addition, you can use the following command to query the current state:
- GetCurrentState
Incoming messages basically need to specify the name of the action to be triggered followed by optional or required arguments depending on the action. In the following, we describe how the messages must be specified for the different actions.
Keep in mind that the plug-in provides parameters to enable a customization of the incoming messages. For example, the plug-in can be configured to expect specific start characters or terminators for incoming messages. It is also possible to define a different command separator or to change the expected decimal point characters for numeric values in incoming messages. The messages in the following sections represent the format of incoming messages as required for the default configuration of the plug-in with exception of the terminator for incoming messages. We are using a semicolon as terminator in the example messages below. If the plug-in configuration defines different settings for incoming messages, the messages must be specified accordingly. For more information on the available configuration options, see the topic Configuring the TCP Socket Plug-in.
Preparing and Unpreparing a Recipe
Preparing a Recipe
Messages for loading a recipe need to contain the name of the action "PrepareRecipe" and the ID of the recipe to be prepared in double quotes:
PrepareRecipe "<recipe ID>";
Example
The following example message can be used to prepare the recipe with ID 2.
PrepareRecipe "2";
Unpreparing a Recipe
Messages for unloading a recipe require only the name of the "UnprepareRecipe" action. It is not necessary to add the ID of the recipe because the action is automatically applied to the currently prepared recipe. However, it also works if the recipe ID is given.
UnprepareRecipe;
Starting an Execution
In the following, we describe how incoming messages for starting an execution must be specified. It should be differentiated between starting an execution with and without iteration parameters, that is, parameter values overriding the values in the recipe.
Starting the Execution Without Iteration Parameters
To start a single execution, the respective action "StartSingleJob" can be used. There are no additional arguments required if no iteration parameters are provided. The recipe must not be specified because the action automatically triggers the execution for the currently prepared recipe.
StartSingleJob;
The same applies for continuous executions. The incoming message to the plug-in only requires the name of the respective action "StartContinuous".
StartContinuous;
Starting the Execution With Iteration Parameters
To start the execution with iteration parameters, the respective recipe ID must be added to the message in addition to the values for the iteration parameters. The format of the messages must be defined as follows:
StartSingleJob "<recipe ID>" <iteration parameter values>;
Make sure to put the recipe ID in double quotes. Otherwise, the command will not be recognized.
The same applies for continuous executions.
StartContinuous "<recipe ID>" <iteration parameter values>;
Example
With the following example message, a single execution of the recipe with ID 2 is triggered with two iteration parameters. The first iteration parameter in the recipe will be set to "1.2" and the second iteration parameter will be set to "true".
StartSingleJob "2" 1.2 true;
Ending the Execution
The incoming messages to stop, halt, or abort an execution only require the name of the respective actions "Stop", "Halt", or "Abort".
Example
The following example message stops the current execution.
Stop;
Resetting the Vision System
To reset the system to the "Preoperational" state, the incoming message needs to state the "Reset" action.
Reset;
Changing the Operational Mode
To change the operational mode of the system from "FrontendAccess" to "Automatic", a message with the action "SelectModeAutomatic" can be sent.
SelectModeAutomatic;
Getting the Current State
To get the current state of MERLIC, a message with the command "GetCurrentState" can be sent.
GetCurrentState;