TcCOM objects

Each FileSource instance contains two TcCOM objects in the TwinCAT project:

TcCOM objects 1:
TcCOM objects 2:

TcCOM objects are automatically managed by TwinCAT Vision

TcCOM objects are always managed automatically by TwinCAT Vision and do not have to be adapted or configured manually. Therefore the following information essentially serves to provide a more comprehensive technical understanding.

File Image Acquisition

The TcIoFileImageAcquisition object coordinates the loading of images from the hard drive for FileSource instances. This object contains the following parameters (in addition to CycleTime and TriggerMode, which can be set in the File Source Control):

BaseDir

File path on the target system under which images added to the selection list are stored.

Standard: C:\Users\Public\TcVision\FileSources\<UniqueId>

ServiceTimeout

Timeout for communication with the TwinCAT Vision Service in milliseconds.

Default: 5000

TcCOM objects 3:

Cyclic tasks

The File Image Acquisition object must be linked with a cyclic task. The corresponding configuration can be found in the Context tab of the objects. Normally, there is no need to manually link tasks, as tasks required when creating a Vision device are automatically created and linked. Details on creating and linking tasks can be found in the chapter on CPU cores and tasks.

File Image Provider

This object represents the interface between the FileSource object and the FileSource function block in the PLC. The ObjectID variable of the function block FB_VN_FileSourceControl or FB_VN_SimpleCameraControl must be linked with the corresponding File Image Provider TcCOM object on the Symbol Initialization tab of the project instance after the compilation of the PLC code. If several FileSource instances exist in the project, care must be taken on the basis of the name that the correct object is selected. This object contains the following parameters:

ImageQueueSize

Number of loaded images that are to be buffered if they are not accepted directly by the function block in the PLC.

Default: 1

Linking the TcCOM objects

For a File Source device only the Image Provider has to be linked to Image Acquisition. By default, this link is created automatically and should not be changed manually. The following overview graphic shows a simplified relationship of the different objects that communicate with one another or retrieve data.

TcCOM objects 4:
Architecture of the File Source functionality