Table of Contents

Class CANdleSimState

Namespace
CTRE.Phoenix6.Sim
Assembly
Phoenix6.Hardware.dll

Class to control the state of a simulated CANdle.

public class CANdleSimState
Inheritance
CANdleSimState
Inherited Members

Constructors

CANdleSimState(CoreCANdle)

Creates an object to control the state of the given CANdle.

Note the recommended method of accessing simulation features is to use SimState.
public CANdleSimState(CoreCANdle device)

Parameters

device CoreCANdle

Device to which this simulation state is attached

Properties

LastStatusCode

Gets the last status code generated by a simulation function.

Not all functions return a status code but can potentially report errors. This function can be used to retrieve those status codes.
public StatusCode LastStatusCode { get; }

Property Value

StatusCode

Last status code generated by a simulation function

VBatModulation

Gets the simulated VBat modulated output of the CANdle.

public double VBatModulation { get; }

Property Value

double

Methods

SetDeviceTemp(double)

Sets the simulated temperature of the CANdle.

public StatusCode SetDeviceTemp(double temperature)

Parameters

temperature double

The device temperature in ℃

Returns

StatusCode

Status code

SetFiveVRailVoltage(double)

Sets the simulated 5V rail voltage of the CANdle.

public StatusCode SetFiveVRailVoltage(double volts)

Parameters

volts double

The 5V rail voltage in Volts

Returns

StatusCode

Status code

SetOutputCurrent(double)

Sets the simulated output current of the CANdle.

public StatusCode SetOutputCurrent(double amps)

Parameters

amps double

The output current in Amps

Returns

StatusCode

Status code

SetSupplyVoltage(double)

Sets the simulated supply voltage of the CANdle.

The minimum allowed supply voltage is 4 V - values below this will be promoted to 4 V.
public StatusCode SetSupplyVoltage(double volts)

Parameters

volts double

The supply voltage in Volts

Returns

StatusCode