Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature request: Function to call if sweep dies #71

Open
Deadmansshoe opened this issue Apr 19, 2022 · 1 comment
Open

Feature request: Function to call if sweep dies #71

Deadmansshoe opened this issue Apr 19, 2022 · 1 comment

Comments

@Deadmansshoe
Copy link

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

@akhuettel
Copy link
Member

Uh, only just saw this. Possible, but most likely not very reliable for nontrivial things... let's talk.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants