5.14. SCRipt

The SCRipt subsystem allows you to start and stop MicroPython scripts. It is also possible to define scripts that will be executed during startup.

 

SCPI command

Description

SCRipt

 

:RECall {<filename>}

Sets the script to run on the startup

:CLEar

Clear currently selected startup script

:CONFirmation {<bool>}

Enables/disables startup script confirmation

:RUN {<filename>}

Sets a script to be executed immediately

:STOP

Forcibly stops the currently active script

 

5.14.1. SCRipt:RECall

Syntax

SCRipt:RECall {<filename>}

SCRipt:RECall?

Description

Use this command to select the MicroPython script to run on the startup. The full path to the file must be specified. This filename must exist on the SD card otherwise an error will be generated. Use the MMEMory:CATalog? command to check which scripts exist in the specified folder.

Parameters

Name

Type

Range

Default

<filename>

Quoted string

Return

The query command returns the full path of the script that will be run at startup.

Usage example

SCR:REC "/Scripts/AutoStart.py"

Errors

-256,"File name not found"

Related Commands

MMEMory:CATalog

SCRipt:RECall:CONFirmation

SCRipt:RUN

SCRipt:STOP

5.14.2. SCRipt:RECall:CLEar

Syntax

SCRipt:RECall:CLEar

Description

Use this command to clear currently defined startup script.

Usage example

SCR:REC:CLE

Related Commands

SCRipt:RECall

SCRipt:RECall:CONFirmation

5.14.3. SCRipt:RECall:CONFirmation

Syntax

SCRipt:RECall:CONFirmation {<bool>}

SCRipt:RECall:CONFirmation?

Description

Use this command to specify whether a dialog box will appear on the screen during startup with information about the name of the script whose execution will need to be confirmed.

Parameters

Name

Type

Range

Default

<bool>

Boolean

ON|OFF|0|1

Return

The query command returns 0 if the script confirmation mode is OFF, and 1 if the confirmation mode is ON.

Usage example

SCR:REC:CONF 1

Related Commands

SCRipt:RECall

5.14.4. SCRipt:RUN

Syntax

SCRipt:RUN {<filename>}

Description

Use this command to run the MicroPython script specified with the full path name to the file. This filename must exist on the SD card otherwise an error will be generated.

Use the MMEMory:CATalog? command to check which scripts exist in the specified folder.

Parameters

Name

Type

Range

Default

<bool>

Boolean

Return

The query command returns the present setting of the integration time.

Usage example

SCR:RUN "/Scripts/Hello world.py"

Errors

310,"File not found"

770,"Script engine is already running"

Related Commands

MMEMory:CATalog

SCRipt:RECall

5.14.5. SCRipt:STOP

Syntax

SCRipt:STOP

Description

Use this command to forcibly stop currently active script. Useful in case when script got stuck without need to restart the BB3.

Usage example

SCR:STOP

Related Commands

SCRipt:RECall

SCRipt:RUN

 

 

 

 

 

Join Waitlist We will notify you when the product is available. Please leave your valid email address below.