Class ClipXModule
Represents a module for a ClipX measurement device.
Inheritance
Implements
Inherited Members
Namespace: Loehnert.Lisrt.Hbm.ClipX
Assembly: Loehnert.Lisrt.Hbm.dll
Syntax
public class ClipXModule : InitializableCompositeModule, ICompositeModule, ILisrtModule, IInitializable, INotifyPropertyChangedEx, INotifyPropertyChanged, IHasServiceView, IHasDeviceLabel
Examples
This example shows how to set the trigger, await an input and show the records
import clr, time
clr.AddReference("Loehnert.Lisrt.Hbm")
clr.AddReference("Loehnert.Waveforms")
from Loehnert.Lisrt.Hbm.ClipX import RecordMode, RecordTriggerFlag, WaveformValue
from Loehnert.Waveforms import Plotter
ClipX.SetSampleRate(1000)
ClipX.SetTrigger(RecordMode.FillByState, RecordTriggerFlag.DigitalInput1)
while(not ClipX.ReadDigitalInput(0)):
time.sleep(0.001)
while(ClipX.ReadDigitalInput(0)):
time.sleep(0.001)
records = ClipX.ReadWaveforms()
Plotter.Plot(record)
Constructors
ClipXModule(String)
Initializes a new instance of the ClipXModule class.
Declaration
public ClipXModule(string name)
Parameters
Type | Name | Description |
---|---|---|
String | name | Name of the module. |
Properties
DeviceLabel
Gets or sets the label for the device.
Declaration
[Configuration("")]
public string DeviceLabel { get; set; }
Property Value
Type | Description |
---|---|
String |
InstanceID
Gets or sets the ID for this instance.
Declaration
public int InstanceID { get; set; }
Property Value
Type | Description |
---|---|
System.Int32 |
Methods
ConfigureWaveform(UInt32, SignalType)
Configures a signalType
for the waveformIndex
.
Declaration
public void ConfigureWaveform(uint waveformIndex, SignalType signalType)
Parameters
Type | Name | Description |
---|---|---|
System.UInt32 | waveformIndex | Index of the waveform (0-5). |
SignalType | signalType | Value to record. |
Exceptions
Type | Condition |
---|---|
ArgumentOutOfRangeException | Thrown if |
System.ComponentModel.InvalidEnumArgumentException | Thrown if |
NotInitializedException | Thrown when InitializationState is not Initialized or IsInitializing. |
Exit()
Exits the module.
Declaration
public override void Exit()
Overrides
GetValue(SignalType)
Gets the latest value.
Declaration
public double GetValue(SignalType signalType = SignalType.Net)
Parameters
Type | Name | Description |
---|---|---|
SignalType | signalType | Value to read. |
Returns
Type | Description |
---|---|
Double | The latest |
Exceptions
Type | Condition |
---|---|
NotInitializedException | Thrown when InitializationState is not Initialized. |
Initialize()
Initializes the module.
Declaration
public override void Initialize()
Overrides
ReadDigitalInput(Int32)
Reads the digital input value.
Declaration
public bool ReadDigitalInput(int inputIndex)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | inputIndex | Index of the digital input (0 or 1). |
Returns
Type | Description |
---|---|
Boolean | True, if the digital input has a high value. Otherwise false. |
Exceptions
Type | Condition |
---|---|
ArgumentOutOfRangeException | Thrown if |
NotInitializedException | Thrown when InitializationState is not Initialized. |
ReadWaveforms()
Reads the recorded waveforms.
Declaration
public IReadOnlyList<IWaveform> ReadWaveforms()
Returns
Type | Description |
---|---|
System.Collections.Generic.IReadOnlyList<IWaveform> | The recorded waveforms. |
Remarks
Reading the waveforms takes about 56ms per 1000 samples in all waveforms.
Exceptions
Type | Condition |
---|---|
NotInitializedException | Thrown when InitializationState is not Initialized. |
SetSampleRate(Single)
Sets the sample rate.
Declaration
public void SetSampleRate(float samplesPerSecond)
Parameters
Type | Name | Description |
---|---|---|
System.Single | samplesPerSecond | Samples per second. |
Exceptions
Type | Condition |
---|---|
ArgumentOutOfRangeException | Thrown if |
NotInitializedException | Thrown when InitializationState is not Initialized. |
SetTrigger(RecordingMode, RecordingTriggers)
Sets the record mode and trigger.
Declaration
public void SetTrigger(RecordingMode recordMode, RecordingTriggers triggers)
Parameters
Type | Name | Description |
---|---|---|
RecordingMode | recordMode | Mode for recording. |
RecordingTriggers | triggers | Triggers for recording. (Multiple triggers are logical OR combined.) |
Exceptions
Type | Condition |
---|---|
System.ComponentModel.InvalidEnumArgumentException | Thrown if |
NotInitializedException | Thrown when InitializationState is not Initialized. |
ShowServiceView()
Shows the service window.
Declaration
public void ShowServiceView()
Tare()
Tares the value.
Declaration
public void Tare()
Exceptions
Type | Condition |
---|---|
NotInitializedException | Thrown when InitializationState is not Initialized. |