User Tools

Site Tools


en:documentation:ccdscript

CCDciel Script

The scripts can be executed from the script tool or part of a sequence.

There is also standard script that are executed on defined occasion:

  • startup is executed when the program in launched, even before any device is connected. This is the place you can automatically connect the devices, the autoguider and the planetarium.
  • shutdown is executed when the program is closed.

The script language is very powerful and allow for complex tasks.
But this can also be as simple as sending a list of command to different devices.

There is limitations if you use an ARM processor for example with a Raspberry PI device. In this case some function are not working, specifically the command that require a TStringList.

Script editor

The editor allow to write a script .

The language to use is Pascal Script, based on Object Pascal.
Define first the global variables, then the procedure and function if any, then the private variable, and finally the main code start with begin and end with end.
Read the script example page for a quick start.

The functions specific to the interface with CCDciel are described in a separate script reference page.

Use the Save button to record your change and return to the main window.

The top button are related to the debugging function as describe below.

Script debugger

Simple debugging function are available to test your code.

To run the script in debug mode press the green arrow Run button. The program is first compiled.

In case of compilation error, the corresponding row is highlighted in yellow, and the error message is show in the bottom message area.

If the compilation finish without error the program start to run and stop on the first code line of the main procedure. The current execution position is highlighted in blue.

You can now use the Step over button to execute your program line by line.
The Step into button do the same, except if the current line is a call to one of your function. In this case Step into allow to run the function line by line, but Step over execute the function and stop at the main program next line.

You can also set a breakpoint on a specific line to jump directly at this position.

To set a breakpoint click on the leftmost column to show a red icon.
Use the Run button to jump to the next breakpoint. The current line is then highlighted in red.

You can remove a breakpoint by clicking on the red icon or all at at time with the Remove all breakpoint button.

You can display the value of variables when the program is in pause at a breakpoint or after a Step over click.
Just click on the variable name anywhere in the program source to display the value in the message area.
Note this work only for local variables, not for object properties.

You can use the Pause button to pause the program execution. This can be useful to examine the condition of an infinite loop for example.

The Stop button terminate the program execution immediately.

en/documentation/ccdscript.txt · Last modified: 2018/06/26 12:03 by pch