ADS Image Watch

With the ADS Image Watch, images of the type ITcVnDisplayableImage can be retrieved from the PLC and displayed in the development environment. Open the ADS Image Watch via the Visual Studio menu TwinCAT > Windows > ADS Image Watch.

ADS Image Watch 1:

Image selection

ADS Image Watch 2:

The image selection is made using the selection fields from left to right.

Target system

ADS devices are addressed via the ADS-AmsNetId and the ADS port. The ADS-AmsNetId unambiguously identifies the target system that must be selected first. The local system is selected by default. However, you can select any system for which a route has been created; see Choose Target System.

Port

The individual devices on the system are identified by ADS port numbers. A fixed port number range is defined for the PLC runtimes, so that the selection list is pre-filtered based on these. If only one PLC port exists on the target system when this is selected in the ADS Image Watch, the PLC port is selected automatically.

Image variable

All variables of type ITcVnDisplayableImage are displayed here and can be selected, regardless of whether the variable points to an image with a supported image format at the time.

Size

Without additional settings, the image is scaled to the size of the current window (Fit To Window). However, it can optionally be set to a size relative to the original image. Please note that the image is scaled down by the PlcAux task in the real-time environment before transmission via ADS if the selected size is smaller than the original image. If the image is then saved, it does not have the original size.

Stop / Play

The alternating Stop / Play button can be used to stop or restart the updating of the image display. If the pause icon is visible, the update is active and images are continuously received. If the play icon is visible, the update has stopped and the display of the last image is maintained. No more images are received.

This makes it possible to analyze the image and every detail, e.g. by zooming in.

ADS Image Watch 3:

Image scaling

If the selected size is not 100%, the displayed image will be interpolated. For Fit To Window or a reduction, linear interpolation is used, and for enlargements, nearest-neighbor interpolation is used.

Depending on the image content or pixel values, deviations may occur. If individual pixels are to be analyzed in detail, the size should therefore be set to 100 %.

Options

ADS Image Watch 4:

The currently displayed image can be saved using the Action icon at the top right next to the image size, then Save Current Image.

Furthermore, the background around the display image can be changed between light and dark with Invert Background. This can be helpful with very bright or dark images, so that the image content or image edge can be clearly seen and distinguished by a high contrast to the background.

ADS Image Watch 5:

Image size

The image is saved in the size that the ADS Image Watch queries from the PLC. In order to save the image in the original size, the image must be set to at least 100% or the window pulled to at least the original image size. If the image size is set to larger than 100%, the image will also be saved in the original size. With a smaller setting or with Fit to Window and too small a window, the image will be stored in the correspondingly reduced size.

Image formats supported

The following image formats can be displayed in the following color spaces in the ADS Image Watch:

ADS Image Watch 6:

Other image formats

Other image formats and color spaces can be processed in the PLC as ITcVnImage. To display them, however, they must first be converted to one of the displayable formats by means of F_VN_ConvertColorSpace before they are converted into a ITcVnDisplayableImage. If this is not done, the images will either be displayed in the wrong color representation or not at all.

ADS Image Watch 7:

Displaying 16-bit images

16-bit images are transferred from the PLC to the ADS Image Watch as 8-bit images. Therefore the pixel values are only displayed in the status bar in increments of 256 (0, 256, 512, etc.), but nevertheless relate to 16 bits: (0: Minimum, 65.280: Maximum).

ADS Image Watch 8:

Displaying (L)REAL images

(L)REAL images are transferred from the PLC to the ADS Image Watch as 8-bit images. For this purpose the value range [-1, +1] is scaled to [-127, +127] and transmitted as an integer. Floating point values outside these limits will be interpreted as -1 or +1. In the ADS Image Watch the pixel values to be transmitted are divided by 127 again so that the floating point values are displayed in the range [-1, +1].

Status Bar

The status bar below the image shows the following information (from left to right):

ADS Image Watch 9:
Status bar in the ADS Image Watch

Histogram

When the Show Histogram checkbox is checked, the histogram of the image is displayed at the bottom left of the image. This can have several channels that are displayed superimposed, depending on the image type.

ADS Image Watch 10:
Histogram in the ADS Image Watch