Accomplish application of Continuous Measurement and Logging with CSM. It's much more simple, intuitive and graceful.
API | Description | Parameter |
---|---|---|
API: Update Settings |
Config API | Full path of data folder (Type: Plain String) |
API: Start |
Start logging. Create the tdms file in data folder with time-based file name. | N/A |
API: Log |
Log data to tdms file. | 1D Waveform array. (Type: MassData Arguments) |
API: Stop |
Stop logging. | N/A |
Example: (Suppose module name is "Logging")
API: Update Settings >> c:\_data -> Logging
API: Log >> MassData-Start:89012,Size:1156 -> Logging
API: Start -> Logging
API: Stop -> Logging
API | Description | Parameter |
---|---|---|
API: Update Settings |
Config API | Cluster:{HW(String),Signal Type(Enum)} (Type: HexStr) |
API: Update Settings v2.0 |
Config API | HW:(string);Signal Type:(Sine Wave | Square with Noise) (Type: API String) |
API: Start |
Start data generation every 200ms. | N/A |
API: Stop |
Stop data generation. | N/A |
Status | Description | Parameter |
---|---|---|
Acquired Waveform | Simulated Data. | 1D Waveform array. (Type: MassData Arguments) |
Example: (Suppose module name is "Acquisition")
API: Start -> Acquisition
API: Stop -> Acquisition
//With CSM-API-String-Arguments-Support, update 'Signal Type' with plain text description
API: Update Settings v2.0 >> Signal Type:Sine Wave -> Acquisition
API | Description | Parameter |
---|---|---|
API: FFT(Peak) |
Analyze waveform with FFT(peak) method | 1D Waveform array. (Type: MassData Arguments) |
API: FFT(RMS) |
Analyze waveform with FFT(RMS) method | HW:(string);Signal Type:(Sine Wave | 1D Waveform array. (Type: MassData Arguments) |
API: Power Spectrum |
Get Power Spectrum of Waveform | 1D Waveform array. (Type: MassData Arguments) |
Status | Description | Parameter |
---|---|---|
FFT(Peak) | FFT(peak) spectrum Data. | 1D Waveform array. (Type: MassData Arguments) |
FFT(RMS) | FFT(RMS) spectrum Data. | 1D Waveform array. (Type: MassData Arguments) |
Power Spectrum | Power Spectrum Data. | 1D Waveform array. (Type: MassData Arguments) |
Logging Module
and Acquisition Module
don't know each other at all.
User interface module is needed for Continuous Measurement and Logging application.
To make it sample(and easy to compare with workers), UI Module is also acting as the controller of the application.
When you need to use real hardware for data acquisition, create another CSM module for your hardware with the same API/Status and replace the Acquisition Module
in UI module.
Create UI, which is similar as Workers Continuous Measurement and Logging Example
Create Block Diagram with CSM Template. Drop Logging Module
and Acquisition Module
as submodules.
stateDiagram-v2
direction LR
Acquisition --> Algorithm : "Acquired Waveform >> Power Spectrum"
Acquisition --> Algorithm : Acquired Waveform >> FFT(RMS)
Acquisition --> Logging : "Acquired Waveform >> API:Log"
Acquisition --> UI : "Acquired Waveform >> UI:Update Waveform"
Algorithm --> UI : "FFT(RMS) >> UI:Update FFT"
Algorithm --> UI : "Power Spectrum >> UI:Update Power Spectrum"
Initialize data and UI. Load configuration from xml file and send config to submodules. Register "Acquired Waveform" status of "Acquisition" to "UI: Update Waveforms" state of "UI". When "Acquired Waveform" status occurs, "UI" will go to "UI: Update Waveforms" automatically.
Stop submodules and UI module itself then.
Update UI and trigger submodule to work with start message. Register "Acquired Waveform" status of "Acquisition" to "API: Log" state of "Logging". When "Acquired Waveform" status occurs, "logging" will go to "API: Log" automatically.
Update UI and stop submodules. Unregister "Acquired Waveform" status of "Acquisition".