Applicable to SunDAT Pro
Speed up the process of doing repetitive tasks with Scripting especially when you have to run the same scenarios for multiple projects. Scripting allows you to run table creation and PV layout with a few clicks. You can also create your own script similar to recording a macro in Excel.
TABLE OF CONTENTS
|1.||File path of the script file||4.||Run Script - Press to run the script|
|2.||Open script button - open script in the console||5.||Export script button - export your script|
|3.||Doc - Opens SunDAT Scripting Guide||6.||Console|
Step by Step Guide
Run a script
- Go to the Scripting tab to open the Scripting interface
- In the Scripting interface, click Open script button
- Select the JSON file you want to run. SunDAT will tell you if it is a valid or invalid script. In the console says Valid JSON file and commands, then you are able to run the script.
- Press the Run Script button and the script will start running in the console.
- The process will be complete when the console says Script file run successfully
Export your own script
- Start with a blank project and open SunDAT which will automatically start the process of record your steps to create a script
- Run through the process of creating a project in site configuration, table creation, block creation (optional), and then PV Layout.
- After running through the steps of creating a layout, go to the Scripting tab.
- Press the Export Script to save the JSON file.
Tip: Another way to create your own script is to use one of the examples attached with this article
What features can I script for
Site configuration, table creation, block creation and PV Layout
What file format does the script have to be?
Do you have example scripts?
See the attached files with this article
How do I edit a script?
JSON format files can be opened in text editor programs like Notepad, Word Pad, or Sublime text. From there you will be to edit and save the JSON file which can be imported into SunDAT.
Is there a guide to explain the lines of code in a script?
You can refer to the SunDAT Scripting Guide in SunDAT, which provide descriptions and the attributes
Do I have to do anything to start recording my scripts?
SunDAT autamatically starts recording your actions the moment SunDAT is started and until SunDAT is closed.
|Exception: No such file or directory @ rb_sysopen - ||Script has not been loaded into the console||Press the Open Script to select your script. If it is a valid script, then you can press Run script to begin the run.|
|Script file (JSON) was moved||Place the JSON file back into the original location or Press Open Script button to select the script in the new location.|
|Invalid JSON||The script file (JSON) has errors in its code.||Correct the error in the script file (JSON). Refer to the SunDAT Scripting Guide to h|
|Exception : unable to find module name or Exception : unable to find inverter name ||Equipment is not in the Global library or in the User library||If using a custom equipment, make sure that the name of the equipment in the script matches exactly with the one in the User library|