# Operation

The PLC initiates the string command process by populating the String Command field with the native mode command to be sent and processed by the vision system.

A simple example is sending the "GO" command to get the online state of the vision system. A value of 0 is returned if it is offline and a value of 1 when online. The PLC is programmed to put the string length (in this example 2) and "GO" string as ASCII characters into the correct tags or memory locations in the PLC.

The PLC program then sets the InitiateStringCommand to 1 to initiate the process and writes it to the vision system. The vision system then reads the data ("GO" in this case) from the String Command field and executes the specified native mode command. In the PLC, the initiate bit needs to be held high or set to 1 until the vision system sets the acknowledge bit to 1 to ensure that the vision system has received the command. This is similar to 4-way handshake from the PLC in other operations.

Once the string command or native mode command executes in the vision system, a response is returned to the PLC. The response is specific to the command sent but always contains a result code (success is 1 and fail is any other non-1 value specific to the command) and possibly some ASCII result data (for the "GO" example value of 0 or 1) and result length (in this case 1). Some protocol implementations also have a bit to signal a string command error. For more information about commands and possible result codes and result data for each command, see the In-Sight Vision Suite Application Development Help, section Native Mode Communications.

The string commands can be sent while the vision system is online or offline.

Note: Typically native mode commands are sent and processed after a user is authenticated by the vision system (using a user name or password) but for PLC string commands this authentication is bypassed and no authentication is used. Not all published native mode commands are supported being sent from the PLC.