Skip to main content
Open topic with navigation CAPL Functions » VT System » vtsSetMaxCurrentMode

vtsSetMaxCurrentMode

Valid for: CANoe DE • CANoe:lite DE

Function Syntax

  • long vtsSetMaxCurrentMode (char Target[], dword Mode, double Factor); // form 1
  • long vtsSetMaxCurrentMode (char Target[], dword Mode); // form 2

Description

Sets the mode for the control voltage output to control the power supply’s maximal output current.

Parameters

  • Target: Name of the system variable/namespace that will be affected by this function call.
  • Mode:
    • 0: Max current control voltage output not active
    • 1: Constant value, determined by the corresponding output system variable
  • Factor: Factor to determine the control voltage from the defined power supply max current value.
    Power Supply Max Current * Factor = Control Voltage
    The factor has a default value of 1.0 at the start of measurement. If the function is called without factor parameter the currently set factor is kept.

Return Values

  • 0: Successful call
  • -1: Call error
  • -2: The namespace on which the command was called does not exist, is not a valid VT System namespace or does not support this command.
  • -3: The specified mode is not valid
  • -4: The function wasn’t called in the context of the main method of a test module. So it is not possible to wait until the setting will be taken over from the VT System. Otherwise the call was successful but it is not sure if the settings have been taken over already when the call returns.

Example

In the following example the maximum current mode is activated on the power supply channel ExtSupply of a VT7001 module. The max. current output is set to 10 A. Finally the output Clamp30 of the VT7001 is activated. To set a max current of 10 A, e.g. a control voltage of 5.0 V has to be given to the power supply. Therefore a factor of 0.5 has to be used.

CAPL

SetMaxCurrentMode ()
{
  // Set mode to one power supply only -> external power supply 1
  vtsSetInterconnectionMode("VTS::PowerSupply", 1);

  // Activate the maximum current mode with constant value mode
  // and a factor of 0.5
  vtsSetMaxCurrentMode("VTS::ExtSupply", 1, 0.5);

  // Set power supply to max 10A
  @sysvar::VTS::ExtSupply::MaxCurrent = 10.0;

  // Switch output on
  @sysvar::VTS::Clamp30::Active = 1;
}

.NET (C#)

public void SetMaxCurrentMode()
{
    // Get VTS interface, VT7001 module, internal supply and a output channel
    IVTSystem vts = VTSystem.Instance;
    IVT7001 powerSupply = vts.GetModule("PowerSupply") as IVT7001;
    IVT7001SupplyExternal extSupply = vts.GetChannel("ExtSupply") as IVT7001SupplyExternal;
    IVT7001Channel clamp30 = vts.GetChannel("Clamp30") as IVT7001Channel;

    // Set mode to one power supply only -> external power supply 1
    powerSupply.InterconnectionMode.Value = InterconnectionMode.Sup1;

    // Activate the maximum current mode with constant value mode
    // and a factor of 0.5
    extSupply.SetMaxCurrentMode(MaxCurrentMode.Constant, 0.5);

    // Set power supply to max 10A
    extSupply.MaxCurrent.Value = 10.0;

    // Switch output on
    clamp30.Active.Value = OutputMode.Active;
}

VT System Control

  • Select PowerSupply
  • Set Sidebar | Interconnection Settings | Mode to sup1
  • Select ExtSupply
  • Set Sidebar | Output | Max Current Mode to Constant
    Set Sidebar | Output | Max Current Factor to 0.5
    Set Sidebar | Output | Max Current to 10.0
  • Select Clamp30
  • Set Schematic | Active to active
SetMaxCurrentMode