Skip to content

Multiscale-imaging/rpi_signal_control

Repository files navigation

rpi_signal_control

to view the log

use get_log.ipynb to read the log from the experiment

to use

signal control of instruments we bring to beamtime. The signal generator (HMF2525) and oscilloscope (DSOX2014A) are connected via USB to a Raspberry pi. The RPI is placed in the huch and conneted to the network.

The signal generator is set up to listen on port 5006 with the following commands available:

HMF2525_keys = [
    'FUNC',
    'OUTPut',
    'FREQuency',
    'PERiod',
    'VOLTage',
    'VOLTage:UNIT',
    'VOLTage:HIGH',
    'VOLTage:LOW',
    'VOLTage:OFFSet',
    'FUNCtion:PULSe:WIDTh:HIGH',
    'FUNCtion:PULSe:WIDTh:LOW',
    'FUNCtion:PULSe:DCYCle',
    'FUNCtion:PULSe:ETIMe',
    'TRIGger:SOURce',# {IMMediate | EXTernal}
    'BURSt:MODE',# TRIGgered | GATed
    'BURSt:NCYCles',
    'BURSt:INTernal:PERiod',
    'BURSt:PHASe', #0 to 360
    'BURSt:STATe',
    ]

The oscilloscope listens on port 5007, and can be querried using:

'AvgC1C2?'

which returns the average voltage in the frame on channel 0 and 1 as strings, i.e.:

'AvgC1C2 = 0.9660903434343435, -0.15168975454545452'

'C1C2?'

which returns the 100 voltages in the frame on channel 0 and 1 as strings, i.e.:

'C1C2 = #800001399 1.16263e+000, 1.12243e+000, 1.04203e+000, 1.00182e+000, 9.21422e-001, 8.81221e-001, 8.00819e-001, 7.20417e-001, 6.80216e-001, 6.40015e-001, 5.59613e-001, 5.19412e-001, 4.39010e-001, 3.98809e-001, 3.58608e-001, 3.18407e-001, 2.78206e-001, 2.38005e-001, 1.57603e-001, 1.17402e-001, 1.17402e-001, 7.72010e-002, 7.72010e-002, 3.70000e-002,-3.20100e-003,-3.20100e-003,-3.20100e-003,-3.20100e-003,-4.34020e-002,-4.34020e-002,-3.20100e-003,-4.34020e-002,-3.20100e-003, 3.70000e-002, 3.70000e-002, 3.70000e-002, 7.72010e-002, 1.17402e-001, 1.97804e-001, 1.97804e-001, 2.38005e-001, 2.78206e-001, 3.18407e-001, 3.98809e-001, 4.39010e-001, 5.19412e-001, 5.19412e-001, 5.99814e-001, 6.40015e-001, 7.20417e-001, 7.60618e-001, 8.41020e-001, 8.81221e-001, 9.61623e-001, 1.04203e+000, 1.08223e+000, 1.16263e+000, 1.20283e+000, 1.28323e+000, 1.36363e+000, 1.40383e+000, 1.48424e+000, 1.52444e+000, 1.56464e+000, 1.60484e+000, 1.64504e+000, 1.68524e+000, 1.72544e+000, 1.76564e+000, 1.80584e+000, 1.84605e+000, 1.88625e+000, 1.92645e+000, 1.92645e+000, 1.92645e+000, 1.92645e+000, 1.96665e+000, 1.96665e+000, 1.96665e+000, 1.96665e+000, 1.96665e+000, 1.96665e+000, 1.92645e+000, 1.92645e+000, 1.88625e+000, 1.88625e+000, 1.88625e+000, 1.80584e+000, 1.76564e+000, 1.76564e+000, 1.72544e+000, 1.68524e+000, 1.60484e+000, 1.56464e+000, 1.52444e+000, 1.44404e+000, 1.40383e+000, 1.36363e+000, 1.28323e+000, 1.24303e+000_#800001399-3.79899e-002,-3.79899e-002,-2.38995e-001,-3.79899e-002,-2.38995e-001,-2.38995e-001,-3.79899e-002,-2.38995e-001,-3.79899e-002,-2.38995e-001,-2.38995e-001,-2.38995e-001,-3.79899e-002,-3.79899e-002,-3.79899e-002,-2.38995e-001,-2.38995e-001,-3.79899e-002,-2.38995e-001,-2.38995e-001,-2.38995e-001,-3.79899e-002,-2.38995e-001,-3.79899e-002,-3.79899e-002,-3.79899e-002,-2.38995e-001,-3.79899e-002,-2.38995e-001,-2.38995e-001,-3.79899e-002,-3.79899e-002,-2.38995e-001,-3.79899e-002,-2.38995e-001,-2.38995e-001,-2.38995e-001,-2.38995e-001,-3.79899e-002,-2.38995e-001,-2.38995e-001,-2.38995e-001,-2.38995e-001,-3.79899e-002,-2.38995e-001,-2.38995e-001,-3.79899e-002,-3.79899e-002,-3.79899e-002,-3.79899e-002,-2.38995e-001,-2.38995e-001,-3.79899e-002,-3.79899e-002,-2.38995e-001,-3.79899e-002,-3.79899e-002,-3.79899e-002,-2.38995e-001,-2.38995e-001,-3.79899e-002,-3.79899e-002,-3.79899e-002,-2.38995e-001,-2.38995e-001,-3.79899e-002,-2.38995e-001,-2.38995e-001,-3.79899e-002,-2.38995e-001,-3.79899e-002,-2.38995e-001,-2.38995e-001,-3.79899e-002,-3.79899e-002,-3.79899e-002,-2.38995e-001,-3.79899e-002,-2.38995e-001,-3.79899e-002,-2.38995e-001,-2.38995e-001,-2.38995e-001,-2.38995e-001,-3.79899e-002,-2.38995e-001,-2.38995e-001,-3.79899e-002,-3.79899e-002,-2.38995e-001,-2.38995e-001,-2.38995e-001,-2.38995e-001,-2.38995e-001,-2.38995e-001,-2.38995e-001,-2.38995e-001,-3.79899e-002,-3.79899e-002,-3.79899e-002'

and additionally has the following available keys:

osc_keys = [
    'CHANnel1:DISPlay',
    'CHANnel2:DISPlay',
    'CHANnel3:DISPlay',
    'CHANnel4:DISPlay',
    'DIGitize',
    'WAVeform:SOURce', # CHANnel1
    'WAVeform:FORMat',# BYTE, ASCii
    'WAVeform:POINts', # 500
    'WAVeform:DATA', #?
    'RUN', #?
    'STOP', #?
    ] 

About

signal control of instruments we bring to beamtime

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages