You are here: Start » Application Notes » Interfacing Zebra 4Sight computer (Modbus TCP - Client) to Aurora Vision Studio
Interfacing Zebra 4Sight computer (Modbus TCP - Client) to Aurora Vision Studio
Purpose and equipment
This document explains how to configure Modbus TCP PLC with Aurora Vision Studio using Zebra 4Sight computer. In this setup, the Zebra 4Sight computer running Aurora Vision Studio acts as a Modbus Client (Master), while the PLC acts as a Modbus Server (Slave).
Required equipment:
- 4Sight computer (used 4Sight XV7);
- Siemens S7-1200 PLC;
- Ethernet switch with at least 3 In/Outs might be useful - simplifies configuration;
- PC with TIA Portal V19 (for PLC configuration);
- Aurora Vision Studio 5.7 or later (version 5.7 used).
Application notes demonstrates configuration steps for specific 4sight model, but it is not obligatory to use this one. If you have different model, please refer to manuals provided by its manufacturer.
Hardware connection
In application notes there is configured one network which uses Ethernet switch. Devices connected to this network have addresses 192.168.1.XXX, where XXX stands for number 1-254 unique for every device/port connected.
In Zebra 4Sight manual it is mentioned that PLC Software should not be installed on Z4Sight PC. Taking this into account, we have one PLC and two computers in our network:
Before proceeding to the further point, make sure that all devices are powered up.
Configuring AIL on Zebra 4Sight
Before creating the application in Aurora Vision Studio, the Modbus Client service must be enabled in the AIL configuration.
- Open the AILConfig application on the Z4Sight computer.
- In the left pane, navigate to Communication -> Modbus.
- Add a new instance. Set parameters:
- Name: Modbus1
- Type: tcp
- Mode: client
- Interface: any
- Save the configuration
Aurora Vision Studio application
The application utilizes dedicated Aurora Imaging Library Modbus filters to read and write holding registers and coils.
- Inside the Main macrofilter, go to the ACQUIRE section and add a Loop filter to keep the task running continuously.
-
In the PROCESS section, create a new Task Macrofilter named MainLoop. Add four macrofilter inputs:
- inDeviceID of type AILSystemAndDeviceIdentifier*
- inInstanceName of type String*
- inSeverID of type Integer*
- inServerAddress of type String*
Set the inInstanceName value to match the AILConfig setup (Modbus1) and the inServerAddress to the address of the PLC (192.168.1.1).
- Open the MainLoop macrofilter. In the ACQUIRE section, add the Loop filter. Set its inDelay input to the desired polling rate (e.g., 500 ms) to regulate the communication frequency.
- In the PROCESS section, add the AILSystem_Modbus_Client_ReadDiscreteInputs filter. Link the inDeviceID, inInstanceName, inSeverID and inServerAddress from the macrofilter inputs. Set inOffset to 0 and the inCount to 4. Present the outValues in the Preview window.
- Add the AILSystem_Modbus_Client_ReadHoldingRegisters_uint16 filter. Link the inDeviceID, inInstanceName, inSeverID and inServerAddress from the macrofilter inputs. Set inOffset to 0 and inCount to 4. Present the outValues in the Preview window.
- Add the AILSystem_Modbus_Client_WriteCoils filter. Link the inDeviceID, inInstanceName, inSeverID and inServerAddress from the macrofilter inputs. Set inOffset to 0 and the inValues to {False;False;True;True}.
- Add the AILSystem_Modbus_Client_WriteHoldingRegisters_uint16 filter. Link the inDeviceID, inInstanceName, inSeverID and inServerAddress from the macrofilter inputs. Set inOffset to 8 and the inValues to {12;54;78;96}.
- In the Project Explorer, right-click on the MainLoop macrofilter block, select Add New Error Handler, and choose IO_ERROR.
Configuring PLC in TIA Portal
Device Configuration
After adding the S7-1200 PLC to the project, apply the following settings in the Properties tab:
- PROFINET interface [X1]: Set the appropriate IP address and add/setup the Subnet. Ensure it is in the same subnet as the Z4Sight computer.
- System and clock memory: Check Enable the use of system memory byte and Enable the use of clock memory byte.
- Access level: Set to Full access (no password).
- Connection mechanisms: Check Permit access with PUT/GET communication from remote partner and uncheck Only allow secure PG/PC and HMI communication.
Creating Data Blocks
Two Data Blocks are required to manage the data arrays and the connection parameters:
- BUFF [DB1] - it holds the raw Modbus arrays and the processed (byte-swapped) arrays.
- Define the following variables:
- DATA of type Array[1..100] of Word (Raw data received from AVS)
- DATA_SEND of type Array[1..100] of Word (Raw data to be sent to AVS)
- Right-click the block, go to Properties -> Attributes, and uncheck the Optimize block access option. This is mandatory to expose absolute addressing.
- Define the following variables:
- BUFF_CLEAN [DB4] - it holds the processed (byte-swapped) arrays.
- Define the following variables:
- DATA of type Array[1..100] of Word (Raw data received from AVS)
- DATA_SEND of type Array[1..100] of Word (Raw data to be sent to AVS)
- Right-click the block, go to Properties -> Attributes, and uncheck the Optimize block access option. This is mandatory to expose absolute addressing.
- Define the following variables:
- MBConfig [DB2] - it stores the connection parameters and status flags for both the read and write operations. Set their Start values as follows:
- CONNECT of type TCON_IP_v4:
- InterfaceId: 64
- ConnectionType: 11
- RemoteAddress: 192.168.1.50 (IP address of the Z4Sight computer)
- LocalPort: 502
- ID: 1.
- Add Bool flags: NDR, DR, ERROR.
- Add STATE of type Word.
- CONNECT of type TCON_IP_v4:
- BUFF [DB1] - it holds the raw Modbus arrays and the processed (byte-swapped) arrays.
Main Logic [OB1]
Create structure as showed in images below:
When monitoring values in the TIA Portal Watch Table, always refer to the BUFF_CLEAN arrays to see the correct decimal values.

