ICC-4c C# SDK

ICC-4c/ECC-1c SDK wiki

# Introduction to C# SDK for controlling the ICC-4c and ECC-1c

The C# SDK is organized in the following way:

    Board.System.Command(parameters)

ICC-4c : Class for controlling ICC-4c drivers

ECC-1c : Class for controlling ECC-1c drivers

## To begin:

If necessary, flash the FW using: STM32 Cube Programmer Or by using Optotune Cockpit application.

Create controller interface and initialize it with new object

    ICC4cPwmSdkDeviceController controller = new ICC4cPwmSdkDeviceController();
    controller.Connect([COM number])

You can then read serial number of the board or firmware version

    var serialNumber = controller.GetElectronicSerialNumber();
    var fwVersion = $"{controller.Status.GetBoardFirmwareMajorVersion()}.{controller.Status.GetBoardFirmwareMinorVersion()}.{controller.Status.GetBoardFirmwareRevisionVersion()}";

List of connected devices can be obtain using following command

    var connectedDevices = controller.GetConnectedDeviceTypes();

### ECC-1c has its own controller interface

    IEcc1cSdkDeviceController controller = new Ecc1cSdkDeviceController();
    controller.Connect([COM number])

Otherwise ECC-1c systems are used the same way as using ICC-4c

## Setting input

Input values can be set using supported systems

### Static Input

Fisr we need to set active system to Static Input

    controller.InputStage.ChangeActiveSystem(EChannel.Channel0, EInputSignalStageSystem.StaticInput);
    controller.InputStage.StaticValue.SetCurrent(EChannel.Channel0, [current in A]);

### Signal Generator

To run sine curve we can use Signal Generator system

    controller.InputStage.ChangeActiveSystem(EChannel.Channel0, EInputSignalStageSystem.SignalGenerator);

Then we can set values to specify the sine curve

    controller.InputStage.SignalGenerator.SetUnitType(EChannel.Channel0, EICC4cPwmUnitType.Current);
    controller.InputStage.SignalGenerator.SetShape(EChannel.Channel0, ESignalGeneratorShape.Sinusoidal);
    controller.InputStage.SignalGenerator.SetAmplitude(EChannel.Channel0, 0.2f);
    controller.InputStage.SignalGenerator.SetFrequency(EChannel.Channel0, 5);
    controller.InputStage.SignalGenerator.SwitchRunning(EChannel.Channel0, true);

### For More Examples, See The Page Below:

Additional Examples