Server extension

The NuGet package Beckhoff.TwinCAT.HMI.Vision (TwinCAT package ‘TwinCAT.HMI.Vision’) contains the HMI server extension TcHmiVision, which can be used to display images from the PLC in the TwinCAT HMI. For this purpose, all ADS symbols of the type ITcVnDisplayableImage from the configured runtimes are listed and can be linked in various formats with an HMI symbol. See System requirements for the required .NET version.

Configuration

Once the package has been successfully integrated into the HMI project, enter the target PLC under Server > TcHmiVision > General:

Server extension 1:

In addition, individual target systems can be enabled or disabled via the Enabled setting.

The Streaming server port defines which streaming port is used for sending the images configured with Stream as the transmission format.

If individual symbols from the PLC are not to be listed by the extension, they can be hidden using the PLC attribute TcHmiSymbol.Hide. If, on the other hand, only certain symbols are to be listed, the Use Whitelisting setting must be enabled. Corresponding variables can then be marked with the PLC attribute TcHmiSymbol.Show.

Server extension 2:

Statistics

Under Server > TcHmiVision > General , set Number of image transmissions for statistics to a value higher than 0 to enable statistical data collection. For example, if you set the value to 100, the last 100 image transmissions will be included in the statistics.

Statistical data is listed under Server > TcHmiVision > Diagnostics > Statistics. The individual values are calculated for each configured image symbol.

Server extension 3:
  1. Image resolution: Image resolution in pixels
  2. Received image size: Image size of the received image
  3. Converted image size: Image size after conversion e.g. to Jpeg or Png depending on the configured image format and then to a Base64 string
  4. Framerate: Image transmissions per second
  5. ADS transmission time: Duration of the transmission of an image via ADS
  6. Image conversion time: Duration of the conversion of an image
  7. Processing time: The time required by the extension for an image transmission including conversion.
  8. Time between image requests: The time that elapses between a response from the extension and the next image request from the server. In this phase, the server waits for the set symbol interval. If the image transmission has been paused, this value may be distorted. To prevent falsified values, the statistics can be reset as explained below. Alternatively, you can wait until further images have been transferred and the statistics have been adjusted. In addition, this value may vary if multiple data bindings exist for the same symbol.
  9. Evaluated image transmissions: Number of image transmissions currently included in the statistics

Graphical representation of the sequence of an image transmission, with the statistical values marked in red:

Server extension 4:

To reset the statistics from the application, an empty value must be written to the TcHmiVision.ResetStatistics symbol. For example, drag a Write To symbol into the Actions and Conditions of an event. In the left-hand field, click on Create data binding... In order for the symbol to be listed, you must enable Show advanced items in the window settings. Now link the corresponding symbol under: Mapped symbols > TcHmiVision > ResetStatistics.

Server extension 5:
Server extension 6:

Diagnostics

Under Server > TcHmiVision > Diagnostics, you can obtain information on the connection status of the configured target system:

Server extension 7:

Application

1. Navigate to an HMI view and add an Image control.
Server extension 8:
2. Open the properties of the control element and click on Create data binding… under the parameter Src…
Server extension 9:
3. Link the Src parameter of the Image control to the corresponding image symbol at the following location: Server symbols > TcHmiVision > PLC > MAIN > ipImage > <image format>
Server extension 10:
Server extension 11:

Linking images

Linking images is only possible if the process image of the configured target system contains corresponding image variables.

Server extension 12:

Interval

The speed at which images can be retrieved from the PLC depends on the system, image size, and workload. We therefore recommend specifying a fixed interval in the Binding dialog at Settings to prevent the system from being overloaded.

If several images are to be displayed on one page, it is also recommended to use different intervals, e.g. 200 ms and 201 ms. This way, the images are retrieved separately from each other, which can be advantageous for larger amounts of data.

Transmission formats

The server extension contains the image data from the PLC in BMP format and forwards them as a Base64 string to the TwinCAT HMI client. In order to reduce the data quantity transmitted to a client, images can be compressed in the server extension. The following image formats are available:

Server extension 13:

For transmission as a stream the HMI server must be started as administrator. Otherwise no image transmission is possible.