Exporting a script module, Exporting a script module -4 – Measurement Computing DASYLab User Manual User Manual

Page 58

Advertising
background image

Chapter 6

Programming Your Own Modules

6-4

|

dasylab.com

DASYLab creates a text file with the filename extension

.py

. In the module

you can no longer edit the script you saved externally. Instead you must load
the script file into the module in order to test the programmed module
functions. If you use the script file in a different script module, this module
must have the same predefined settings and channel settings as the original
script module. You select the external editor in the configurator.

Exporting a Script Module

The reason for programming script modules is to have new modules in
DASYLab. Users can select the new modules in the browser and configure
them after inserting them in the worksheet. If you want to share a script
module with another user, you must export the script with the programmed
script. You then generate a script package from one or several exported script
modules and register this script package in DASYLab.

In the first step, you double-click the script module and select Export.
DASYLab opens the export dialog box with the basic settings and the
optional additions. Enter, for example,

UserFunction

on the Basic

Settings tab as the name for the module and select the module group Special.
Specify the folder in which DASYLab saves all files for the new module. On
the Additions tab you can assign a help file and a graphics symbol to the
module.

Note

Note that entries and filenames are case-sensitive. Python

as well as DASYLab differentiate between names that are only
lower case and those that are also upper case
(

newmodules<>NewModules

).

In the second step, you open Options»Create Script Package and enter the
name of the script package (

MyModule

), the source folder with the exported

script modules, and the destination folder for the script package. In the
destination folder, DASYLab creates a script package with the filename
extension

.dly

(

MyModule.dly

). A script package is similar to a function

library.

In the third step, you register the generated script package in DASYLab. An
entry in

dasylab.ini

in the

[Extend]

section is sufficient to test the

script package on the test computer. Enter the name of the package and the
filename extension, for example,

DLL5=MyModule.dly

. If you then start

DASYLab, the new module UserFunction is in the module group Special in

Advertising
This manual is related to the following products: