The Master Function and the Tracer Function Window provide a powerful and convenient way to use telos I2C boards.
Scripts offer a more flexible sort of access to telos I2C adapters for advanced users.
The Script Function Window provides a simple environment for editing and executing scripts.
It enables the user to write and execute C# programs. These programs accesses the connected I2C hardware through the I2C.NET API, which is part of the I2C Studio installation.
The Script Function Pane contains two textboxes. The programs can be edited in the upper textbox. Outputs are written to the output textbox below.
For details concerning the language C#, refer to the Standard ECMA-334 - C# Language Specification:
Files written in C# with the file extension *.cs can directly be loaded to the I2C Studio.
The configuration dialog for a Script Function Pane can be opened by the menu item Options/Module….

- Script Configuration Dialog
In the field 'Startup Object' the name of the class has to be entered, whose main method should serve as the program's entry point.
External components that should be used by the script must be added to the list References.
In order to access I2C devices via a script, the I2C.NET API (i2capi_dotnet_net20.dll) must be added to the references. A description of the API is contained in a help file that is displayed when the menu item Help/I2C API is selected.
When the script is edited, it can be executed by the menu item Run/Start.
During execution, the outputs of the write methods of the Console object are redirected to the output box.
Below, a simple script example is shown:
using System;
namespace MyNamespace
{
// This class exists only to house the entry point.
class MyClass
{
// The static method 'Main' is the application's entry
// point.
public static void Main()
{
// Write text to the console.
Console.WriteLine("Hello World using C#!");
}
}
}
Outputs from the various write methods of the Console class are redirected to the output box of the script function pane.
Advanced examples can be found in the I2C.NET API help. It contains 4 other examples:
- AdcExample.cs
- MasterExample.cs
- SlaveExample.cs
- TracerExample.cs
They demonstrate the features of the scripting module. The examples are located in the folder
C:\Program Files\telos EDV Systementwicklung GmbH\I2C Sudio\examples\dotnet.
The most important class of the I2C API is telos.I2cApi.DotNet.Board. This class establishes a connection to the I2C scheduler and creates several subclasses, which are used to communicate with e.g. the master or the trace modules of the I2C boards.
For beginners it is recommended to have a look at the examples of the I2C.NET API, which can be used as template for new programs.