Script Lifecycle
Upload
Scripts are compiled and uploaded from the HMCLS app. Use the Compile and Upload buttons in the Studio. The app handles stopping any currently running script, transferring the new program, and starting it.
Execution
Once started, the script runs its Setup section once, then enters the Loop continuously at approximately 1 kHz (1 ms per iteration), independent of the acquisition sample rate.
Stopping
A script can be stopped from the app at any time using the Stop button. The script also stops automatically if it encounters a runtime error.
When a script stops for any reason, all 64 event flags are cleared automatically.
Runtime Errors
| Condition | Cause |
|---|---|
| Division by zero | A divide or modulo operation with a zero divisor |
| Budget exceeded | The loop iteration used more than 512 operations |
When a runtime error occurs, the script halts and an error message appears in the Serial Terminal panel.