State Machine
This section provides an overview of possible operating states of the smartCORE edge device software and their interrelationships.
Motivation
The smartCORE software usually runs through different operating states during a runtime.
Start of measurement mode
To successfully start measuring mode, the following states are run through in succession.
State | Meaning | |
---|---|---|
1. | Ready | Initial state after starting the application |
2. | LoadSystemConfig | Loading the system configuration /sdi/config/smartcore.json |
3. | LoadSystemModules | Load the modules specified within the system configuration |
4. | InitSystemModules | Initialization of the modules specified within the system configuration |
5. | InitSystemProducerChannels | Creation of the channels to be produced for all modules specified within the system configuration |
6. | InitSystemConsumerChannels | Selection of the channels to be consumed for all modules specified within the system configuration |
7. | Ready | Transit state after successful processing of the system configuration |
8. | LoadMeasurementConfig | Load the measurement configuration /sdi/config/smartcore_dynamic.json |
9. | LoadMeasurementModules | Load the modules specified within the measurement configuration |
10. | InitMeasurementModules | Initialization of the modules specified within the measurement configuration |
11. | InitMeasurementProducerChannels | Creating the channels to be produced for all modules specified within the measurement configuration |
12. | InitMeasurementConsumerChannels | Selection of the channels to be consumed for all modules specified within the measurement configuration |
13. | StartConsume | Start the consuming functionality of all modules |
14. | StartProduce | Start of the producing functionality all modules |
15. | Running | State after reaching the measuring mode |
Channels created in system modules can be selected and consumed in both system and measurement modules, while channels created in measurement modules CANNOT be selected in system modules and therefore CANNOT be consumed.
The producer channels are created first so that the consumer channels can then be selected from them.
In contrast, the consumption mechanisms of all modules are started first and only then the production mechanisms in order to avoid overflows.
While (producer) channels can ONLY be created in the states intended for the creation (initialization) of these channels, there are states for the selection for consumption (also referred to as initialization), but a new selection of channels to be consumed can be made at any time. This is particularly the case in scenarios with interactive selection (such as data consumption/provision via SCPI).
Explicit shutdown/restart
The smartCORE is shut down only if the user explicitly requests it (e.g. as part of a configuration update).
The following mechanisms exist
- to stop the measurement mode
- to stop the complete smartCORE measurement and system operation
and also to restart the meter.
Explicit shutdown of the measurement mode
The following states are run through sequentially during measurement mode shutdown.
State / Process | Meaning | |
---|---|---|
1. | Running | Initial state (measurement mode) |
2. | StopProduce | Stop the producing functionality of all modules |
3. | StopConsume | Stop consuming functionality all modules |
4. | CleanupMeasurementModules | Destruction of the modules specified within the measurement configuration |
5. | Ready | State after successful shutdown of measurement operation |
An optional restart is carried out as described above under System start (Part II).
Explicit shutdown of system operation
During the shutdown of system operation (or the complete smartCORE), the following states are run through sequentially.
State / Process | Meaning | |
---|---|---|
1. | Running | Initial state (measurement mode) |
2. | StopProduce | Stop the producing functionality of all modules |
3. | StopConsume | Stop consuming functionality all modules |
4. | CleanupMeasurementModules | Destruction of the modules specified within the measurement configuration |
5. | CleanupSystemModules | Destruction of the modules specified within the measurement configuration |
5. | Ready | State after successful shutdown of measurement operation |
An optional restart is carried out as described above under System start (Part I) followed by System start (Part II).
The difference between shutting down the measurement or system operation is therefore only in the destruction of all system modules. Consequently, it makes sense to include modules in the system configuration that are to be persistent with regard to a restart of measurement operation.
Device restart
The device restart results in a shutdown of system operation with subsequent start of measurement operation after restarting the measuring device.