optoKummenberg

Loading...
Searching...
No Matches
optoKummenberg.registers.InputStage.SignalGenerator Class Reference
Inheritance diagram for optoKummenberg.registers.InputStage.SignalGenerator:

## Public Member Functions
| __init__ (self, int channel=0, board=None, sys_id_base=0x60)
| SetUnit (self, UnitType or int value)
| Sets the unit type of the values set to the signal generator.
UnitType | GetUnit (self)
| Gets the unit type of the values set to the signal generator.
| Run (self)
| Starts the signal generator.
| Stop (self)
| Stops the signal generator.
| GetRunningStatus (self)
| Gets the running status of the signal generator.
| SetShape (self, WaveformShape or int value)
| Sets the shape of the generated signal.
WaveformShape | GetShape (self)
| Gets the shape of the generated signal.
| SetFrequency (self, value)
| Sets the frequency of the generated signal.
| GetFrequency (self)
| Gets the frequency of the generated signal.
| SetAmplitude (self, value)
| Sets the amplitude of the generated signal.
| GetAmplitude (self)
| Gets the amplitude of the generated signal.
| SetOffset (self, value)
| Sets the offset of the generated signal.
| GetOffset (self)
| Gets the offset of the generated signal.
| SetPhase (self, value)
| Sets the phase delay of the generated signal.
| GetPhase (self)
| Gets the phase delay of the generated signal.
| SetCycles (self, value)
| Sets the number of cycles the generated signal.
| GetCycles (self)
| Gets the number of cycles the generated signal.
| SetDutyCycle (self, value)
| Sets duty cycle of the generated signal.
| GetDutyCycle (self)
| Gets duty cycle of the generated signal.
| SetExternalTrigger (self, value)
| Sets the external trigger mode.
| GetOutput (self)
| Gets output of the signal generator.
| SetStairCount (self, value)
| Sets stair count of the generatred signal, only available when shape is set to stair.
| GetStairCount (self)
| Gets stair count of the generatred signal, only available when shape is set to stair.
| SetExtTriggerGPIO (self, value)
| Turns GPIOx pin to trigger input source (GPIOx default is trigger output) and disables global external trigger SYNCx pin.
| GetExtTriggerGPIO (self)
| Gets the state of GPIOx pin to trigger input source (GPIOx default is trigger output) and disables global external trigger SYNCx pin.
| SetOutTriggerTimeShift (self, value)
| Allows fine adjustment of output trigger timing versus generated output signal (value in ms) (limit of shift value = period)
| GetOutTriggerTimeShift (self)
| Gets output trigger timing shift value (in ms)
| SetOutTriggerDutyCycle (self, value)
| Sets duty cycle of the trigger pulse with respect to period of generated signal (for real duration it has to be multiplied with period; for staircase shape with period/stair count)
| GetOutTriggerDutyCycle (self)
| Gets duty cycle of the trigger pulse with respect to period of generated signal.
| SetSettlingDelay (self, value)
| Sets settling delay (in ms) which for FastAutoFocus shape allows to add extra time with constant value before and after the ramp to minimise ringing effect (max.
| GetSettlingDelay (self)
| Gets settling delay value.
Public Member Functions inherited from optoKummenberg.registers.ClassAbstracts.InputStage
| __init__ (self, int or None channel=0, board=None)
| SetAsInput (self)
Public Member Functions inherited from optoKummenberg.registers.ClassAbstracts.System
| __init__ (self, int or None channel=None, board=None)
| set_register (self, str or int register_name_or_id, value, bool set_internal=False)
| set_register_id (self, int register_id, value, type=None)
| get_register (self, str or int register_name_or_id)
| get_register_id (self, int register_id)
| get_register_names (self)

## Static Public Member Functions
| help ()

## Public Attributes
| sys_id = sys_id_base | channel
dict | unit
dict | run
dict | shape
dict | frequency
dict | amplitude
dict | offset
dict | phase
dict | cycles
dict | duty_cycle
dict | external_trigger
dict | output
dict | stair_count
dict | ext_trigger_gpio
dict | out_trigger_shift
dict | out_trigger_duty
dict | settling_delay
dict | inst_phase
Public Attributes inherited from optoKummenberg.registers.ClassAbstracts.System
| name = self.__class__.__name__
| register_list = self._get_register_list()

## Additional Inherited Members
Protected Member Functions inherited from optoKummenberg.registers.ClassAbstracts.System
| _get_register_list (self)
Protected Attributes inherited from optoKummenberg.registers.ClassAbstracts.System
| _channel = channel
| _board = board
Static Protected Attributes inherited from optoKummenberg.registers.ClassAbstracts.System
bool | _is_a_system = False

## Detailed Description

    Input Channel Systems - Signal Generator Channel
    System ID for channel 0: 0x60

    Signal Generator is a system for generating input signals of particular \ref WaveformShape "shapes".
    It is an input stage system, meaning that it is a system used as the very first stage of \ref signalflow.

    To set it up, all the appropriate registers (seen in the table below) have to be configured first.
    The shape of the signal, its frequency, amplitude, offset and phase can be adjusted.
    For the square and pulse waveforms, the signal's duty cycle can be configured.

    The unit type of the value being output by the
    SignalGenerator, must match to the control mode selected by the \ref SignalFlowManager "Signal Flow Manager".

    By default, the Signal Generator will continuously output the waveform corresponding to the configuration.
    If only a single period is desired (or N periods for some finite positive integer N),
    the number of desired periods to execute has to be set to the "cycles" register before running the system.
    A negative value in this register corresponds to infinite looping.

    Finally, to get the configured SignalFlow generator to run, the following steps have to take place:
      -# The Signal Generator system has to be set as active Input Stage system for the corresponding channel. This is done through the \ref SignalFlowManager "Signal Flow Manager" system.
      -# The "Run" register of the corresponding Signal Generator system has to be set to true (any non-zero value).

    ### Register Map:

    | Address    | Name                      | Default Value | Description                                                                                                               | Type                  | Access
    | -----------|---------------------------|---------------|---------------------------------------------------------------------------------------------------------------------------|-----------------------|-------------------
    | 0x6[0-7]00 | Unit type                 | 0             |                                                                                                                           | \ref ChannelValueType | read write
    | 0x6[0-7]01 | Run                       | false         | Turn Signal Generator on/off                                                                                              | boolean               | read write
    | 0x6[0-7]02 | Shape                     | 0             |                                                                                                                           | \ref WaveformShape    | read write
    | 0x6[0-7]03 | Frequency                 | 0.0           | Frequency in Hz of generated signal                                                                                       | float                 | read write
    | 0x6[0-7]04 | Amplitude                 | 0.0           | Amplitude of generated signal                                                                                             | float                 | read write
    | 0x6[0-7]05 | Offset                    | 0.0           | Offset of generated signal                                                                                                | float                 | read write
    | 0x6[0-7]06 | Phase                     | 0.0 [rad]     | Phase of generated signal in radians                                                                                      | float                 | read write
    | 0x6[0-7]07 | Cycles                    | -1            | Number of cycles to be generated. Run flag is turned off after completion. Negative value corresponds to infinite looping | int32                 | read write
    | 0x6[0-7]08 | Duty cycle                | 0.5           | Duty cycle of square and pulse shapes                                                                                     | 0 to 1 float <BR> Resolution is frequency/10000 | read write
    | 0x6[0-7]09 | External trigger          | 0             | Signal generator unit can be synchronised with external signal (0=disabled, 1=rising/falling edge, 2=rising edge trigger) | uint32                | read write
    | 0x6[0-7]0a | Output                    | N/A           | Output of signal generator                                                                                                | float                 | read only
    | 0x6[0-7]0b | Stair count               | 5             | Count + direction of stairs for Staircase and FastAutoFocus shape<br/>(for FastAutoFocus it defines number of output trigger pulses, for other shapes it has no effect) | int32 (-100 to 100)   | read write
    | 0x6[0-7]0c | External trigger GPIOx    | false         | Turns GPIOx pin to trigger input source (GPIOx default is trigger output) and disables global external trigger SYNCx pin  | boolean               | read write
    | 0x6[0-7]0d | Output trigger time shift (*)| 0.0 [ms]   | Allows fine adjustment of output trigger timing versus generated output signal<br/>(can be only positive, limit of shift value = period/stair count; the trigger pulse duration will be cut above this limit) | float | read write
    | 0x6[0-7]0e | Output trigger duty cycle (*)| 0.5        | Duty cycle of the trigger pulse with respect to period of generated signal<br/>(for real duration it has to be multiplied with period; for staircase shape with period/stair count)| float (0.0 to 1.0) | read write
    | 0x6[0-7]0f | Settling delay (*)           | 0.0 [ms]   | For FastAutoFocus shape it allows to add extra time with constant value before and after the ramp to minimise ringing effect <br/>(max. value is limited to 25% of period)| float | read write

    \note
    (*) Output trigger time shift is available only for Staircase and FastAutoFocus shapes which are dedicated for usage with a camera.
        Range of allowed values depends on frequency and stair count therefore these registers have to be set in advance.

    registers table 1:

    +---------------+-------+
    | Waveform Unit | Value |
    +===============+=======+
    | Current       | 0     |
    +---------------+-------+
    | OF            | 1     |
    +---------------+-------+
    | XY            | 2     |
    +---------------+-------+
    | FP            | 3     |
    +---------------+-------+
    | Unitless      | 4     |
    +---------------+-------+

    registers table 2:

    +----------------------+-------+
    | Waveform Shape       | Value |
    +======================+=======+
    | Sinusoidal           | 0     |
    +----------------------+-------+
    | Triangular           | 1     |
    +----------------------+-------+
    | Rectangular          | 2     |
    +----------------------+-------+
    | Sawtooth             | 3     |
    +----------------------+-------+
    | Pulse                | 4     |
    +----------------------+-------+
    | Staircase            | 5     |
    +----------------------+-------+
    | StaircaseTriangle    | 6     |
    +----------------------+-------+
    | StaircaseCutTriangle | 7     |
    +----------------------+-------+
    | FastAutoFocus        | 8     |
    +----------------------+-------+

    Note: FastAutoFocus is a sawtooth shaped wave prepared especially for camera triggering. It is connected with adjustable output trigger signal.

## Constructor & Destructor Documentation

## ◆ __init__()

optoKummenberg.registers.InputStage.SignalGenerator.__init__ | ( |  | self,
|  | int | channel = 0,
|  |  | board = None,
|  |  | sys_id_base = 0x60 )

## Member Function Documentation

## ◆ GetAmplitude()

optoKummenberg.registers.InputStage.SignalGenerator.GetAmplitude | ( |  | self | ) |

Gets the amplitude of the generated signal.

Unit is specified by SetUnit method.

## ◆ GetCycles()

optoKummenberg.registers.InputStage.SignalGenerator.GetCycles | ( |  | self | ) |

Gets the number of cycles the generated signal.

Value -1 represents running the signal generator in the loop.

## ◆ GetDutyCycle()

optoKummenberg.registers.InputStage.SignalGenerator.GetDutyCycle | ( |  | self | ) |

Gets duty cycle of the generated signal.

Default is 0.5 (range 0-1)

## ◆ GetExtTriggerGPIO()

optoKummenberg.registers.InputStage.SignalGenerator.GetExtTriggerGPIO | ( |  | self | ) |

Gets the state of GPIOx pin to trigger input source (GPIOx default is trigger output) and disables global external trigger SYNCx pin.

0 = off, 1 = on

## ◆ GetFrequency()

optoKummenberg.registers.InputStage.SignalGenerator.GetFrequency | ( |  | self | ) |

Gets the frequency of the generated signal.

[Hz]

## ◆ GetOffset()

optoKummenberg.registers.InputStage.SignalGenerator.GetOffset | ( |  | self | ) |

Gets the offset of the generated signal.

Unit is specified by SetUnit method.

## ◆ GetOutput()

optoKummenberg.registers.InputStage.SignalGenerator.GetOutput | ( |  | self | ) |

Gets output of the signal generator.

## ◆ GetOutTriggerDutyCycle()

optoKummenberg.registers.InputStage.SignalGenerator.GetOutTriggerDutyCycle | ( |  | self | ) |

Gets duty cycle of the trigger pulse with respect to period of generated signal.

## ◆ GetOutTriggerTimeShift()

optoKummenberg.registers.InputStage.SignalGenerator.GetOutTriggerTimeShift | ( |  | self | ) |

Gets output trigger timing shift value (in ms)

## ◆ GetPhase()

optoKummenberg.registers.InputStage.SignalGenerator.GetPhase | ( |  | self | ) |

Gets the phase delay of the generated signal.

[rad]

## ◆ GetRunningStatus()

optoKummenberg.registers.InputStage.SignalGenerator.GetRunningStatus | ( |  | self | ) |

Gets the running status of the signal generator.

1 = running, 0 = stopped

## ◆ GetSettlingDelay()

optoKummenberg.registers.InputStage.SignalGenerator.GetSettlingDelay | ( |  | self | ) |

Gets settling delay value.

## ◆ GetShape()

WaveformShape optoKummenberg.registers.InputStage.SignalGenerator.GetShape | ( |  | self | ) |

Gets the shape of the generated signal.

## ◆ GetStairCount()

optoKummenberg.registers.InputStage.SignalGenerator.GetStairCount | ( |  | self | ) |

Gets stair count of the generatred signal, only available when shape is set to stair.

## ◆ GetUnit()

UnitType optoKummenberg.registers.InputStage.SignalGenerator.GetUnit | ( |  | self | ) |

Gets the unit type of the values set to the signal generator.

## ◆ help()

optoKummenberg.registers.InputStage.SignalGenerator.help | ( |  | ) |
| static

## ◆ Run()

optoKummenberg.registers.InputStage.SignalGenerator.Run | ( |  | self | ) |

Starts the signal generator.

## ◆ SetAmplitude()

optoKummenberg.registers.InputStage.SignalGenerator.SetAmplitude | ( |  | self,
|  |  | value )

Sets the amplitude of the generated signal.

Unit is specified by SetUnit method.

## ◆ SetCycles()

optoKummenberg.registers.InputStage.SignalGenerator.SetCycles | ( |  | self,
|  |  | value )

Sets the number of cycles the generated signal.

Setting -1 runs the signal generator in the loop until stopped.

## ◆ SetDutyCycle()

optoKummenberg.registers.InputStage.SignalGenerator.SetDutyCycle | ( |  | self,
|  |  | value )

Sets duty cycle of the generated signal.

Default is 0.5 (range 0-1)

## ◆ SetExternalTrigger()

optoKummenberg.registers.InputStage.SignalGenerator.SetExternalTrigger | ( |  | self,
|  |  | value )

Sets the external trigger mode.

Signal generator can be synchronised with external signal (0=disabled, 1=rising/falling edge, 2=rising edge trigger)

## ◆ SetExtTriggerGPIO()

optoKummenberg.registers.InputStage.SignalGenerator.SetExtTriggerGPIO | ( |  | self,
|  |  | value )

Turns GPIOx pin to trigger input source (GPIOx default is trigger output) and disables global external trigger SYNCx pin.

0 = off, 1 = on

## ◆ SetFrequency()

optoKummenberg.registers.InputStage.SignalGenerator.SetFrequency | ( |  | self,
|  |  | value )

Sets the frequency of the generated signal.

[Hz]

## ◆ SetOffset()

optoKummenberg.registers.InputStage.SignalGenerator.SetOffset | ( |  | self,
|  |  | value )

Sets the offset of the generated signal.

Unit is specified by SetUnit method.

## ◆ SetOutTriggerDutyCycle()

optoKummenberg.registers.InputStage.SignalGenerator.SetOutTriggerDutyCycle | ( |  | self,
|  |  | value )

Sets duty cycle of the trigger pulse with respect to period of generated signal (for real duration it has to be multiplied with period; for staircase shape with period/stair count)

## ◆ SetOutTriggerTimeShift()

optoKummenberg.registers.InputStage.SignalGenerator.SetOutTriggerTimeShift | ( |  | self,
|  |  | value )

Allows fine adjustment of output trigger timing versus generated output signal (value in ms) (limit of shift value = period)

## ◆ SetPhase()

optoKummenberg.registers.InputStage.SignalGenerator.SetPhase | ( |  | self,
|  |  | value )

Sets the phase delay of the generated signal.

[rad]

## ◆ SetSettlingDelay()

optoKummenberg.registers.InputStage.SignalGenerator.SetSettlingDelay | ( |  | self,
|  |  | value )

Sets settling delay (in ms) which for FastAutoFocus shape allows to add extra time with constant value before and after the ramp to minimise ringing effect (max.

value is limited to 25% of period)

## ◆ SetShape()

optoKummenberg.registers.InputStage.SignalGenerator.SetShape | ( |  | self,
|  | WaveformShape or int | value )

Sets the shape of the generated signal.

## ◆ SetStairCount()

optoKummenberg.registers.InputStage.SignalGenerator.SetStairCount | ( |  | self,
|  |  | value )

Sets stair count of the generatred signal, only available when shape is set to stair.

## ◆ SetUnit()

optoKummenberg.registers.InputStage.SignalGenerator.SetUnit | ( |  | self,
|  | UnitType or int | value )

Sets the unit type of the values set to the signal generator.

## ◆ Stop()

optoKummenberg.registers.InputStage.SignalGenerator.Stop | ( |  | self | ) |

Stops the signal generator.

## Member Data Documentation

## ◆ amplitude

dict optoKummenberg.registers.InputStage.SignalGenerator.amplitude

Initial value:
= {'id': self.sys_id << 8 | 0x04,
'type': float,
'unit': None,
'range': None,
'default': 0.0,
'value': 0.0}

## ◆ cycles

dict optoKummenberg.registers.InputStage.SignalGenerator.cycles

Initial value:
= {'id': self.sys_id << 8 | 0x07,
'type': int,
'unit': None,
'range': None,
'default': -1,
'value': -1}

## ◆ duty_cycle

dict optoKummenberg.registers.InputStage.SignalGenerator.duty_cycle

Initial value:
= {'id': self.sys_id << 8 | 0x08,
'type': float,
'unit': None,
'range': [0, 1.0],
'default': 0.5,
'value': 0.5}

## ◆ ext_trigger_gpio

dict optoKummenberg.registers.InputStage.SignalGenerator.ext_trigger_gpio

Initial value:
= {'id': self.sys_id << 8 | 0x0c,
'type': bool,
'unit': None,
'range': None,
'default': 0, #false
'value': None}

## ◆ external_trigger

dict optoKummenberg.registers.InputStage.SignalGenerator.external_trigger

Initial value:
= {'id': self.sys_id << 8 | 0x09,
'type': int,
'unit': None,
'range': None,
'default': False,
'value': False}

## ◆ frequency

dict optoKummenberg.registers.InputStage.SignalGenerator.frequency

Initial value:
= {'id': self.sys_id << 8 | 0x03,
'type': float,
'unit': 'Hz',
'range': None,
'default': 0.0,
'value': 0.0}

## ◆ inst_phase

dict optoKummenberg.registers.InputStage.SignalGenerator.inst_phase

Initial value:
= {'id': self.sys_id << 8 | 0x10,
'type': float,
'unit': None,
'range': [0, 1.0],
'default': None,
'value': None}

## ◆ offset

dict optoKummenberg.registers.InputStage.SignalGenerator.offset

Initial value:
= {'id': self.sys_id << 8 | 0x05,
'type': float,
'unit': None,
'range': None,
'default': 0.0,
'value': 0.0}

## ◆ out_trigger_duty

dict optoKummenberg.registers.InputStage.SignalGenerator.out_trigger_duty

Initial value:
= {'id': self.sys_id << 8 | 0x0e,
'type': float,
'unit': None,
'range': [0, 1.0],
'default': 0.5,
'value': 0.5}

## ◆ out_trigger_shift

dict optoKummenberg.registers.InputStage.SignalGenerator.out_trigger_shift

Initial value:
= {'id': self.sys_id << 8 | 0x0d,
'type': float,
'unit': None,
'range': None,
'default': 0.0,
'value': 0.0}

## ◆ output

dict optoKummenberg.registers.InputStage.SignalGenerator.output

Initial value:
= {'id': self.sys_id << 8 | 0x0a,
'type': float,
'unit': None,
'range': None,
'default': None,
'value': None}

## ◆ phase

dict optoKummenberg.registers.InputStage.SignalGenerator.phase

Initial value:
= {'id': self.sys_id << 8 | 0x06,
'type': float,
'unit': 'Rad',
'range': None,
'default': 0.0,
'value': 0.0}

## ◆ run

dict optoKummenberg.registers.InputStage.SignalGenerator.run

Initial value:
= {'id': self.sys_id << 8 | 0x01,
'type': int,
'unit': bool,
'range': [0, 1],
'default': 0,
'value': 0}

## ◆ settling_delay

dict optoKummenberg.registers.InputStage.SignalGenerator.settling_delay

Initial value:
= {'id': self.sys_id << 8 | 0x0f,
'type': float,
'unit': None,
'range': None,
'default': 0.0,
'value': 0.0}

## ◆ shape

dict optoKummenberg.registers.InputStage.SignalGenerator.shape

Initial value:
= {'id': self.sys_id << 8 | 0x02,
'type': int,
'unit': None,
'range': {0: 'Sinusoidal', 1: 'Triangular', 2: 'Rectangular', 3: 'Sawtooth', 4: 'Pulse',
5: 'Staircase', 6: 'StaircaseTriangle', 7: 'StaircaseCutTriangle', 8: 'FastAutoFocus'},
'default': 0,
'value': 0}

## ◆ stair_count

dict optoKummenberg.registers.InputStage.SignalGenerator.stair_count

Initial value:
= {'id': self.sys_id << 8 | 0x0b,
'type': int,
'unit': None,
'range': [-100, 100],
'default': 5,
'value': None}

## ◆ sys_id

optoKummenberg.registers.InputStage.SignalGenerator.sys_id = sys_id_base | channel

## ◆ unit

dict optoKummenberg.registers.InputStage.SignalGenerator.unit

Initial value:
= {'id': self.sys_id << 8 | 0x00,
'type': int,
'unit': None,
'range': {0: 'Current', 1: 'OF', 2: 'XY', 3: 'FP', 4: 'NoUnit'},
'default': 0,
'value': 0}

The documentation for this class was generated from the following file:

- C:/git/142-421-00_optoKummenberg/src/main/python/optoKummenberg/registers/InputStage.py