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.
Image selection
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. |
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
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.
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:
- 1-channel images are interpreted as grayscale images. All images with pixel types of enum ETcVnElementType are supported.
- 3-channel images are interpreted as RGB color images. Images with 8 bits or 16 bits per channel are supported; this corresponds to the pixel types USINT, SINT, UINT and INT.
- 4-channel images are interpreted as RGBA color images. Images with 8 bits per pixel per channel are supported here; this corresponds to the pixel types USINT and SINT.
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. |
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). |
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):
- Color values/intensity values at the mouse pointer position on the image
- or number of pixels in the corresponding container at the mouse pointer position in the histogram
- Image coordinates at the mouse pointer position on the image
- or container at the mouse pointer position in the histogram
- Image resolution
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.