Skip to content

Feature request: Function to call if sweep dies #71

@Deadmansshoe

Description

@Deadmansshoe

Hi everyone,

I had an idea for a new feature, which could enhance Lab-Measurement. Instead of leaving everything as it was before the code crashes (if e.g. a limit is reached or an instrument is no longer reachable), code could be executed. This could give the opportunity to set crucial inputs back to safe values or send a notification to the user.

I thought this could be a function given to the sweep start function call, similar to the function reference given to sweep initialization.

...
my $crashfunction = sub {
    $yokogawa->set_voltage(value => '0.0');
};
 
...

$sweep->start(
    measurement => $meas,
    datafile    => $datafile,
    coderef_crash => $crashfunction,
);

What are your ideas to something like that? Do you think this could be possible?

Greetings
Robin

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions