Quickstart for Scripting
This article will help you get started with the Scripting function in the Rayfin Control Software (RCS). Navigating to the scripting panel in RCS, creating a new script, and loading and executing a script will be covered.
Navigating to the Scripting Panel
Once connected to a Rayfin camera in RCS, follow the steps below to navigate to the scripting panel:
Click the gear icon in the top-right corner of the screen to navigate to the Settings.
This will open the Settings sidebar. From here, navigate to the Scripting Panel by clicking on the scroll icon.
Creating a New Script
All Rayfin cameras come with some scripts pre-loaded onto the device, however, there might be a scenario where you want to create your own script. To create a new script, follow the steps below:
Click the green plus button.
This will open a text box where the new script can be named. The script can be given any name, however, for this example we will be giving it the name “BenchTest”. Once the name is entered, click the green checkmark to the left of the text box to continue.
The script will now appear in the list of scripts. Click on the script to edit it.
The script editor should appear below the list of scripts. It will be empty.
You can now create your script. A list of scripting commands and some examples can be found in Rayfin Scripting API
Once your script is finished, click “Save Script” to save the script. The script below is an example.
Loading & Executing a Script
To load and execute a script that is saved to the Rayfin, follow the steps below.
Click on the script that you wish to execute. The script will appear. Click “Execute Script” to run the script.
If you would like the script to execute as soon as your camera starts up, click the “Execute On Start” box.
While the script is running, you will see the software run through the script line-by-line.
There will also be a green scroll icon in the top-right corner of RCS to indicate that there is a script running.
To stop a script while it is running, navigate to the Scripting Panel and click “Stop Script”. This will clear any conditional “Repeat” and “When” expressions that are running
Disclaimer: With scripting, the API is open to use. It is not possible for SubC to test every possible scenario. Please test your specific script before deployment.
If you have a complex scenario and need some help, feel free to email support@subcimaging.com