PULSE Automation programming in Visual Basic. From BK training lectures arranged by Jiří Tůma & Radovan Zadražil



Similar documents
Introduction. Why (GIS) Programming? Streamline routine/repetitive procedures Implement new algorithms Customize user applications

TS2Mascot. Introduction. System Requirements. Installation. Interactive Use

DATA 301 Introduction to Data Analytics Microsoft Excel VBA. Dr. Ramon Lawrence University of British Columbia Okanagan

Getting Started with STATISTICA Enterprise Programming

A Microsoft Access Based System, Using SAS as a Background Number Cruncher David Kiasi, Applications Alternatives, Upper Marlboro, MD

Unleashing Hidden Powers of Inventor with the API Part 1. Getting Started with Inventor VBA Hello Inventor!

Introduction to Visual Basic

Government Girls Polytechnic, Bilaspur

Database Automation using VBA

How-To Guide. SigCard1 (With Microsoft Access) Demo. Copyright Topaz Systems Inc. All rights reserved.

TrendWorX32 SQL Query Engine V9.2 Beta III

Creating Datalogging Applications in Microsoft Excel

Applying Visual Basic for Human Machine Interface Applications

IVI Configuration Store

Applications Development

Connecting to an Excel Workbook with ADO

PRODUCT DATA. PULSE WorkFlow Manager Type 7756

Site Monitor. Version 5.3

Unleashing Hidden Powers of Inventor with the API Part 2 of 4: Using iproperties with Inventor VBA

USB GSM 3G modem RMS-U-GSM-3G. Manual (PDF) Version 1.0,

A Comparison of SAS versus Microsoft Excel and Access s Inbuilt VBA Functionality Jozef Tarrant, Amadeus Software Ltd., Oxford, UK

CAPIX Job Scheduler User Guide

Stellar Phoenix Exchange Server Backup

SharePoint 2007 Get started User Guide. Team Sites

Siemens Applied Automation Page 1 11/26/03 9:57 PM. Maxum ODBC 3.11

DocumentsCorePack for MS CRM 2011 Implementation Guide

Documentation to use the Elia Infeed web services

IVI Instrument Driver Programming Guide (Visual Basic 6.0 Edition)

CST STUDIO SUITE Introduction in VBA Macro usage and programming

BarTender s ActiveX Automation Interface. The World's Leading Software for Label, Barcode, RFID & Card Printing

CRM Setup Factory Installer V 3.0 Developers Guide

Control Loop Performance Monitor

LabVIEW Advanced Programming Techniques

Working with Macros and VBA in Excel 2007

My EA Builder 1.1 User Guide

Inteset Secure Lockdown ver. 2.0

Exercise 1: Python Language Basics

What's New in ADP Reporting?

Improve your Close Cycle Using Financial Close Manager

Microsoft' Excel & Access Integration

Unisys INFOIMAGE FOLDER ON WINDOWS NT. Connector for Microsoft Exchange. Getting Started Guide

SQL Server 2005 Reporting Services (SSRS)

C++ INTERVIEW QUESTIONS

FILESURF 7.5 SR3/WORKSITE INTEGRATION INSTALLATION MANUAL 1 PRELIMINARIES...3 STEP 1 - PLAN THE FIELD MAPPING...3 STEP 2 - WORKSITE CONFIGURATION...

TMS Phone Books Troubleshoot Guide

Visual Basic Programming. An Introduction

HMI Visual Basic Scripting Language

SHAREPOINT 2013 NO-CODE SOLUTIONS FOR POWER USERS. Jamie McAllister

Interoperable Web Services for Building Automation Integrating KNX. KNX Scientific Conference 2006

State of Michigan Data Exchange Gateway. Web-Interface Users Guide

The Workflow Management Coalition Specification Workflow Management Coalition Terminology & Glossary

MyOra 3.0. User Guide. SQL Tool for Oracle. Jayam Systems, LLC

Monitoring Replication

Data Transfer Tips and Techniques

AutoMate BPA Server 10 Installation Guide

How to Obtain an OPC License--5. Creating a System Code 5 Entering an Authorization Code 6. Getting Started with SNMP Editor--7

Citrix EdgeSight for NetScaler Rapid Deployment Guide

IBM Sterling Control Center

CHAPTER 1: CLIENT/SERVER INTEGRATED DEVELOPMENT ENVIRONMENT (C/SIDE)

Presentation Reporting Quick Start

What's New in BarTender 2016

OpenIMS 4.2. Document Management Server. User manual

Microsoft Office via Office 365 Subscription Download/Install Instructions and Frequently Asked Questions

Xerox WorkCentre 6655 Color Multifunction Printer Control Panel

How to synchronize Microsoft Project file with SharePoint task list

Asta Powerproject Enterprise

CorHousing. CorHousing provides performance indicator, risk and project management templates for the UK Social Housing sector including:

Database Programming with PL/SQL: Learning Objectives

Module 17. Client-Server Software Development. Version 2 CSE IIT, Kharagpur

Create interactive web graphics out of your SAS or R datasets

Administrator's Guide

Managing Variability in Software Architectures 1 Felix Bachmann*

Sample- for evaluation purposes only. Advanced Crystal Reports. TeachUcomp, Inc.

DataPA OpenAnalytics End User Training

TestManager Administration Guide

SCADA/HMI MOVICON TRAINING COURSE PROGRAM

Modifier with Visual Basic with Applications (VBA) in Microsoft Dynamics GP 9.0

Rational Developer for IBM i (RDi) Introduction to RDi

Users Guide. FTP/400 File Transfer API and Remote Command Server Version By RJS Software Systems, Inc.

FrenzelSoft Stock Ticker

StarWind iscsi SAN & NAS: Multipathing October 2012

Integrating the Internet into Your Measurement System. DataSocket Technical Overview

Ipswitch Client Installation Guide

PaperCut Payment Gateway Module - RBS WorldPay Quick Start Guide

Addendum 3. Do not install Service Pack 3 if you use Oracle 8! Oracle 8 is no longer supported and will not operate with SP3.

EXTENDED FILE SYSTEM FOR F-SERIES PLC

BusinessObjects Enterprise InfoView User's Guide

Microsoft Dynamics NAV

This module explains fundamental aspects of Microsoft Dynamics NAV Development Environment.

How To Create A Checkbox In Visual Basic (For A Powerpoint) With A Check Box At Run Time

Microsoft Office Macro Security

FREQUENTLY ASKED QUESTIONS

Manual English KOI Desktop App 2.0.x

Hands-On Lab. Client Workflow. Lab version: Last updated: 2/23/2011

Transmitter Interface Program

Administration and Business Collaboration. User Manual

Siebel Professional Services Automation Guide

Transcription:

PULSE Automation programming in Visual Basic From BK training lectures arranged by Jiří Tůma & Radovan Zadražil

OLE Automation, general principles Bruno S. Larsen PULSE Software Development

Agenda Overview of Automation Automation of PULSE Why Expose Objects What Is an ActiveX Object? ActiveX Objects in Pulse What Is an ActiveX Client? Automation Summary

Overview of Automation OLE Object Linking and Embedding Also known as OLE2 Excel MS Word Document Embedded Drawing Document Chart Linked Excel chart

Overview of Automation Automation Originally known as OLE Automation An application can expose its features to other programs Automation is based on a Client/Server architecture Application (Program) -PULSE - MS Word -MS Excel

Overview of Automation The Client/Server architecture A Server exposes its functionality to other programs Client Client Clients are applications that access the services of a Server Client Server Client

Overview of Automation Automation is a Microsoft technology that implements a Client/Server architecture It allows a software package (Server) to expose its unique features to other applications (Clients) Automation Server -PULSE - MS Word -MS Excel Automation Client Visual Basic

Agenda Overview of Automation Automation of PULSE Why Expose Objects What Is an ActiveX Object? ActiveX Objects in Pulse What Is an ActiveX Client? Automation Summary

Automation of PULSE Normally the Automation Server and the Client work tightly together in a one-to-one relation on the same PC. PC PULSE Frontend VB Client e.g. Sound Power

Automation of PULSE Automation uses the Component Object Model (COM) PC VB Client COM PULSE COM Frontend

Automation of PULSE The Client and the Server program are able to run on separate PC s connected by a LAN using Distributed COM (DCOM) PC Client DCOM PC PULSE DCOM Frontend LAN

Agenda Overview of Automation Automation of PULSE Why Expose Objects What Is an ActiveX Object? ActiveX Objects in Pulse What Is an ActiveX Client? Automation Summary

Why Expose Objects? The Automation Server exposes its unique features to other applications The exposed features are called objects Using automation you can manipulate the exposed objects in one application from another application Exposing objects provides a way to manipulate an application s tools programmatically Server Client

Why Expose Objects? With Automation solution providers can use generalpurpose objects to build applications that target a specific task PC MS Word PULSE

Why Expose Objects? The PULSE customers can use a programming tool to automate repetitive tasks that might not have been anticipated PC Pulse VB Client

Agenda Overview of Automation Automation of PULSE Why Expose Objects What Is an ActiveX Object? ActiveX Objects in Pulse What Is an ActiveX Client? Automation Summary

What Is an ActiveX Object? The exposed objects are called ActiveX objects The Automation Server is called an ActiveX Server or an ActiveX component acting in the role as server ActiveX Server ActiveX object ActiveX object ActiveX object ActiveX object Client

What Is an ActiveX Object? An object class describes a group of objects with similar attributes and common behaviour. An ActiveX object is a concrete instance of that class Display Display 1 Display 2 My Display Class Objects

What Is an ActiveX Object? An ActiveX object exposes properties and methods. Properties are used to access information about the state of an object. For example one of the objects in PULSE has a Visible property that determines whether pulse is visible Methods are actions that an object can perform. For example one of the objects in PULSE has an OpenProject method that opens a PULSE project ActiveX Object Properties:... Visible...... Methods:...... OpenProject...

Agenda Overview of Automation Automation of PULSE Why Expose Objects What Is an ActiveX Object? ActiveX Objects in Pulse What Is an ActiveX Client? Automation Summary

ActiveX Objects in Pulse PULSE exposes 60 different ActiveX objects All in all 1023 different properties and methods are exposed The objects are organised hierarchically, with an object named Application at the top of the hierarchy Most of the objects maps directly to a well known part of the PULSE user interface

ActiveX Objects in Pulse (From OLE2.HLP)

ActiveX Objects in Pulse Properties: Application DemoMode Enabled Name Project PulseNotification Visible Methods: ActivateTemplate Autorange CalibrateMode CloseProject Exit FilterExtension FilterName NewProject OpenProject Proceed Reset Save SaveProject SaveProjectAs Start StartGenerator Stop StopGenerator Trigger1 Trigger2 Trigger3

Agenda Overview of Automation Automation of PULSE Why Expose Objects What Is an ActiveX Object? ActiveX Objects in Pulse What Is an ActiveX Client? Automation Summary

What Is an ActiveX Client? Applications that use Automation to access exposed ActiveX objects, are called ActiveX clients An ActiveX Client can also be described as an ActiveX component acting in the role as client ActiveX Clients can: Use existing objects Create new instances of objects Get and set properties supported by the object Invoke methods supported by the object ActiveX Server ActiveX object ActiveX object ActiveX object ActiveX object ActiveX Client

What Is an ActiveX Client? You can use Visual Basic and similar programming tools as VC++, DELPHI and Word-VBA and Excel-VBA to create ActiveX Clients. Visual Basic DELPHI Visual C++ MS Word VBA MS Excel VBA

Agenda Overview of Automation Automation of PULSE Why Expose Objects What Is an ActiveX Object? ActiveX Objects in Pulse What Is an ActiveX Client? The Notification system in PULSE Automation Summary

Automation Summary ActiveX Server Expose features to other programs as ActiveX objects ActiveX object ActiveX object ActiveX object Expose properties and methods ActiveX Client Access exposed ActiveX objects Get/set properties Invoke methods

Getting Pulse Data

Getting Pulse Data Dataset objects can be accessed from the functions in the Function Organiser Also the functions added to the displays in the Display Organiser gives access to datasets. In the Mesurement Organiser datasets can be accessed from Input or Saved measurement data. Both the Input buffer and the Multi Buffers contains datasets.

Getting Data from the Function Organiser

Getting Data from the Function Organiser

Getting Data from the Function Organiser Dim FunctionData As Object Using late binding or Dim FunctionData As BKDataSet Using Type Library Set FunctionData = Project.FunctionOrganiser. FunctionGroups("FunctionSet"). Functions("Autospectrum(Signal 1)"). FunctionData

The BKDataSet object The BKDataSet object has the following properties: NumberOfXAxisEntries (Number of lines/frequencies etc.) NumberOfZAxisEntries (Number of spectra in multibuffer) XAxisUnit (Hz, RPM etc.) YaxisUnit (V², etc. Dependent to the type of spectrum. Independent of display setting!) ZaxisUnit ( ) IsComplex (Is data complex?) AcceptedInMultibuffer (Number) MultibufferStartIndex (Number)

The BKDataSet object The BKDataSet object has the following methods: Frequencies RealValues ImaginaryValues GetAllValues GetAverageNumber GetAveragingTime GetOverloadRatio (Get Frequencies) (Get real value part of a vector) (Get imaginary part of a vector) (Get real or imaginary multibuffer) (Look up the Average Number) (Look up the Averaging Time) (Look up the Overload Ratio)

Syntax The BKDataSet object MyPulseData = Object.GetAllValues (Mode as Boolean) The GetAllValues method syntax has three parts: Part Description MyPulseData Local Variable declared as Variant Object An object expression that evaluates to an BKDataSet object. Mode Selects real- (True) or imaginary- (False) part.

The Visual Basic Sample Program Dim FunctionData As BKDataSet Dim MyPulseData As Variant Dim maxx As Long Dim maxz As Long Set FunctionData = Project.FunctionOrganiser. FunctionGroups("FunctionSet"). Functions("Autospectrum(Signal 1)"). FunctionData FunctionData.GetAllValues(True) ' Get real Y values maxx = Ubound(MyPulsedata,1) ' Get max X Index (base 0) maxz = Ubound(MyPulsedata,2) ' Get max Z Index (base 0)

The Visual Basic Sample Program 'If the dataset is empty the GetAllValues method will throw an exception. 'We need to introduce some error handling. On Error Resume Next For I = 1 to 100 MyPulseData = FunctionData.GetAllValues (True) If Err.Number = 0 Then Exit For End If Next I If I > 100 Then MsgBox Err.Description Exit Sub End If On Error GoTo 0 'Restablish default error handling

Getting PULSE data using GetAllValues

Syntax The BKDataSet object Object.RealValues DataArray [,InxZ] The RealValues method syntax has three parts: Part Object DataArray InxZ Description An object expression that evaluates to an BKDataSet object. An array of strings or an array of values A numerical expression (optional).

The BKDataSet object Object.RealValues DataArray [,InxZ] The settings for the RealValues method are: DataArray Description Array of strings A reference to an array of strings. Array of reals A reference to an OLE Automation SafeArray of real values. InxZ Description Default - InxZ is set equal to 0. (This is the first data vector in the BKDataSet structure.) 0 to NumberOfZAxisEntries 1 (The index of the data vector containing the RealValues data structure to be copied).

The BKDataSet object Object.RealValues DataArray [,InxZ] The DataArray structure must be declared in the application that is controlling PULSE and the size of the array must be equal to the number of x-axis entries. In Visual Basic, use the ReDim statement to declare and allocate storage space for an array variable of the type String, Double or Single. In other languages use a safearray of strings (VT_BSTR) or reals (VT_R8 for double or VT_R4 for float/single).

The Visual Basic sample program Readdata Dim FunctionData As Object ' BKDataSet Dim Entries As Long Set FunctionData = Project.FunctionOrganiser. FunctionGroups("FunctionSet"). Functions("Autospectrum(Signal 1)").FunctionData Entries = FunctionData.NumberOfXAxisEntries ReDim ValueArr(Entries - 1) As Double' Dimension array variable FunctionData.RealValues ValueArr ' Get Y values

Getting Data from the Display Organiser

Getting Data from the Display Organiser

Getting Data from the Display Organiser Dim FunctionData As Object ' BKDataSet Get the dataset form one of the functions Set FunctionData = Project.DisplayOrganiser. DisplayGroups("Display Group"). Displays("Autospectrum(Signal 1)"). FunctionData Or get the dataset directly from the active function: Set FunctionData = Project.DisplayOrganiser. DisplayGroups("Display Group"). FunctionData

Getting Data from the Measurement Organiser

Getting Data from the Measurement Organiser

Introduction to Collections & Navigating the Pulse Tree

Introduction to Collections A Collection is a container able to contain everything that s an Object Collection Object Object

Introduction to Collections The defining characteristics of an Object An Object is something that can be accessed through an OLE Automation interface. Examples of Objects could be: a FunctionGroup, a Functions, a SignalGroup, a Signal, a DisplayGroup, and a Display.

Introduction to Collections The defining characteristics of a Collection A (unordered) group of Objects. The ability to iterate over the Objects contained in the Collection Example: Set Instruments = Templates( XXX ).Setup. Instruments For Each Instrument In Instruments MsgBox Instrument.Name Next Instrument

Introduction to Collections Collection capabilities: You can add Objects to a collection You can remove Objects from a collection You can count Objects in a collection You can retrieve an Object from a collection

Introduction to Collections Collection drawbacks (advantages) Collections are not Arrays. An Object s position in a collection is unpredictable. Collections can change at any time.

Navigating the Pulse Tree Where can you get information about the Pulse Tree: The Organisers in Pulse The Ole2.hlp help file: C:\Program Files\Bruel and Kjaer\Pulse\Exe\Ole2.hlp (Not always updated) The Pulse Type Library, using the Visual Basic Object Browser. (Always updated to the used Pulse version)

Working with Notifications

Pulse Notifications The Pulse application is able to transmit status information from its objects, called notifications. Pulse 5.x introduces a new and easier notification system Two types of notification objects are available Notify uses the previously used notifier concept. Notify2 uses a distributed notification system that makes notification filtering easier

Pulse Notify2 Many of the Objects used in Pulse includes a Notify2 Event The Interface to notify2 is simply made by a change in the declaration of the Pulse Object Example: Public WithEvents PulseApplication as PulseLabshop.Application Add a PulseApplication_Notify2 sub, and the notification data is ready for use

Where do You Find Notify2 List of the Pulse Objects that uses Notify2 Event Adapter OrderOnalyzer Application * OverallAnalyzer ConfigurationOrganiser Project CPBAnalyzer * PulseFunction FFTAnalyzer Recorder FreeSpanFFTAnalyzer Slice FunctionOrganiser TachoMeter Generator Template * GeneratorSignal TimeCaptureAnaluzer LoudnessAnalyzer

Thank for paying attention!