Commands (Hilscher)

MERLIC provides various commands for the communication between the programmable logic controller (PLC) and MERLIC when using a Hilscher card. The commands can be used by the PLC to trigger different events, for example, the execution of the MERLIC Vision App (MVApp). MERLIC uses the commands as response to the PLC. To achieve a handshaking process, MERLIC responds with the same command code that has been transmitted by the PLC.

The transmission of the commands takes place via the protocols FromPLCProtocol and FromMerlicProtocol. Commands from the PLC are transmitted via the protocol FromPLCProtocol whereas the responses from MERLIC to the PLC are transmitted via the protocol FromMerlicProtocol. For more information, see Protocols for the Data Exchange.

In detail, the PLC needs to pass the desired command by setting the respective value for the member CommandCode in the protocol FromPLCProtocol. As soon as MERLIC recognizes the command, it sets the member CommandCode of the protocol FromMerlicProtocol to the same value and sends this information back to the PLC as confirmation. MERLIC also starts to execute the respective command and then waits for the PLC to reset the command code, that is, that the CommandCode member of the protocol FromPLCProtocol is set to 0. When MERLIC receives the information from the PLC that the command has been reset and MERLIC already finished the execution of the command, it also resets the CommandCode member of the protocol FromMerlicProtocol.

Supported Commands

The following commands are supported when using a Hilscher card. To trigger a specific command, the corresponding value must be set for the CommandCode member in the FromPLCProtocol protocol.

Command

Value

Description

NoCommand

0

This command is used for the synchronization between MERLIC and the PLC.

StartSingleJob

1

Use this command to start a single execution of MERLIC.

GetResult

2

Use this command to get a result that has been generated previously. The ID of the result must be defined with the member Selector in the protocol FromPLCProtocol. The result is delivered in the protocol FromMerlicProtocol.

Make sure to request only available results. Requesting non-existing results causes an error.

SelectModeAutomatic

3

Use this command to switch from the state "Preoperational" to the state "Initialized".

PrepareRecipe

4

Use this command to prepare a previously defined recipe in the MERLIC5.ini file. The ID of the recipe is provided with the member Selector in the protocol FromPLCProtocol.

StartContinuous

5

Use this command to start the continuous execution of MERLIC.

Stop

6

Use this command to stop the continuous execution of MERLIC.

Abort

7

Use this command to stop the continuous execution of MERLIC. Currently, this command corresponds to "Stop".

Reset

8

Use this command to switch to the state "Preoperational". If an execution is in progress while "Reset" is called, MERLIC will finish the current iteration then change to "Preoperational".

Halt

9

Use this command to switch to the "Halted" state. If an execution is in progress while "Halt" is called, MERLIC will finish the current iteration and then change to "Halted".

For information on how to work with the provided commands and the respective handshaking process, see Using Hilscher PCI Cards.