Scripts - MD30

MD30 Interface Client

Document code
M212384EN
Revision
D
Language
English
Product
MD30
Document type
Technical description

The interface client can execute commands from a text file. Each command is on a line of its own and the commands are read one command at a time. Comment lines start with the character #.

There are 2 ways to execute the scripts:

  • With the parameter -f
  • With the source command

Example 1

The file exampleScript.txt contains a comment line and 3 commands. Use the -f parameter to execute the commands from exampleScript.txt.

# This is a comment line
getunitid
getproductinfo
getunitid

The commands are executed and the interface client closes.

c:\client> python.exe md30InterfaceClient.py -P COM4 -f exampleScript.txt
 
Welcome to MD30 interface client. MD30 interface client demonstrates the features of the MD30 serial interface.
 
MD30 interface client version 3.0.0
Interface version D
Copyright (c) Vaisala Oyj. All rights reserved.
Unit ID: 1, Client ID: 0, ID: 0x10,  Nb: 0,  Len: 10, icd_version: D, Err: 0
Serial number: R2730011
 
Unit ID: 1, Client ID: 0, ID: 0x11,  Nb: 1,  Len: 113, icd_version: D, Err: 0
Product Name: MD30,  Serial Number: R2730011,  SW Version: 1.1.0,  MT10 ID: 7C0E261A64A4B1C2,  HMP Serial Number: P4030022
Unit ID: 1, Client ID: 0, ID: 0x10,  Nb: 2,  Len: 10, icd_version: D, Err: 0
Serial number: R2730011

Example 2

The command source exampleScript.txt executes a script containing the commands getunitid, getproductinfo, and getunitid.

/> source exampleScript.txt
Unit ID: 1, Client ID: 0, ID: 0x10, Nb: 0, Len: 10, icd_version: D, Err: 0
Serial number: R2730011

Unit ID: 1, Client ID: 0, ID: 0x11, Nb: 1, Len: 113, icd_version: D, Err: 0
Product Name: MD30, Serial Number: R2730011, SW Version: 1.1.0, MT10 ID: 7C0E261A64A4B1C2, HMP Serial Number: P4030022
/> Unit ID: 1, Client ID: 0, ID: 0x10, Nb: 2, Len: 10, icd_version: D, Err: 0
Serial number: R2730011

You can adjust the delay in the interface client in 2 ways when executing a script.

  • The setdelay command is intended to be used when scripts are executed from the interface client with the source command. The delay must be set before starting script execution. With setdelay, the scripts can be kept more compact.
  • The wait command can be used in the script and must be given each time a delay is needed.