GUI

The TwinCAT 3 Machine Learning Model Manager is the central UI for editing ONNX files. The tool is integrated in Visual Studio and can be opened via the menu bar under TwinCAT > Machine Learning > Machine Learning Model Manager.

GUI 1:

Required Visual Studio version

The graphic interface of the TwinCAT 3 Machine Learning Model Manager is compatible with Visual Studio 2017, 2019, 2022 and the TcXaeShell.

As an alternative to the editing of ML model description files via the interface of the TwinCAT 3 Machine Learning Model Manager, you can also use a command line tool, see CLI, or a Python library, see Python API.

Conversion of ML model files

A conversion tool for ML model description files is located on the Convert tool tab. XML and ONNX files can be selected and converted to XML or BML format.

Notice

Conversion of Beckhoff BML back to XML is not provided for

The objective of Beckhoff BML is to represent the content as a not freely readable binary file. Therefore, the conversion process from Beckhoff BML to Beckhoff XML is not provided for.

The File Browser is opened via Select files and ML model description files can be selected (multi-selection is possible by Ctrl + click). Selected ML model files are listed on the left-hand side with their path and file name. Files can be removed from the list again with Remove selected from list.

GUI 2:

Listed ML model description files can be selected in the left-hand list (multi-selection is possible with Ctrl + click here, too) and converted with Convert files into the format selected in the drop-down menu.

The converted files are saved in the converted file path. The default path is <TwinCATPath>\Functions\TF38xx-Machine-Learning\ConvertToolFiles. The converted file path can be opened in the File Browser by clicking Open converted file path.

The path can be changed with Select converted files path. The change is retained even after restarting the PC.

The Model Manager is the central tool for managing ONNX files for the TwinCAT Machine Learning Server. Description files are generated for executing the AI model with the Machine Learning Server. A pop-up window states the TwinCAT product that the ONNX is compatible with for each converted ONNX.

GUI 3:

Creating metadata for the model

The Configuration tool tab displays the configurator for:

An ML description file can be selected using Select file and then edited. After editing, the original file is overwritten using Save changes.

GUI 4:

The Custom Attributes are edited using the buttons:

The editing area for Input and Output Transformations can be enabled by activating the Trafo active checkbox. Depending on the number of inputs and outputs, a corresponding number of rows is offered, in each of which scaling and offset are to be entered, cf. XML Tag Auxiliary Specifications. A value from a list of numbers from the clipboard can be entered as an offset or scaling using the Paste Scaling and Paste Offset buttons. The number sequence can be separated by comma, semicolon or space. Only the number of numbers in the list must match the number of inputs or outputs respectively.

The Producer and Target Version Information is set automatically by the TwinCAT 3 ML Model Manager. The Target Version is determined automatically on the basis of the feature set of the model description file used. If an older ML Runtime version is used to load this model file, a warning message appears when executing the Configure method.

The number of inputs and outputs of the model as well as the model type are displayed in the lower right area of the window. This cannot be edited and is only for information.