File Source objects

The File Source represents an alternative image source to the camera. It enables stored images to be loaded from the file system to the TwinCAT real-time instead of live images. Note that compared to the Record/Playback function of a GigE Vision Camera object, a File Source is not intended for the loading of continuous camera streams, but for the loading of individual images.

Images can be used as long as they are saved in a standard image format, e.g. bmp, jpg, png.

File Source objects 1:

Compressed image formats

When using compressed image formats, it depends on whether the applied method is lossy, as the image data would then no longer correspond to the original image data of the camera. Therefore, we recommend using BMP as the storage format.

File Source objects 2:

Grayscale images can be color images

Images that look like grayscale images can be saved with several channels. Pay attention to this when calling conversion functions.

The function blocks FB_VN_FileSourceControl and FB_VN_SimpleCameraControl exist so that images can be received in the PLC. Communication to the File Source Control takes place via these function blocks in a similar way to communication to a camera. An alternative to loading individual images into the TwinCAT real-time is in addition the function block FB_VN_ReadImage.

Image delivery modes

The File Source Control has two modes for providing images:

  1. Streaming mode: Like a streaming camera, new images are provided in a specified cycle.
  2. Trigger mode: A new image is provided with a trigger signal. This can be triggered either by a software trigger or by manually actuating a button.

The settings and the image selection are done under File Source Control.

Creating a File Source node

Creating a File Source node is described in First Steps under Creating a File Source Control.

Export/Import of a File Source node

If you wish to save the configuration of a File Source or import it into a project, follow the instructions in the chapter Exporting/importing configurations.