![]() |
TopCon API
1.1.0
.Net API to control TopCon devices
|
Central class for Battery simulation. You cannot create an object for this type over new command. To obtain that object call the function: GetBatterySimulationObject() from topCon object. Example: var batSimulation = myTopCon.GetBatterySimulationObject(); If the TC device is disconnected or the option BatSim is not installed into the TC device, you get a null object. More...
Public Member Functions | |
delegate void | ConnectionChangedDelegate (bool connected, int port) |
Information over current connection with a TC device. More... | |
delegate void | SimulationStateChangedDelegate (BatterySimulationState simulationState) |
Simulation state is changed. More... | |
bool | LoadBatteryConfiguration (string pathToBatteryConfiguration) |
Load a predefined battery configuration. With the help of ESSControl you have already defined a battery configuration. Let's say it has the name LeadAcid100Ah.batsimcnf and it is in the directory C:\Temp\ then call this function myBatSim.LoadBatteryConfiguration("C:\Temp\LeadAcid100Ah.batsimcnf"); If the path not exist or is not valid you get an exception. More... | |
bool | LoadCustomScript (string pathToBatSimScript) |
Load a predefined battery simulation script. Also in ESSControl (suppose) you have defined a java script (or use the default script) called MyBatSimScript.batSim and it is in the directory C:\Temp\ then call the function myBatSim.LoadCustomScript( "C:\Temp\MyBatSimScript.batSim"); If the path not exist or is not valid you get an exception. More... | |
bool | IsBatSimAvailable () |
Get if BatSim option is enabled. A prerequisite is a connection to the device and BatSim option should be enabled. More... | |
bool | IsSimulationActiv () |
Informs if the simulation is running. More... | |
bool | StartSimulation () |
Start the battery simulation. A prerequisite is a connection to the device and BatSim option should be enabled. Calling only allowed by Stopped state. In this case the simulation will go to Started state. A call from Started, Paused, Idle or Stopped state generate a BatterySimulationStateException. More... | |
bool | StopSimulation () |
Stop the battery simulation. A prerequisite is a connection to the device and BatSim option should be enabled. Calling only allowed by Started or Paused state. In this case the simulation will go to Stoped state. A call from Idle or Stopped state generate a exception. More... | |
bool | PauseSimulation () |
Pause the battery simulation. A prerequisite is a connection to the device and BatSim option should be enabled. Calling only allowed by Started state. In this case the simulation will go to Paused state. A call from Paused, Idle or Stopped state generate a exception. More... | |
bool | ResumeSimulation () |
Resume the battery simulation. A prerequisite is a connection to the device and BatSim option should be enabled. Calling only allowed by Paused state. In this case the simulation will go to Started state. A call from Started, Idle or Stopped state generate a exception. More... | |
bool | SetStateOfCharge (double stateOfCharge) |
Set the state of charge. A prerequisite is a connection to the device and BatSim option should be enabled. Calling only allowed by Stopped or Paused state. More... | |
bool | GetSimulationState (out BatterySimulationState simulationState) |
Get the battery simulation state. A prerequisite BatSim option should be enabled. More... | |
bool | GetBatteryActualValues (out ActualBatteryValues actualBatteryValues) |
Get the battery simulation state. A prerequisite BatSim option should be enabled. More... | |
string | GetLastError () |
Get the last exception message. More... | |
Public Attributes | |
bool | ReadyToRun => _playCtrStateMachine.CurrentSimulationState != BatterySimulationState.Idle |
Return true if Battery configuration, customer script are loaded and top con device is connected. Otherwiese false More... | |
bool | ScriptIsRunning => _playCtrStateMachine.ScriptIsRunning |
Get true if custom script is on running. More... | |
Events | |
ConnectionChangedDelegate | OnConnectionChanged |
Event for delegate ConnectionChangedDelegate. More... | |
SimulationStateChangedDelegate | OnSimulationStateChanged |
A subscription to this event informs if the battery is charging or not More... | |
Central class for Battery simulation. You cannot create an object for this type over new command. To obtain that object call the function: GetBatterySimulationObject() from topCon object. Example: var batSimulation = myTopCon.GetBatterySimulationObject(); If the TC device is disconnected or the option BatSim is not installed into the TC device, you get a null object.
delegate void CH.Regatron.HPPS.EnergyStorage.BatSimulation.BatterySimulation.ConnectionChangedDelegate | ( | bool | connected, |
int | port | ||
) |
Information over current connection with a TC device.
connected | |
port |
bool CH.Regatron.HPPS.EnergyStorage.BatSimulation.BatterySimulation.GetBatteryActualValues | ( | out ActualBatteryValues | actualBatteryValues | ) |
Get the battery simulation state. A prerequisite BatSim option should be enabled.
actualBatteryValues | Indicates the actual state of the batterie. Actual current, voltage, charge count, state of charge, cutoff information and the charging state, |
string CH.Regatron.HPPS.EnergyStorage.BatSimulation.BatterySimulation.GetLastError | ( | ) |
bool CH.Regatron.HPPS.EnergyStorage.BatSimulation.BatterySimulation.GetSimulationState | ( | out BatterySimulationState | simulationState | ) |
Get the battery simulation state. A prerequisite BatSim option should be enabled.
simulationState |
Idle: Simulation deactivated. Immediately after the object is generated has the state Idle. In this state the object is waiting for a connection, a configuration file and a battery simulation script. When all that happens, the simulation object goes to the stopped state.
Stopped: Simulation is stopped. In this state you can call the function _batterySimulation.StartSimulation() If the connection to the device is cut, the object goes to the idle state.
Started: Simulation is running The simulation is activated. In this state you can periodically call the function: _batterySimulation.GetBatteryActualValues( out values);
Paused: Simulation paused. In this state you can redefine the value from battery state of charge. To do this call the function: _batterySimulation.SetStateOf Charge( double newSoc); after that, to continue with the simulation call: _batterySimulation.ResumeSimulation(); The simulation goes to Started state.
In this state (Paused) you can also stop the simulation, through a call to _batterySimualtion.StopSimulation(); The simulation goes to state Stoped.
If the connection to the device is lost, the object goes to the idle state.
bool CH.Regatron.HPPS.EnergyStorage.BatSimulation.BatterySimulation.IsBatSimAvailable | ( | ) |
Get if BatSim option is enabled. A prerequisite is a connection to the device and BatSim option should be enabled.
bool CH.Regatron.HPPS.EnergyStorage.BatSimulation.BatterySimulation.IsSimulationActiv | ( | ) |
Informs if the simulation is running.
bool CH.Regatron.HPPS.EnergyStorage.BatSimulation.BatterySimulation.LoadBatteryConfiguration | ( | string | pathToBatteryConfiguration | ) |
Load a predefined battery configuration. With the help of ESSControl you have already defined a battery configuration. Let's say it has the name LeadAcid100Ah.batsimcnf and it is in the directory C:\Temp\ then call this function myBatSim.LoadBatteryConfiguration("C:\Temp\LeadAcid100Ah.batsimcnf"); If the path not exist or is not valid you get an exception.
pathToBatteryConfiguration | Full path of battery configuration file |
bool CH.Regatron.HPPS.EnergyStorage.BatSimulation.BatterySimulation.LoadCustomScript | ( | string | pathToBatSimScript | ) |
Load a predefined battery simulation script. Also in ESSControl (suppose) you have defined a java script (or use the default script) called MyBatSimScript.batSim and it is in the directory C:\Temp\ then call the function myBatSim.LoadCustomScript( "C:\Temp\MyBatSimScript.batSim"); If the path not exist or is not valid you get an exception.
pathToBatSimScript | Full path of battery simulation java script. |
bool CH.Regatron.HPPS.EnergyStorage.BatSimulation.BatterySimulation.PauseSimulation | ( | ) |
Pause the battery simulation. A prerequisite is a connection to the device and BatSim option should be enabled. Calling only allowed by Started state. In this case the simulation will go to Paused state. A call from Paused, Idle or Stopped state generate a exception.
bool CH.Regatron.HPPS.EnergyStorage.BatSimulation.BatterySimulation.ResumeSimulation | ( | ) |
Resume the battery simulation. A prerequisite is a connection to the device and BatSim option should be enabled. Calling only allowed by Paused state. In this case the simulation will go to Started state. A call from Started, Idle or Stopped state generate a exception.
bool CH.Regatron.HPPS.EnergyStorage.BatSimulation.BatterySimulation.SetStateOfCharge | ( | double | stateOfCharge | ) |
Set the state of charge. A prerequisite is a connection to the device and BatSim option should be enabled. Calling only allowed by Stopped or Paused state.
delegate void CH.Regatron.HPPS.EnergyStorage.BatSimulation.BatterySimulation.SimulationStateChangedDelegate | ( | BatterySimulationState | simulationState | ) |
Simulation state is changed.
simulationState |
Idle: Simulation deactivated. Immediately after the object is generated has the state Idle. In this state the object is waiting for a connection, a configuration file and a battery simulation script. When all that happens, the simulation object goes to the stopped state.
Stopped: Simulation is stopped. In this state you can call the function _batterySimulation.StartSimulation() If the connection to the device is cut, the object goes to the idle state.
Started: Simulation is running The simulation is activated. In this state you can periodically call the function: _batterySimulation.GetBatteryActualValues( out values);
Paused: Simulation paused. In this state you can redefine the value from battery state of charge. To do this call the function: _batterySimulation.SetStateOf Charge( double newSoc); after that, to continue with the simulation call: _batterySimulation.ResumeSimulation(); The simulation goes to Started state.
In this state (Paused) you can also stop the simulation, through a call to _batterySimualtion.StopSimulation(); The simulation goes to state Stoped.
If the connection to the device is lost, the object goes to the idle state.
bool CH.Regatron.HPPS.EnergyStorage.BatSimulation.BatterySimulation.StartSimulation | ( | ) |
Start the battery simulation. A prerequisite is a connection to the device and BatSim option should be enabled. Calling only allowed by Stopped state. In this case the simulation will go to Started state. A call from Started, Paused, Idle or Stopped state generate a BatterySimulationStateException.
bool CH.Regatron.HPPS.EnergyStorage.BatSimulation.BatterySimulation.StopSimulation | ( | ) |
Stop the battery simulation. A prerequisite is a connection to the device and BatSim option should be enabled. Calling only allowed by Started or Paused state. In this case the simulation will go to Stoped state. A call from Idle or Stopped state generate a exception.
bool CH.Regatron.HPPS.EnergyStorage.BatSimulation.BatterySimulation.ReadyToRun => _playCtrStateMachine.CurrentSimulationState != BatterySimulationState.Idle |
Return true if Battery configuration, customer script are loaded and top con device is connected. Otherwiese false
bool CH.Regatron.HPPS.EnergyStorage.BatSimulation.BatterySimulation.ScriptIsRunning => _playCtrStateMachine.ScriptIsRunning |
Get true if custom script is on running.
ConnectionChangedDelegate CH.Regatron.HPPS.EnergyStorage.BatSimulation.BatterySimulation.OnConnectionChanged |
Event for delegate ConnectionChangedDelegate.
SimulationStateChangedDelegate CH.Regatron.HPPS.EnergyStorage.BatSimulation.BatterySimulation.OnSimulationStateChanged |
A subscription to this event informs if the battery is charging or not