Rail¶
- class brainstem.entity.Rail(module, index)[source]¶
RailClass: Provides power rail functionality on certain modules. This entity is only available on certain modules. The RailClass can be used to control power to downstream devices. It has the ability to take current and voltage measurements, and depending on hardware, may have additional modes and capabilities.
- clearFaults()[source]¶
Clears the current fault state of the rail. Refer to the module datasheet for definition of the rail faults.
- Returns:
An error result from the list of defined error codes in brainstem.result
- Return type:
unsigned byte
- getCurrent()[source]¶
Get the rail current. The current in micro-amps (1 == 1e-6A).
- Returns:
Result object containing the requested value when the results error is set to NO_ERROR(0)
- Return type:
- getCurrentLimit()[source]¶
Get the rail current limit setting. (Check product datasheet to see if this feature is available) The current in micro-amps (1 == 1e-6A).
- Returns:
Result object containing the requested value when the results error is set to NO_ERROR(0)
- Return type:
- getCurrentSetpoint()[source]¶
Get the rail setpoint current. Rail current control capabilities vary between modules. Refer to the module datasheet for definition of the rail current capabilities. The current in micro-amps (1 == 1e-6A) the rail is trying to achieve. On some modules this is a measured value so it may not exactly match what was previously set via the setCurrent interface. Refer to the module datasheet to to determine if this is a measured or stored value.
- Returns:
Result object containing the requested value when the results error is set to NO_ERROR(0)
- Return type:
- getEnable()[source]¶
Get the state of the external rail switch. Not all rails can be switched on and off. Refer to the module datasheet for capability specification of the rails. true: enabled: connected to the supply rail voltage; false: disabled: disconnected from the supply rail voltage
- Returns:
Result object containing the requested value when the results error is set to NO_ERROR(0)
- Return type:
- getKelvinSensingEnable()[source]¶
Determine whether kelvin sensing is enabled or disabled. Refer to the module datasheet for definition of the rail kelvin sensing capabilities. Kelvin sensing is enabled or disabled.
- Returns:
Result object containing the requested value when the results error is set to NO_ERROR(0)
- Return type:
- getKelvinSensingState()[source]¶
Determine whether kelvin sensing has been disabled by the system. Refer to the module datasheet for definition of the rail kelvin sensing capabilities. Kelvin sensing is enabled or disabled.
- Returns:
Result object containing the requested value when the results error is set to NO_ERROR(0)
- Return type:
- getOperationalMode()[source]¶
Determine the current operational mode of the system. Refer to the module datasheet for definition of the rail operational mode capabilities. The current operational mode setting.
- Returns:
Result object containing the requested value when the results error is set to NO_ERROR(0)
- Return type:
- getOperationalState()[source]¶
Determine the current operational state of the system. Refer to the module datasheet for definition of the rail operational states. The current operational state, hardware configuration, faults, and operating mode.
- Returns:
Result object containing the requested value when the results error is set to NO_ERROR(0)
- Return type:
- getPower()[source]¶
Get the rail supply power. Rail power control capabilities vary between modules. Refer to the module datasheet for definition of the rail power capabilities. The power in milli-watts (1 == 1e-3W) currently supplied by the rail. On some modules this is a measured value so it may not exactly match what was previously set via the setPower interface. Refer to the module datasheet to to determine if this is a measured or stored value.
- Returns:
Result object containing the requested value when the results error is set to NO_ERROR(0)
- Return type:
- getPowerLimit()[source]¶
Get the rail power maximum limit setting. (Check product datasheet to see if this feature is available) The power in milli-watts (mW).
- Returns:
Result object containing the requested value when the results error is set to NO_ERROR(0)
- Return type:
- getPowerSetpoint()[source]¶
Get the rail setpoint power. Rail power control capabilities vary between modules. Refer to the module datasheet for definition of the rail power capabilities. The power in milli-watts (1 == 1e-3W) the rail is trying to achieve. On some modules this is a measured value so it may not exactly match what was previously set via the setPower interface. Refer to the module datasheet to to determine if this is a measured or stored value.
- Returns:
Result object containing the requested value when the results error is set to NO_ERROR(0)
- Return type:
- getResistance()[source]¶
Get the rail load resistance. Rail resistance control capabilities vary between modules. Refer to the module datasheet for definition of the rail resistance capabilities. The resistance in milli-ohms (1 == 1e-3Ohms) currently drawn by the rail. On some modules this is a measured value so it may not exactly match what was previously set via the setResistance interface. Refer to the module datasheet to to determine if this is a measured or stored value.
- Returns:
Result object containing the requested value when the results error is set to NO_ERROR(0)
- Return type:
- getResistanceSetpoint()[source]¶
Get the rail setpoint resistance. Rail resistance control capabilities vary between modules. Refer to the module datasheet for definition of the rail resistance capabilities. The resistance in milli-ohms (1 == 1e-3Ohms) the rail is trying to achieve. On some modules this is a measured value so it may not exactly match what was previously set via the setResistance interface. Refer to the module datasheet to to determine if this is a measured or stored value.
- Returns:
Result object containing the requested value when the results error is set to NO_ERROR(0)
- Return type:
- getTemperature()[source]¶
Get the rail temperature. The measured temperature associated with the rail in micro-Celsius (1 == 1e-6˚C). The temperature may be associated with the module’s internal rail circuitry or an externally connected temperature sensors. Refer to the module datasheet for definition of the temperature measurement location and specific capabilities.
- Returns:
Result object containing the requested value when the results error is set to NO_ERROR(0)
- Return type:
- getVoltage()[source]¶
Get the rail supply voltage. Rail voltage control capabilities vary between modules. Refer to the module datasheet for definition of the rail voltage capabilities. The voltage in micro-volts (1 == 1e-6V) currently supplied by the rail. On some modules this is a measured value so it may not exactly match what was previously set via the setVoltage interface. Refer to the module datasheet to to determine if this is a measured or stored value.
- Returns:
Result object containing the requested value when the results error is set to NO_ERROR(0)
- Return type:
- getVoltageMaxLimit()[source]¶
Get the rail voltage maximum limit setting. (Check product datasheet to see if this feature is available) The voltage in micro-volts (1 == 1e-6V).
- Returns:
Result object containing the requested value when the results error is set to NO_ERROR(0)
- Return type:
- getVoltageMinLimit()[source]¶
Get the rail voltage minimum limit setting. (Check product datasheet to see if this feature is available) The voltage in micro-volts (1 == 1e-6V).
- Returns:
Result object containing the requested value when the results error is set to NO_ERROR(0)
- Return type:
- getVoltageSetpoint()[source]¶
Get the rail setpoint voltage. Rail voltage control capabilities vary between modules. Refer to the module datasheet for definition of the rail voltage capabilities. The voltage in micro-volts (1 == 1e-6V) the rail is trying to achieve. On some modules this is a measured value so it may not exactly match what was previously set via the setVoltage interface. Refer to the module datasheet to to determine if this is a measured or stored value.
- Returns:
Result object containing the requested value when the results error is set to NO_ERROR(0)
- Return type:
- setCurrentLimit(microamps)[source]¶
Set the rail current limit setting. (Check product datasheet to see if this feature is available)
- Parameters:
microamps (const int) – The current in micro-amps (1 == 1e-6A).
- Returns:
An error result from the list of defined error codes in brainstem.result
- Return type:
unsigned byte
- setCurrentSetpoint(microamps)[source]¶
Set the rail supply current. Rail current control capabilities vary between modules. Refer to the module datasheet for definition of the rail current capabilities.
- Parameters:
microamps (const int) – The current in micro-amps (1 == 1e-6A) to be supply by the rail.
- Returns:
An error result from the list of defined error codes in brainstem.result
- Return type:
unsigned byte
- setEnable(bEnable)[source]¶
Set the state of the external rail switch. Not all rails can be switched on and off. Refer to the module datasheet for capability specification of the rails.
- Parameters:
bEnable (const unsigned char) – true: enable and connect to the supply rail voltage; false: disable and disconnect from the supply rail voltage
- Returns:
An error result from the list of defined error codes in brainstem.result
- Return type:
unsigned byte
- setKelvinSensingEnable(bEnable)[source]¶
Enable or Disable kelvin sensing on the module. Refer to the module datasheet for definition of the rail kelvin sensing capabilities.
- Parameters:
bEnable (const unsigned char) – enable or disable kelvin sensing.
- Returns:
An error result from the list of defined error codes in brainstem.result
- Return type:
unsigned byte
- setOperationalMode(mode)[source]¶
Set the operational mode of the rail. Refer to the module datasheet for definition of the rail operational capabilities.
- Parameters:
mode (const unsigned char) – The operational mode to employ.
- Returns:
An error result from the list of defined error codes in brainstem.result
- Return type:
unsigned byte
- setPowerLimit(milliwatts)[source]¶
Set the rail power maximum limit setting. (Check product datasheet to see if this feature is available)
- Parameters:
milliwatts (const int) – The power in milli-watts (mW).
- Returns:
An error result from the list of defined error codes in brainstem.result
- Return type:
unsigned byte
- setPowerSetpoint(milliwatts)[source]¶
Set the rail supply power. Rail power control capabilities vary between modules. Refer to the module datasheet for definition of the rail power capabilities.
- Parameters:
milliwatts (const int) – The power in milli-watts (1 == 1e-3W) to be supplied by the rail.
- Returns:
An error result from the list of defined error codes in brainstem.result
- Return type:
unsigned byte
- setResistanceSetpoint(milliohms)[source]¶
Set the rail load resistance. Rail resistance control capabilities vary between modules. Refer to the module datasheet for definition of the rail resistance capabilities.
- Parameters:
milliohms (const int) – The resistance in milli-ohms (1 == 1e-3Ohms) to be drawn by the rail.
- Returns:
An error result from the list of defined error codes in brainstem.result
- Return type:
unsigned byte
- setVoltageMaxLimit(microvolts)[source]¶
Set the rail voltage maximum limit setting. (Check product datasheet to see if this feature is available)
- Parameters:
microvolts (const int) – The voltage in micro-volts (1 == 1e-6V).
- Returns:
An error result from the list of defined error codes in brainstem.result
- Return type:
unsigned byte
- setVoltageMinLimit(microvolts)[source]¶
Set the rail voltage minimum limit setting. (Check product datasheet to see if this feature is available)
- Parameters:
microvolts (const int) – The voltage in micro-volts (1 == 1e-6V).
- Returns:
An error result from the list of defined error codes in brainstem.result
- Return type:
unsigned byte
- setVoltageSetpoint(microvolts)[source]¶
Set the rail supply voltage. Rail voltage control capabilities vary between modules. Refer to the module datasheet for definition of the rail voltage capabilities.
- Parameters:
microvolts (const int) – The voltage in micro-volts (1 == 1e-6V) to be supplied by the rail.
- Returns:
An error result from the list of defined error codes in brainstem.result
- Return type:
unsigned byte