Manual Script Communicator

User Manual: Pdf

Open the PDF directly: View PDF PDF.
Page Count: 173

DownloadManual Script Communicator
Open PDF In BrowserView PDF
ScriptCommunicator
Manual

Table of contents
ScriptCommunicator History..................................................................................................................8
GUI documentation..............................................................................................................................17
Main window.......................................................................................................................................17
Settings dialog.....................................................................................................................................18
Send dialog..........................................................................................................................................19
Single sequence table...................................................................................................................19
Cyclic sequence area.....................................................................................................................19
Scripts dialog.......................................................................................................................................20
Create sce file dialog............................................................................................................................22
Add message dialog.............................................................................................................................24
Sending and receiving a file.................................................................................................................24
Configuration files................................................................................................................................24
Main configuration file........................................................................................................................25
Sequence configuration file.................................................................................................................25
Script configuration file.......................................................................................................................25
SCE configuration file...........................................................................................................................25
Command-line arguments....................................................................................................................25
Command-line mode...........................................................................................................................26
SCE files........................................................................................................................................26
SCEZ files.......................................................................................................................................27
Self extracting zip (exe) files (only on windows)...................................................................................27
Internal architecture.............................................................................................................................28
Script interface.....................................................................................................................................28
Script debugging..................................................................................................................................28
Worker scripts......................................................................................................................................29
void stopScript(void)............................................................................................................................29
The scriptThread object/class..............................................................................................................30
Main interface..............................................................................................................................30
Separate interfaces.......................................................................................................................30
Standard dialogs...........................................................................................................................30
Filesystem.....................................................................................................................................36
SQL support..................................................................................................................................41
XML support.................................................................................................................................42
CRC functions................................................................................................................................47

Inter-WorkerScript communication..............................................................................................50
Process..........................................................................................................................................53
Miscellaneous...............................................................................................................................56
The scriptInf object/class.....................................................................................................................64
Main interface..............................................................................................................................65
Separate interfaces.......................................................................................................................78
Script UDP socket class........................................................................................................................79
Script TCP client class..........................................................................................................................81
Script TCP server class.........................................................................................................................86
Script serial port class..........................................................................................................................87
Script PCAN class.................................................................................................................................92
Script Aardvark I2C/SPI class...............................................................................................................94
Script timer class................................................................................................................................100
Script plot window class....................................................................................................................101
User interface classes........................................................................................................................106
Script dialog................................................................................................................................107
Script main window....................................................................................................................107
Script tab widget.........................................................................................................................108
Script tool box.............................................................................................................................109
Script group box..........................................................................................................................110
Script label..................................................................................................................................110
Script action (menu entry)..........................................................................................................111
Script button...............................................................................................................................111
Script tool button........................................................................................................................113
Script check box..........................................................................................................................114
Script radio button......................................................................................................................114
Script combo box and font combo box.......................................................................................115
Script line edit.............................................................................................................................117
Script table widget......................................................................................................................118
Script list widget.........................................................................................................................125
Script tree widget.......................................................................................................................127
Script tree widget item...............................................................................................................129
Script text edit............................................................................................................................131
Script progress bar......................................................................................................................133
Script slider.................................................................................................................................134

Script spin box............................................................................................................................135
Script double spin box................................................................................................................136
Script time edit...........................................................................................................................137
Script date edit...........................................................................................................................138
Script date time edit...................................................................................................................140
Script calendar widget................................................................................................................141
Script splitter..............................................................................................................................142
Script dial....................................................................................................................................143
Script plot widget........................................................................................................................144
Script Canvas2D..........................................................................................................................149
ScriptWidget class.......................................................................................................................155
Custom script widget..................................................................................................................160
Dynamic link libraries........................................................................................................................161
Sequence script..................................................................................................................................162
Script converter object/class..............................................................................................................170
Example scripts...................................................................................................................................173

ScriptCommunicator (https://sourceforge.net/projects/scriptcommunicator/,
https://github.com/szieke/ScriptCommunicator_serial-terminal) is a scriptable cross-platform data
terminal which supports following interfaces:







Serial port (RS232, USB to serial)
UDP
TCP client/server (network proxy support for TCP clients)
SPI (Aardvark I2C/SPI)
I2C (Aardvark I2C/SPI)
CAN (PCAN-USB, only on windows)

All sent and received data can be shown in a console and can be logged in an html and a text log.
In addition to the simple sending and receiving of data the ScriptCommunicator has a script interface
(QtScript). QtScript is based on the ECMAScript scripting language, as defined in standard ECMA-262.
Microsoft's JScript, and Netscape's JavaScript are also based on the ECMAScript standard. For an
overview of ECMAScript, see the ECMAScript reference.

This script interface has following features:


Scripts can send and receive data with the main interface.



In addition to the main interface scripts can create and use own interfaces (serial port
(RS232, USB to serial), UDP, TCP client/server, SPI (Aardvark I2C/SPI) and I2C (Aardvark
I2C/SPI)).



Scripts can be connected to GUI files which have been created with the QtDesigner or
QtCreator. All elements in the GUI (files) can be accessed from the script.



Multiple plot windows and plot widgets can be created by scripts (QCustomPlot from
Emanuel Eichhammer is used).



Dynamic link libraries with a special interface (see chapter Dynamic link libraries) can be
loaded by script. Script function can be called by the library and vice versa.

A video which demonstrates the basic features of ScriptCommunicator can be found here:
https://www.youtube.com/playlist?list=PLniMuy2Q_xGuFB_kl1nte2mDxfeeOu8ce

ScriptCommunicator History
Revision

Date

02.00

2014-12-31

Changes
•
•
•

•

•

•
•

PCAN interface added (only on windows)
command-line mode added
worker script, changed behavior:
◦ loadUserInterfaceFile
◦ renameDirectory
◦ renameFile
worker script functions added:
◦ isConnectedWithCan, canMessageReceivedSignal,
createPcanInterface, sendCanMessage
◦ showMultiLineTextInputDialog, showGetItemDialog,showGetIntDialog,
showGetDoubleDialog
◦ disconnect, connectPcan, connectSocket, connectSerialPort,
connectCheetahSpi
◦ showReceivedDataInConsoles, showTransmitDataInConsoles
◦ addMessageToLogAndConsoles
ScriptWidget functions added:
◦ setAdditionalData
◦ getAdditionalData
ScriptTableWidget function added:
◦ insertWidget
worker script, default parameter added:
◦ readFile, readBinaryFile, readDirectory, checkFileExists,
checkDirectoryExists, deleteFile, deleteDirectory,
deleteDirectoryRecursively, createDirectory, loadLibrary,loadScript,
sendDataArray, sendString

2.01

2015-01-05

•

bug fixes:
◦ received CAN ids have been displayed not correctly

2.02

2015-01-18

•

command-line mode: The script window is now invisible per default (it can
be made visible by the command line argument -withScriptWindow)
send window: remove script menu added
ScriptWidget function added:
◦ blockSignals
ScriptSplitter added

•
•
•
2.03

2015-01-30

•

•
•
2.04

2015-02-05

•
•
•
•

2.05

2015-02-07

•
•
•

2.06

2015-02-13

•
•
•

bug fixes:
◦ writeFile and writeBinaryFile: calling this functions with the argument
replaceFile=true did not replace an existing file
the number of sent bytes are now displayed in the main window
the console-colors are adjustable now
ScriptSpinBox functions added:
◦ value, setSingleStep, singleStep
ScriptTabWidget signal added:
◦ currentTabChangedSignal
ScriptTableWidget functions added:
◦ verticalScrollBarWidth, isVerticalScrollBarVisible
script widgets added:
◦ ScriptDoubleSpinBox, ScriptToolBox, ScriptDial, ScriptCalendarWidget,
ScriptDateTimeEdit
internal improvements
ScriptSlider function added:
◦ value
ScriptDial function added:
◦ value
internal improvements
text console's wrapping mode changed
new console/log options:

•
•
•
•
2.07

2015-02-28

•
•

2.08

2015-03-02

•
•
•

2.09

2015-03-05

•
•
•

◦ new line after x sent/received bytes
◦ new line after x milliseconds without sending or receiving data
the sequence table is now disabled during sending of data with the send
window
the RTS and the DTR pin (serial port) can manually be set/cleared now
(check boxes in the main window)
worker script function added:
◦ setSerialPortPins
ScriptSerialPort function added:
◦ setDTR, setRTS
Bug fix: no time stamps after running ScriptCommunicator longer then a
day
all local IPv6 and IPv4 addresses are displayed in the socket tab (settings
dialog) now
Console send mode: if the send input check box in the main window is
checked all text entered in a console will be sent
ScriptTableWidget function added:
◦ setCellIcon
Bug fix: error while changing the format of a sequence in the send window
sequence script functions added:
◦ calculateCrc8, calculateCrc16, calculateCrc32, calculateCrc64
new console/log option:
◦ new line at byte (CR, LF, none and custom)
when the serial port combo box is clicked (settings dialog) a serial port scan
is performed now

2.10

2015-03-13

•

Bug fixes:
◦ error while parsing a sequence or script config file with no entries
◦ moving a window while a script shows/opens a dialog caused a
complete freeze of ScriptCommunicator

2.11

2015-03-27

•
•

improved console speed
new line at byte (CR, LF, none and custom) can be adjusted for the log and
the console separately now

2.12

2015-04-10

•
•

socket address input filter removed (no IPv6 addresses could be entered)
bug fix: sporadically crash after receiving a 'new line' character

2.13

2015-05-01

•

bug fixes:
◦ scriptThread.calculateCrc64 did not work correctly
◦ uncaught exceptions in script functions connected to a signal have
been ignored
ScriptComboBox functions added:
◦ count, clear
ScriptTable function added:
◦ rowsCanBeMovedByUser

•
•
2.14

2015-05-31

•
•

fixed some issues in the manual
internal improvements

2.15

2015-06-12

•
•
•

•
•
•
•

Script- and sequence-buttons added in the main window
Copy button added in the send window
worker and sequence script functions added:
◦ setGlobalString, getGlobalString
◦ setGlobalDataArray, getGlobalDataArray
◦ setGlobalUnsignedNumber, getGlobalUnsignedNumber
◦ setGlobalSignedNumber, getGlobalSignedNumber
renamed the sequence script main object: table->seq
sent on enter added (settings dialog->console tab)
the console/log time-stamp format can be adjusted now
new default argument in scriptThread.appendTextToConsole

2.16

2015-06-14

•

bug fix: Crash while ScriptCommunicator is closed and a script is running

3.00

2015-06-19

•

custom console and custom log added

3.01

2015-06-24

•
•

new default argument in scriptThread.addMessageToLogAndConsoles
new menu in the send window: edit sequence script

•
•

new manual chapter added: Internal architecture
new custom console example
(exampleScripts\CustomLogConsoleScripts\CustomConsole_QRCode)
new main window menus added:
◦ Console/print console, Console/save console
◦ Help/report a bug, Help/feature request

•

3.02

2015-07-02

•

bug fix: missing Qt libraries for printing a console

3.03

2015-07-04

•
•

fixed some issues in the manual
added a custom build of QtDesigner (only the supported widgets/GUI
elements (supported by ScriptCommunicator) are available now)

3.04

2015-07-31

•
•
•

the log and the console tab (settings dialog) have been redesigned
internal improvements
fixed some issues in the manual

3.05

2015-08-02

•
•

the console mixed mode utilize the width of the console better now
bug fix: save console crashed on Linux if no file ending has been given

3.06

2015-08-08

•

main window:
◦ find text in console area added
◦ the send and the receive data rates are now displayed
sending data with the main interface is faster now
new example worker scripts:
◦ WorkerScripts\CyclicSendReceive\CyclicReceive.js
◦ WorkerScripts\CyclicSendReceive\CyclicSend.js
worker script function added: setScriptThreadPriority

•
•

•
3.07

2015-08-13

•
•

•
•
3.08

2015-09-12

•
•
•
•

3.09

2015-09-12

•
•
•

new script widget:
◦ ScriptPlotWidget
ScriptPlotWindow:
◦ functions added: clearGraphs, removeAllGraphs, showHelperElements,
clearButtonPressedSignal
◦ function removed: showFromScript (use show instead)
ScriptGroupBox function added: addPlotWidget
the CAN tab has been improved
bug fix: possible crash while stopping a script
TCP client: connection errors are now displayed
ScriptTcpClient functions/signals added:
◦ errorSignal, getErrorString
new main window menus added:
◦ Help/video, Help/get support
worker script functions added:
◦ getCurrentVersion
custom log/console and sequence script function added: getCurrentVersion
ScriptTcpClient, ScriptUdpClient and ScriptSerialPort functions added:
enableMainInterfaceRouting, disableMainInterfaceRouting

3.10

2015-09-26

•
•

network proxy support implemented (only for TCP clients)
ScriptTcpClient function added: setProxy

3.11

2015-10-04

•
•

bug fix: exceptions in the script function 'stopScript' are displayed now
worker script function added:
getFileSize
new arguments in worker script functions:
◦ readFile, readBinaryFile, writeFile, writeBinaryFile
ScriptPlotWidget and ScriptPlotWindow function added/changed:
◦ load button, showHelperElements

•
•
3.12

2015-10-15

•
•

console and log time stamp format extended (now date and time can be
created)
new option 'time stamp after byte' added

3.13

2015-10-18

•
•
•
•

command-line option '-notMinimized' added
worker script function added: exitScriptCommunicator
the template scripts have been modified
manual chapter 'Worker scripts' has been modified

3.14

2015-10-24

•

changed behavior of the console and log time stamp: if a time stamp byte
followed by no other byte has been received then the time stamp is created
not before the next byte has been received

3.15

2015-11-01

•
•

increased performance at high data rates
new default arguments in worker script function: showTextInputDialog,
showMultiLineTextInputDialog, showGetItemDialog, showGetIntDialog,
showGetDoubleDialog, showFileDialog,showDirectoryDialog, messageBox,
showYesNoDialog
sequence script function changed: messageBox
sequence script function added: showYesNoDialog, showTextInputDialog,
showMultiLineTextInputDialog, showGetItemDialog, showGetIntDialog,
showGetDoubleDialog

•
•

3.16

2015-11-06

•
•
•

SQL support for worker and custom log/console scripts implemented
worker script function removed: deleteObject
all created script objects (except ScriptTreeWidgetItem) are automatically
deleted by the garbage collector now

3.17

2015-11-08

•

bug fix: The script SQL classes did not handle byte arrays correctly.

3.18

2015-11-14

•

sequence and custom console/log scripts are running in their own thread
now
worker, sequence and custom console/log script function added:
setBlockTime
blocked worker scripts are terminated now (after the block-time (can be set
with setBlockTime) has elapsed)
custom console/log script functions changed: readFile, readBinaryFile
custom console/log script functions added: getFileSize, checkFileExists,
checkDirectoryExists, createDirectory, renameDirectory, renameFile,
deleteFile, deleteDirectory, deleteDirectoryRecursively, readDirectory,
writeFile, writeBinaryFile

•
•
•
•

3.19

2015-11-18

•
•
•

new send window menus: create script, add script
'edit custom console script' button added (console tab)
'edit custom log script' button added (log tab)

3.20

2015-11-21

•

bug fix: possible crash while starting a worker script with a syntax error

3.21

2015-12-02

•
•
•

new send area in the main window
new option in the settings dialog: target endianess
new decimal types for the decimal console and the log (uint8, uint16,
uint32, int8, int16 and int32)
new data formats in the send window (binary, uint8, uint16, uint32, int8,
int16 and int32)

•
3.22

2015-12-04

•
•

worker script function added: getScriptFolder
Mac OS X support

3.23

2015-12-13

•

bug fix: sometimes up to 3 extra bytes were written into the log if the 'write
decimal into log' option was disabled and then enabled again
worker and sequence script function added: showColorDialog

•
3.24

3.24.1 (Mac
OS X only)

2015-12-21

2015-12-23

•
•
•

the sizes of the tool box pages in the main window (Sequences, Scripts, …)
are saved now
send history added in the main window
main window send area: the data can be sent with 'alt+enter' now
main config file lock implemented

•
•

bug fix: error while starting the external script editor on Mac OS X
QtCreator is now used for editing worker script user interfaces on Mac OS X

•

3.25

2015-12-28

•
•
•

3.26

2015-12-30

•

•
3.27

2016-01-04

•
•
•

•

3.28

2016-01-10

•
•
•

•
3.29

2016-01-16

•
•
•
•
•
•
•

4.00

2016-01-30

XML support for worker and custom console/log scripts implemented
new color dialog for selecting the colors of the consoles (background,
receive data …)
new manual chapter: 'Configuration files'
bug fix:
◦ possible crash while saving the content of a script plot widget/window
◦ menu 'Config/create new config' did not work correctly
settings dialog elements adjusted (especially for Linux and Mac OS X)
send history: create script button added
ScriptTcpClient, ScriptUdpSocket and ScriptSerialPort functions added:
canReadLine, readLine, readAllLines
ScriptPlotWidget and ScriptPlotWindow:
◦ the x-range, y-min and y-max input fields accept floats now
◦ function setMaxDataPointsPerGraph added
◦ QCustomPlot has been updated to version 1.3.2
◦ show legend check box added
◦ showHelperElements has new arguments
◦ signal plotMousePressSignal added
ScriptThread functions and signals added/: setScriptState,
getScriptTableName, globalStringChangedSignal,
globalDataArrayChangedSignal, globalUnsignedChangedSignal,
globalSignedChangedSignal, setGlobalRealNumber, getGlobalRealNumber,
globalRealChangedSignal
a simple default script editor is included now
the sequences- and worker-scripts in the main window tool box are
organized in a list view now
ScriptPlotWidget and ScriptPlotWindow:
◦ show legend check box added
◦ showHelperElements has new arguments
◦ signal plotMousePressSignal added
ScriptThread function added: getScriptTableName
bug fix: crash if the start button (main window scripts tab) has been pressed
with an empty script list
GUI's of paused worker-scripts are disabled (greyed out) now
ScriptThread functions added: currentCpuArchitecture, productType,
productVersion
new sequences and scripts are inserted at the front of their tables now
new menus in the script and the send window: move up/down
ScriptPlotWidget and ScriptPlotWindow new function added:
setUpdateInterval
script editor:
◦ the line number is displayed now
◦ zoom in/out implemented

•

new features:
◦ script debugger (worker-scripts)
◦ custom script widget
new script widget class: ScriptCanvas2D
ScriptTableWidget functions changed/added: insertWidget, getWidget,
cellSelectionChangedSignal, getAllSelectedCells,, addCanvas2DWidget
ScriptWidget functions added: getClassName, height

•

•
•

4.01

2016-02-05

•
•
•
•
•
•

main window send area: sequence-scripts can be used now
main window 'Top' button added
sequence and custom console/log scripts: debug support added
new custom script widget: ScriptWebView
ScriptCanvas2D functions added: print, saveToFile
new command-line argument: -P'plug-in path'

4.02

2016-02-07

•
•

ScriptThread function added: availableSerialPorts
script editor: multi-document support, 'open all included scripts' button
added
ScriptSerialPort, ScriptUdpSocket and ScriptTcpClient function added:

•

writeString
4.03

2016-02-13

•
•

•
•

•
•
4.04

2016-02-23

new script editor buttons and menus: new script, edit user interface
script editor auto completion and call tips for several objects/functions
added:
◦ scriptThread object
◦ several QtScript functions and objects
script window and send window menu: 'edit all scripts'
ScriptThread functions added: createProcessAsynchronous,
waitForFinishedProcess, getProcessExitCode, killProcess, terminateProcess,
writeToProcessStdin, readAllStandardOutputFromProcess,
readAllStandardErrorFromProcess, stringToArray, addStringToArray
sequence and custom console/log script functions added:
byteArrayToString, byteArrayToHexString, stringToArray, addStringToArray
new example script: TestProcess

•

ScriptThread functions added: getScriptCommunicatorFolder,
getScriptArguments, zipDirectory, zipFiles, extractZipFile and
getUserDocumentsFolder
new default argument in ScriptThread.ceateProcessAsynchronous
new command-line argument: -minScVersion'version', -A'argument' and
-L'library path'
new main window menu: check for updates
new file types: .sce (ScriptCommuncator executable) and .scez
(ScriptCommuncator executable, zipped)
new dialog: create sce file

•

•
•
•
•

4.05

2016-02-27

•
•

bug fix: deleting the scez temporary folder failed in some cases
drag&drop for several GUI elements implemented

4.06

2016-03-05

•

bug fixes: wrong 'send history button' text after sending the history, the
console message color has not been saved
new log option: 'append time stamp at log file name'
new main window button: reopen (is only visible if the log option 'append
time stamp at log file name' is selected)
the default text-log file extension is 'txt' now

•
•
•
4.07

2016-03-12

•
•
•
•

4.08

2016-03-19

•
•

4.09

2016-04-02

•
•
•
•
•

4.10

2016-05-01

•
•
•

4.11

2016-05-06

•
•

new ScriptWidget function: setPaletteColorRgb
new script widget: ScriptFontComboBox
new and changed ScriptTextEdit functions: lockScrolling, insertHtml and
insertPlainText
new and changed ScriptThread functions: sendDataArray, sendString,
sendCanMessage and addTabsToMainWindow
bug fix: 0xd ('\r') was changed to 0xa ('\n') in the data input fields (main and
send window) if the format was changed to 'ascii'
file paths in configuration files are store relative to the configuration file in
which they occur if they have the same root path (on windows for example
C:\)
Linux: changed the config-file directory to '/$
{USER}/home/.config/ScriptCommunicator'
send history: repetition count added
main window: quit button added, merged the connect and disconnect
buttons to one button, Action menu added
new ScriptThread function: addToolBoxPagesToMainWindow
mixed console: the background-color for the different data types (ascii, bin,
hex and dec) can be adjusted now
the console font size can be modified with 'Ctrl' + 'mouse scroll up/down'
now
send history: the max. number of repetitions have been changed from 99 to
999999999
increased performance at high data rates
scriptThread functions/signals added: sendReceivedDataToMainInterface,
sendDataFromMainInterfaceSignal, checkScriptCommunicatorVersion
new worker scripts: exampleScripts\WorkerScripts\AdditionalInterface

4.12

2016-05-28

•

•
•
4.13

2016-07-03

•
•
•
•

•
•
•
4.14

2016-07-16

•
•

bug fix: the state of a script which has been started at the start-up of
ScriptCommunicator was not shown correct if the user interface could not
be found
worker, sequence and custom console/log script function added:
getAllObjectPropertiesAndFunctions
the arrangement of the main window script-buttons changed
bug fix: the stop bits, the data bits and the parity (main interface serial port)
were not set correctly (except the default settings)
script exception-handling improved (in some cases more information is
displayed)
the TCP server (main interface) can handle multiple TCP clients now
scriptThread functions and signals added:
getMainInterfaceSerialPortSettings, getMainInterfaceSocketSettings,
mainWindowClearConsoleClickedSignal,
mainWindowLockScrollingClickedSignal
new argument in scriptThread::appendTextToConsole
sequence and custom console/log script function added:
appendTextToConsole
main window save console: the background color is saved now
new ScriptTimer functions and signals: setSingleShot, isSingleShot,
setInterval, interval, isActive, remainingTime, timeoutSignal
ScriptEditor: auto-completion for script GUI elements and for dynamically
created script objects (e.g. ScriptSerialPort) implemented

4.15

2016-07-30

•

ScriptEditor:
◦ if the enter key is pressed after an unclosed '{' then '\n}' is added
◦ improved auto-completion
◦ the auto-completion can be manually started with 'CTRL+Shift' now

4.16

2016-10-11

•

bug fix:
◦ possible crash while running a custom log/console script in the script
debugger
◦ possible crash while running a worker script in the script debugger and
receiving data at high data rates
new worker, and sequence script function: calculateCrc8WithPolynomial
new worker script function: getMainWindowTitle, setMainWindowTitle
ScriptEditor: removed the adding of '\n' by the script editor
main window: worker scripts can be started and stopped by a double click
in the script area
new worker, custom log/console and sequence script object: conv (script
converter)

•
•
•
•
•
4.17

2016-11-01

•

•
•
•
4.18

2016-12-29

•
•
•
•
•
•

4.19

2017-02-23

•
•

bug fix:
◦ error in conv.byteArrayToUint32 (big numbers)
◦ under some circumstances the order of the received and sent bytes
were wrong
new script converter (conv object) function: unsignedCharToSignedChar
new command line option: -C'config file'
ScriptEditor: auto-completion texts for the script SQL classes added
new shortcuts in ScriptEditor and ScriptCommunicator
ScriptEditor: the font is adjustable now
new worker script functions: getSerialPortSignals, getTimestamp
new ScriptWidget functions: getObjectName, setObjectName
new ScriptButton and ScriptToolButton functions: setCheckable,
isCheckable, isChecked, setChecked
new ScriptTableWidget function: insertRowWithContent
ScriptStatusBar class removed (replaced by
ScriptMainWindow::showMessage)
ScriptEditor:
◦ bug fix: ScriptButton::clickedSignal was missing in the auto-completion
list
◦ script file locks added (to prevent opening the same file in multiple
instances of ScriptEditor)

•
•
•
•
•
•
•
4.20

2017-03-31

•
•
•
•

•
•
•
•
4.21

2017-05-09

•

•
•

4.22

2017-05-27

•
•
•

settings dialog: connect button added
if ScriptCommunicator detects that a script file is opened by an instance of
ScriptEditor and contains unsaved changes then a message box is displayed
new config file extensions (.config, .scripts and .seq)
new script converter function: byteArrayToUtf8String
new scriptThread functions: getConsoleSettings,
setMainWindowAndTaskBarIcon
new command-line argument -I
new ScriptWidget function: setWindowIcon
new scriptThread function: processIsRunning
scriptThread function changed: getTimestamp
new ScriptWidget function: createShortCut
bug fix: readAllStandardOutputFromProcess and
readAllStandardErrorFromProcess return now if the process has stopped (if
isBlocking is true)
SCE files are now created in a separate folder.
new ScriptLed (CustomWidget) functions: setColorRgb, setFlashRate
ScriptEditor: UTF-8 support added
new worker and custom log/console script object: scriptFile
batch files added with which self extracting (sfx) zip (exe) files can be
created (only on window) with winrar (the sfx file contains all necessary
ScriptCommunictor files and a script (and it's resources) which shall be
executed)
update tab added (settings dialog)
ScriptEditor:
◦ global variables are now displayed in the outline window
◦ ui window added
◦ reload/close button added
◦ goto definition added (Ctrl+DoubleClick)
◦ improved source parsing
◦ icons in the outline windows added
◦ find/replace all added
◦ if the mouse is moved to a function with a call tip (API functions like
scriptThread.stopScript()) then this call tip is shown now
option 'None' for 'send on enter key' added
bug fix: ScriptCommunicator could not open the manual if the installation
folder contains spaces
ScriptEditor:
◦

◦
◦
◦
5.00

2017-06-16

•
•
•

tabs can be moved now

Number.api added
bool.api added
improved source parsing

all text pasted in the consoles ('Ctrl+V') is sent now (if the 'send input' check
box is checked)
Cheetah SPI removed
Aardvark I2C/SPI support added

5.01

2017-06-22

•

bug fix: possible crash if ScriptEditor could not find the saved
settings

5.02

2017-06-30

•

bug fix: instead of one timestamp several timestamps were added to the
consoles
several keys are send now if they are added in a console and the 'send
input' checkbox is checked:
- ESC (0x1b), Backspace (0x08), up (0x1b 0x5b 0x41), down (0x1b 0x5b
0x42), left (0x1b 0x5b 0x44), right (0x1b 0x5b 0x43)
I2C/SPI slave support added
scriptInf object added (worker scripts)
the toolbar position (main window) is saved/restored now

•

•
•
•
5.03

2017-08-02

•
•
•

consoles: performance optimizations
the main window 'Scripts tab' accepts Drag&Drop now
scripts can be started/stopped with 'Enter' from the main window 'Scripts
tab' now

•
•
•
•
•
•
5.04

2017-08-11

•
•
•

5.05

2017-09-10

•
•

•

•
5.06

2017-09-27

•
•
•

5.07

2017-12-08

•
•
•
•

5.08

•

new ScriptPlotWindow and ScriptPlotWidget functions: setScatterStyle,
setLineStyle, removeDataRangeFromGraph
new ScriptCanvas2D properties and functions: textAlign, setFont, fillText
new ScriptWidget function: setAutoFillBackground
switched from QCustomPlot 1.3.2 to QCustomPlot 2.0
sequences can be sent with 'Alt+Enter' from all input elements now (main
window send area and send window)
sequences can be send with 'Enter' from the main window 'Sequences tab'
now
custom console/log script functionality removed (worker scripts are much
more flexible (exampleScripts\WorkerScripts\MainWindowConsole))
bug fix: print/save console didn't find any console
consoles: performance optimizations
bug fix: ScriptPlotWidget::plotMousePressSignal and ScriptPlotWindow::
plotMousePressSignal returned wrong mouse positions.
ScriptPlotWidget and ScriptPlotWindow: new argument in
setInitialAxisRanges, addGraph accepts now the whole subset of svg color
keywords
ScriptPlotWidget and ScriptPlotWindow new functions and new signal:
xRangeChangedSignal, setCurrentAxisRanges, setAutoUpdateEnabled,
isAutoUpdateEnabled, updatePlot, setLineWidth, getDataFromGraph
ScriptEditor: improved source parsing
bug fix: if a hex string with no spaces was inserted into a send area then it
was truncated
bug fix (Aardvark I2C/SPI): reading more then 128 bytes in on script call did
not work
in some cases more information is shown if an exception occurs
bug fix: on some platforms the lines in ScriptEditor were overlapping each
other
main window find tab: the line of the found string is displayed now
ScriptEditor: 'go to line' added
ScriptPlotWidget and ScriptPlotWindow: new argument in
addDataToGraph and removeDataRangeFromGraph
new scriptThread function: showOpenFileNamesDialog

GUI documentation
Main window

The main window contains:


the consoles which shows:
o the sent data
o the received data
o time stamps
o messages added with the add message dialog
Note: The console font size can be modified with 'Ctrl' + 'mouse scroll up/down'.





a multi-line send area
the send input check box: if checked all text entered in a console will be sent
a menu and the following buttons:
o Connect: connects the main interface (the configuration of the main interface is
done in the configure dialog)
o Disconnect: disconnects the main interface
o Settings: shows the settings dialog
o Sending: shows the send dialog
o Scripts: shows the scripts dialog
o Clear button: clears all consoles
o Lock scrolling: prevents the automatic scrolling in the consoles (if new data is added
to a console the cursor moves to the end of the console)
o Add message: shows the add message dialog

Top: brings all windows to top/foreground
Reopen: reopen all logs (is only visible if the log option 'append time stamp at log file
name' is selected)
if the current connection type is serial port:
o
o



o
o





a check box for setting/clearing the DTR (data terminal ready) pin (default=1)
a check box for setting/clearing the RTS (request to send) pin (default=0)

a sequence area in which the sequences from the send window can be sent
a script area in which the scripts from the script window can be started (normal and in a
script-debugger, stopped and paused)
a find text in console area in which a console text can be searched (in the visible console)
the send history

Note: If the 'check for updates' menu is clicked ScriptCommunicator tries to read
https://github.com/szieke/ScriptCommunicator_serial-terminal. To connect to this address
ScriptCommunicator uses the proxy settings from the update tab in the settings windows.

Settings dialog

In the settings dialog several settings can be accessed:





Note:

the main interface settings (serial port tab, sockets tab, aardvark I2c/Spi tab and pcan tab)
the console settings (the console options and the colors tab)
the log settings (the log options tab)
the update proxy settings (the update tab)
the path to the external script editor (for editing a script in the script window)

To close this dialog press the close button + press Ctrl+Shift+X.

Send dialog

The send dialog contains the single sequence table and a cyclic sequence area.
Single sequence table
In the sequence table send sequences can be stored. The right mouse button is used to send a
sequence.
Note:
A selected row in the sequence table can be moved up or down while holding the left mouse button
at the row and moving the mouse up and/or down.
Cyclic sequence area
The cyclic send area contains following:








a data input field
a script path filed
a send button which sends the data
a format combo box which sets the format of the data which shall be sent
a Repetition field which sets the number repetitions (if 0 is entered the data is sent only
once, if 1 is entered the data is sent twice)
a pause field which sets the pause in milliseconds between two repetitions
a progress bar which shows the progress while sending data

In addition to the simple sending of a sequence a sequence script can be used (see chapter Sequence
script).
Note:
If ScriptCommunicator is connected to a CAN interface the send bytes are:
 Byte 0= message type (0=standard, 1=standard remote-transfer-request, 2=extended, 3=
extended remote-transfer-request)
 Byte 1-4 (MSB)= can id

 Byte 5-12= the data
If more then 8 data bytes are given, several can messages with the same CAN id will be sent.
If ScriptCommunicator is connected to a I2C master interface the send bytes are:
 Byte 0= flags bits (1=10 bit address, 2=combined FMT, 4=no stop condition)
 Byte 1-2 (MSB)= I2C address
 Byte 3-4 (MSB)= number of bytes to read
 Byte 5-n= the data which shall be sent
Change the sequence configuration
Following is implemented:














create a new sequence: Ctrl+N or menu single sequence/new sequence
add a sequence script: Ctrl+A or menu single sequence/add sequence script
create a sequence script: Ctrl+C or menu single sequence/add sequence script
edit a sequence script: Ctrl+E or menu single sequence/edit sequence script
remove a sequence script: menu single sequence/remove sequence script
delete a sequence: select the corresponding sequence and press Ctrl+D or menu single
sequence/delete sequence
move the selected sequence up: select the corresponding sequence and press Ctrl+Up or
menu sequence/move up
move the selected sequence down: select the corresponding sequence and press Ctrl+Down
or menu sequence/move down
edit all sequence scripts: press Ctrl+Shift+A or menu single sequence/edit all sequence
scripts
save the sequence config: Ctrl+S or menu config/save config
save the sequence config under a new name (save as): Menu config/save config as
load another sequence config: Ctrl+L or menu config/load config
unload the current sequence config: menu config/unload config

Note:
To close this dialog press Ctrl+Shift+X.

Scripts dialog
In this window worker scripts (see chapter Worker scripts) can be added and executed.

This dialog contains following functionality:
 Change the script configuration (the content of the script table)
 Create and edit scripts and ui (user interface) files
 Load and save the script configuration (the content of the script table)
 Start, debug, pause and stop scripts
Note:
A selected row in the script table can be moved up or down while holding the left mouse button at
the row and moving the mouse up and/or down.
Change the script configuration
Following is implemented:









Add scripts to the script table: Ctrl+A or menu script/addscript
Remove script from the script table: select the corresponding row and press Ctrl+R or menu
script/remove script
Change the path to a script in the script table: double click on the corresponding entry in
path column
Add an ui file to a script: double click on the corresponding empty entry in ui column
Remove an ui file from the script table: select the corresponding row and press Ctrl+Shift+R
or menu script/remove ui
Change the path to an ui file in the script table: double click on the corresponding entry in ui
column
move the selected script up: select the corresponding script and press Ctrl+Up or menu
script/move up
move the selected script down: select the corresponding script and press Ctrl+Down or
menu script/move down

Note:
If a script is added and in the same directory a file with the name “scriptName”.ui exists then it will
be added automatically to the ui column. Example: If the script name is myScript.js then the file
myScript.ui will be added automatically.

Create and edit scripts/ui (user interface) files
Following is implemented:







Edit a script (with an external script editor): select the corresponding row and press Ctrl+E
menu script/edit script
Create new script (from template): Ctrl+N or menu script/new script (after pressing this
menu 2 dialogs appear (first the template file must be chosen and then the name/path of the
new script))
Edit an ui file (with QtDesigner): select the corresponding row and press Ctrl+Shift+E or the
menu script/edit ui
Create new ui file: select the corresponding row and press Ctrl+Shift+N or the menu
script/new ui
Edit all scripts: press Ctrl+Shift+A or menu script/edit all sequence scripts

Load and save the script configuration (the content of the script table)
Following is implemented:





Load a script configuration from a file: Ctrl+L or menu script config/load config
Unload the current script configuration: Ctrl+U or menu script config/unload config
Save the current script configuration: Ctrl+S or menu script config/save config
Save config as (opens a save dialog, where a file name can be chosen): Ctrl+Shift+S or menu
script config/save config as

Start, debug, pause and stop scripts
Following is implemented:





Start a script: select the corresponding row and press the start button or press Ctrl+1
Debug a script: select the corresponding row and press the debug button or press Ctrl+2 (the
script will be executed with an attached script debugger)
Pause a running script: select the corresponding row and press the pause button or press
Ctrl+2
Stop a running or paused script: select the corresponding row and press the stop button or
press Ctrl+3

Note:
If ScriptCommunicator is closed it saves the state (running, paused and not running) of all scripts. If
ScriptCommunicator is started again all script status are restored.
This means if a script is running while ScriptCommunicator is closing then this script will be
automatically started after ScriptCommunicator has been started the next time.
To clear the console press the clear button or press or press Ctrl+Shift+C.
To close this dialog press the close button + press Ctrl+Shift+X.

Create sce file dialog
In this window sce (ScriptCommunicator executable) and scez (ScriptCommunicator executable,
zipped) files can be created (see chapter SCE files and SCEZ files). To open this dialog go to the script
window and click the 'script/create sce file' menu.

Load and save the sce file configuration (the content of the complete window)
Following is implemented:





Load a configuration from a file: Ctrl+L or menu Config/load config
Unload the current configuration: Ctrl+U or menu Config/unload config
Save the current configuration: Ctrl+S or menu Config/save config
Save config as (opens a save dialog, where a file name can be chosen): Ctrl+Shift+S or menu
Config/save config as

Generate a sce or scez file
To create a sce or a scez file the corresponding entries in the 'Generate' menu must be used.
Note:
• To generate a sce or a scez file at least one 'executable script' must be in the file table (a file
marked with this type is started by ScriptCommunicator as script) and the sce file name must
be set.
• To close this dialog press Ctrl+Shift+X.
• To start/execute a sce or scez file ScriptCommunicator must be started with the
corresponding file as a command-line argument (see chapter Command-line arguments).
• If you have associated the .scez and the .sce file ending with ScriptCommunicator then you
can simply double click on the file to execute it.

File table
The file table contains following columns:
• sub directory: contains the directory of the file entry inside the sce folder
• file type: the type of the file entry
• source: the source of the file entry
The file type is used by ScriptCommunicator to suggest the sub directory (which can be changed
manually).

Furthermore following file types have a special meaning:
• executable script: a file marked with this type is started by ScriptCommunicator (during the
sce or scez file execution)the
• lib: the sub directory of this file is added to the ScriptCommunicator library path (if you need
extra libraries (e.g. for a custom widget) then add the libraries with this file type)
• plugin: the sub directory of this file is added to the ScriptCommunicator plug-in path (if you
need extra plug-ins (e.g. for a custom widget) then add the plug-ins with this file type)
Arguments list
All arguments which are added here can be read by the worker scripts with Array
getScriptArguments(void).
Options and sce file area
In this area following options can be set:
• min. version: the minimum version of ScriptCommunicator which is needed to execute the
current scripts
• with script window: the script windows shall be shown (per default minimized)
• not minimized: the script window shall not be minimized
• sce file: the sce file path
Note:
You can find an example sce project in
ScriptCommunicator\exampleScripts\WorkerScripts\PlotWindow (exampleSceFileConfig.xml).

Add message dialog

In this dialog a message can be entered which will be shown in the consoles and be written into the
logs.

Sending and receiving a file
To send a file the script sendFile.js (exampleScripts/WorkerScripts/SendFile) can be used.
To receive a file the script receiveFile.js (exampleScripts/WorkerScripts/ReceiveFile) can be used

Configuration files
ScriptCommunicator has 4 configuration files:
•
•

the main configuration file
the sequences configuration file

•
•

the scripts configuration file
the sce configuration file

Note: File paths in configuration files are store relative to the configuration file in which they occur if
they have the same root path (on windows for example C:\).

Main configuration file
The main configuration file contains:
•
•
•
•
•
•
•

all settings from the settings dialog
the sizes and positions of all ScriptCommunicator windows
the data of the cyclic send area in the send window
the send history
the data of the send area in the main window
the name/path of the used sequence configuration file
the name/path of the use script configuration file

To create/use a new main configuration file the 'Config' menu in the main window can be used (see
chapter Main window).

Sequence configuration file
The sequence configuration file contains all entries of the sequence table in the send window. To
load, unload or save the sequence configuration file the 'config' menu can be used (see chapter
Change the sequence configuration).

Script configuration file
The script configuration file contains all entries of the script table in the script window. To load,
unload or save the script configuration file the 'script config' menu can be used (see chapter Change
the script configuration).

SCE configuration file
The sce configuration file contains the content of the complete create sce file dialog. To load, unload
or save the sce configuration file the 'Config' menu can be used (see chapter Load and save the sce
file configuration (the content of the complete window)).

Command-line arguments
ScriptCommunicator has several command-line arguments. These arguments are:
• -A: a script command-line argument (these arguments can be read by worker scripts with
the function Array getScriptArguments(void)
• -L: adds an additional library path (e.g. for loading a custom script widget)
• -C: the configuration file to start with
• -P: adds an additional folder to the ScriptCommunicator plug-in (custom script widgets)
search path
• -I: replace the standard icon for the main window (taskbar and window), supported formats:
.ico, .gif, .png, .jpeg, .tiff, .bmp, .icns

scripts, sce files (see chapter SCE files) or scez files (see chapter SCEZ files) separated by a
space
Example:
•

ScriptCommunicator.exe -CC:\initialSettingsWin2.config -IC:\myIcon.ico

Command-line mode
ScriptCommunicator has a command-line mode in which scripts can be executed without the
ScriptCommunicator GUI. This command-line mode is entered if a script, a sce or a scez file is found
in the command-line arguments.
Additional command-line arguments for the command-line mode:
• -withScriptWindow: the script windows shall be shown (per default minimized)
• -notMinimized: the script window shall not be minimized
• -minScVersion: the minimum version of ScriptCommunicator which is needed to execute the
current scripts
Example:
ScriptCommunicator.exe -withScriptWindow -notMinimized -minScVersion04.04 -PC:/dir1 -LC:/dir2 -Aarg1 -Aarg2
C:/script1.js C:/script2.js

Command-line mode limitations:
• no ScriptCommunicator window is visible per default (only the script window can be shown
(-withScriptWindow))
Program termination without the argument withScriptWindow:
• if all worker scripts are stopped ScriptCommunicator exits automatically
• a call to scriptThread.exitScriptCommunicator() exits ScriptCommunicator
Program termination with the argument withScriptWindow:
• ScriptCommunicator exits automatically if the script window has been closed
• a call to scriptThread.exitScriptCommunicator() exits ScriptCommunicator
SCE files
The sce file (ScriptCommunicator executable) is a possibility to put all command-line arguments in
one file. This file is a simple XML file and has following structure:
 





Navigation menu