DASYLab Techniques - Step by Step example for the new Script module - Open Excel


Creating a script to open Microsoft Excel with DASYLab

DASYLab 2020, DASYLab 2016, DASYLab 13.0

Introduction

Three examples are attached, DASYLab 2020, DASYLab 2016 and DASYLab 13. Choose the example for your version of DASYLab. These examples are for DASYLab Full or Pro, and the completed script can be used with DASYLab Lite or Basic. 

DASYLab 2016 updated the underlying version of Python from 2.6.5 to 2.7.10. Scripts written with DASYLab 13 should work with DASYLab 2016, but may benefit from being updated and saved with DASYLab 2016. 
DASYLab 2020 continues to use the same version of Python. Scripts developed for DASYLab 2016 should work unchanged. 

This script will open Microsoft Excel with the selected workbook. It’s intended to be used in conjunction with the DDE modules, which requires that Excel be open with the correct workbook when the measurement starts.

The primary functions of this script are in the Start class and the Stop class. It has no inputs and no outputs; the ProcessData and ProcessValue classes do nothing.

You need to understand a little about Windows programming with Python to create this script. 

To use the example, skip to the final step: Adding the completed module to DASYLab.

The included DASYLab package will install the new module into DASYLab and extract the example script to the DASYLab Worksheet folder.

The DASYLab 13 Script modules uses Python 2.6.5, which is included with the DASYLab 13.0.0 installation.

 The DASYLab 2020 and DASYLab 2016 Script module uses Python 2.7, which is included with the DASYLab 2020 and DASYLab 2016 installation.

The intent of this note is to familiarize you with the steps necessary to create a script and to deploy it as a module.

See below to download the full article as a PDF file, and the zip file containing the complete example. 




Posted 1/8/2015 10:52:00 AM by CJ
https://kb.mccdaq.com/KnowledgebaseArticle50571.aspx