Discussion Overview
The discussion revolves around the implementation of a force stop condition in a MATLAB loop controlling a Keithley current source. Participants explore methods to ensure that the current source is turned off when the loop is forcibly stopped, particularly using keyboard interrupts like Ctrl+C.
Discussion Character
- Technical explanation
- Debate/contested
Main Points Raised
- One participant inquires about adding an if condition to turn off the current source when the loop is forcefully stopped.
- Another participant suggests setting a variable to true if the loop completes normally, which could indicate that the loop was not stopped early.
- A third participant clarifies that they are specifically looking for a way to detect a force stop (Ctrl+C) and turn off the device in that case.
- A later reply mentions the MATLAB function onCleanup as a potential solution, directing to the official documentation.
Areas of Agreement / Disagreement
Participants do not appear to reach a consensus on the best method to implement the desired functionality, and multiple approaches are suggested without resolution.
Contextual Notes
The discussion does not clarify whether the proposed solutions are feasible or effective in the specific context of the user's application.
Who May Find This Useful
This discussion may be useful for MATLAB users working with hardware control who are interested in implementing robust error handling and stopping conditions in their code.