AxoNet Software GmbH. Introduction. Using the AxClient components for asanetwork

Similar documents
AxoNet Software GmbH. Introduction. Using the VCL client components for asanetwork

AxoNet VCL libraries and controls for asanetwork

AxoNet Software - asanetwork libraries and components

AwnDiag asanetwork Diagnostics. Copyright (c) Martin Rothschink, AxoNet Software GmbH

An InputBox( ) function will display an input Box window where the user can enter a value or a text. The format is

Document Manager 6.0 Users Manual by Scanlon Associates

Visual Programming 1. What is Visual Basic? 2. What are different Editions available in VB? 3. List the various features of VB

Tech-Talk Using the PATROL Agent COM Server August 1999 Authored By: Eric Anderson

Chapter 4: Single Table Form Lab

All textures produced with Texture Maker. Not Applicable. Beginner.

Parish . User Manual

Contents Introduction Getting Started Visual Basic Form Configuration Entering the VB Code

Understanding the MsgBox command in Visual Basic

Chapter 25 Design Tools

Text box. Command button. 1. Click the tool for the control you choose to draw in this case, the text box.

LCE Splunk Client 4.6 User Manual. Last Revised: March 27, 2018

Skills Funding Agency

variables programming statements

AxoNet Software GmbH Installation and Operation of asanetwork Network Manager Version 2.5 or later

Lesson 1 using Dreamweaver CS3. To get started on your web page select the link below and copy (Save Picture As) the images to your image folder.

Caliber 11.0 for Visual Studio Team Systems

Excel & Visual Basic for Applications (VBA)

3B2 Word. User Manual

Creating a Model-based Builder

The Crypt Keeper Cemetery Software v.8.0. Table of Contents

IFS Data Migration Excel Add-In

2Practicals Visual Basic 6.0

Data Express 4.0. Data Subset Extraction

FMSel Reference. Fan Mission Selector and Manager for Dark Engine based games. Overview GETTING STARTED MAIN WINDOW TAGS. Rev 7

Design Of Human Computer Interfaces Assignment 1- Hello World. Compliance Report

TRAINING GUIDE FOR OPC SYSTEMS.NET. Simple steps to successful development and deployment. Step by Step Guide

AxoNet Software GmbH Installation and Operation of asanetwork Network Manager Version 3.0 or later

Impossible Solutions, Inc. JDF Ticket Creator & DP2 to Indigo scripts Reference Manual Rev

Function: function procedures and sub procedures share the same characteristics, with

Microsoft Office 2016 Mail Merge

Google Docs: Spreadsheet basics

Creating a Dynamo with VBA Scripts

NDA ISSUE 1 STOCK # MATWorX 32 User s Guide. December, NEC America, Inc.

Performer to DP2 Hot Folder Reference Manual Rev There is only one file involved with installing the Performer to DP2 Hot Folder.

Dive Into Visual C# 2008 Express

Manual. bintec elmeg GmbH. Manual. bintec elmeg Dime Manager. Copyright Version 1.3.8, 2013 bintec elmeg GmbH

Microsoft Access 2010

Part 1. Creating an Array of Controls or Indicators

Stellar Phoenix Outlook PST Repair - Technician User Guide

Introducing Gupta Report Builder

irc Pro (Not for diagnostic use)

FIT 100. Lab 8: Writing and Running Your First Visual Basic Program Spring 2002

DupScout DUPLICATE FILES FINDER

Chapter 3: The IF Function and Table Lookup

Telerik Corp. Test Studio Standalone & Visual Studio Plug-In Quick-Start Guide

Introduction to SQL Server 2005/2008 and Transact SQL

This project was originally conceived as a pocket database application for a mobile platform, allowing a

END-TERM EXAMINATION

#61-844SW ThermalVision Software Instruction Manual

Designer TM for Microsoft Access

Shopping Cart: Queries, Personalizations, Filters, and Settings

AlphaCam Routing Example

Complete Quick Reference Summary

DiskPulse DISK CHANGE MONITOR

Google Sheets: Spreadsheet basics

Vector Issue Tracker and License Manager - Administrator s Guide. Configuring and Maintaining Vector Issue Tracker and License Manager

Module 1: Information Extraction

TYPE EDIT V12. Tutorial 03. Multicopy to create a set of medals COPYRIGHT 2014 GRAVOTECH MARKING SAS ALL RIGHTS RESERVED

First Visual Basic Lab Paycheck-V1.0

To complete this database, you will need the following file:

How to use data sources with databases (part 1)

SAP Engineering Control Center Interface to Solid Edge - User Manual

User's Guide c-treeace SQL Explorer

AURUM Metro Navigation

Lecture 4 DLLs and Custom Hardware Programming

Electronic Portfolios in the Classroom

Access Forms Masterclass 5 Create Dynamic Titles for Your Forms

Remote Process Explorer

DATABASE VIEWER PLUS FOR IPAD: USER GUIDE PRODUCT VERSION: 4.1

PRACTICAL EXERCISE 1.1.6c

TerminalFOUR Version 8 Change Guide

How to Create Happy End-Users

Chapter 20 Troubleshooter

Create a custom tab using Visual Basic

SMART Recorder. Record. Pause. Stop

SharePoint List Booster Features

Excel 2016 Basics for Windows

DELPHI FOR ELECTRONIC ENGINEERS. Part 2 Programming a calculator COURSE

Forms/Distribution Acrobat X Professional. Using the Forms Wizard

ABBYY Recognition Server 4 Release 6 Release Notes

CSE P567 - Winter 2010 Lab 1 Introduction to FGPA CAD Tools

ADO.NET 2.0. database programming with

Discover the new B2B Portal! B2B Portal. Public page of B2B Portal : Don t you have yet an access to the B2B Portal?

Microsoft Access 2016 Intro to Forms and Reports

Perceptive Matching Engine

JRA1 Telescope: NI Flex RIO DAQ Labview Telescope DAQ demonstration software overview

Ninja Menus extension for Magento 2

TRAINING GUIDE. Web App End User Training

WINARTU3. Windows BHT Communications Utility. Installation & User Guide

WinView. Getting Started Guide

Tutorial 3 - Welcome Application

Human Factors Engineering Short Course Topic: A Simple Numeric Entry Keypad

Stellar OST to PST Converter - Technician 8.0. User Guide

Frequently Asked Questions URSA

Global Search v 6.1 for Microsoft Dynamics CRM Online (2013 & 2015 versions)

Transcription:

Introduction for asanetwork Edition 1.0, 20.11.2001, Copyright, all rights reserved

Contents Contents...2 Overview...2 Installation...2 Before you start...3 Building a customer order client...5 Step 1, building the first demo application...5 Step 2, processing orders... 11 Step 3, more properties for orders... 16 Step 4, Accessing order data... 19 Step 5, Crash handling... 22 Building a history client... 24 Step 6, the basic form... 24 Step 7, Adding a time limit... 29 Step 8, More properties... 31 Topics not covered... 34 Overview This introduction shows the basic use of the AxClient components for asanetwork. Using AxClient you can easily implement asanetwork clients for e.g. test and measurement equipment. It is assumed that you have a basic knowledge of asanetwork, the asanetwork SDK and the AxAwn COM layer. The AxClient controls are ActiveX controls. Therefore you can make use of them in nearly all modern development environments like Microsoft Visual Basic or Visual C++, Borland Delphi and C++ Builder or even with Office applications like Excel or Access. Installation Please close any IDE before you start the installation. Then start the installation program DAxClientX.X.X.exe (demo version) or AxClientX.X.X.exe (full version). X.X.X is the current version number, e.g. 1.2.2. After this step is done you need to add a reference or import the controls. This depends on your environment. In Visual Basic select Project/Components Here you should select AxoNet AxClientMgmt and AxoNet AxClientDisplay. If you use Borland Delphi or C++Builder you need to import the AxtiveX controls. Select Components/import ActiveX. Create a new unit called AxClient.dpk and import AxoNet AxClientMgmt and AxoNet AxClientDisplay. Page 2 of 34 Copyright, all rights reserved Edition 1.0, 20.11.2001

Before you start First you need to define the required services for asanetwork. You always have a customer order service based on your license name (DID). In this demo we use the name TEST_. For your application please replace this TEST_ DId with the one you ll find in your license agreement. Then you have one or more test and measurement services as defines in the "Design guide" of asanetwork. The AxClient controls support test and measurement services with XML data (these start with AWNTX) and manufacturer specific services (these start with your DID). For our demo we assume that we have these services in our equipment: TEST_00000 customer order services AWNTXBR000 Brake test (only the general service) AWNTXEM000 Emission test, general service, sub divided into o AWNTXEM010 Emission test, gas engine, no catalyst o AWNTXEM020 Emission test, gas engine, open loop catalyst o AWNTXEM030 Emission test, gas engine, closed loop catalyst o AWNTXEM050 Emission test, diesel engine Then you have to define the service location (DLOC) and the specific properties of each service. This data is mapped into an INI file structure like this: [AWN] DLoc= Orders= Results= {Debug= optional} The dloc of your application goes here order service, e.g. TEST_00000 all general result services separated by ; e.g. AWNTXBR00000;AWNTXEM00000 0 = off, 1 = enabled, displays the debug window from the AxAwn COM library [RESULTSERVICE] Name of the general result services, repeated as necessary, e.g. AWNTXEM00000 SubService= service names of all subservices separated by ; e.g. AWNTXEM010;AWNTXEM020 DiQual= input quality of service, if missing defaults to 1 DoQual= ouput quality of services, if missing defaults to 1 DPrio= priority of service, if missing defaults to 9 [SUBSERVICE] DiQual= DoQual= DPrio= Name of sub service, repeated as necessary Same as above Page 3 of 34 Copyright, all rights reserved Edition 1.0, 20.11.2001

A working example looks like this awn.ini (from our demo project) [AWN] DLoc=AwnTest Orders=TEST_00000 Results=AWNTXBR000;AWNTXEM000 [TEST_00000] Info=customer order services for AwnTest [AWNTXBR000] Info=Brake test [AWNTXEM000] SubService=AWNTXEM010;AWNTXEM020;AWNTXEM030;AWNTXEM050 Info=Emission test, general service [AWNTXEM010] Info=Emission test, gas engine, no catalyst [AWNTXEM020] Info=Emission test, gas engine, open loop catalyst [AWNTXEM030] Info=Emission test, gas engine, closed loop catalyst [AWNTXEM050] Info=Emission test, diesel engine Page 4 of 34 Copyright, all rights reserved Edition 1.0, 20.11.2001

Building a customer order client Step 1, building the first demo application In this introduction we'll use Microsoft Visual Basic 6.0 but you can use other tools in a similar way. Start a new project, save the first form as OrderForm.frm and the project as demo1.prj. Now open project/components and select AxoNet AxClientMgmt and AxoNet AxClientDisplay : Then open project/references and select AxoNet AxAwn and AxoNet AxCollection. These libraries contain COM objects which are used later. Page 5 of 34 Copyright, all rights reserved Edition 1.0, 20.11.2001

Then add an AxClientMgmt component from the palette and drop it onto the form. Place it in the lower right corner: Page 6 of 34 Copyright, all rights reserved Edition 1.0, 20.11.2001

Look at the property window. We ll add some data. First put in the name of our previously created INI file. Here we use awn.ini. If you do not specify any path (like awn.ini) the ini file is search in the windows directory! So we use.\awn1.ini to specify the local directory. Then don t forget the license for your service name. Here we use the demo license for the TEST_ service. The Mode property defaults to morders because we are building an order client. You may want to change the TempDir setting to a local sub directory of your project. Now let s add the GUI part for an asanetwork client. Select the AxClientOrders control from the palette and place it on the form.this control is used to display orders. The default language for the table headers is German. But we'll change this in a second. Page 7 of 34 Copyright, all rights reserved Edition 1.0, 20.11.2001

Go to the property window to set up the language strings for the table header. A quicker way is to right click on the control and select properties. In this property pages you can simply click on Set English to get English strings. Then click apply. On the color and font page you can change the colors and fonts used inside of the table. Page 8 of 34 Copyright, all rights reserved Edition 1.0, 20.11.2001

Next place an AxClientStatus control on the bottom of the form (see below). This control displays a LED and a status line. The led is grey if no connection to network manager has been made. If a connection is established, the led will change to green. If the connection is lost, the led goes to red. The status line is used to show some more information about the selected order. Both controls have an AxBorderStyle property. Here we use the afbsunken style. You may want to play with the other values as well. Your form should now look like this: Before we start our application for the first time, we need to create two event handlers for the form itself. In the Load event we link our controls together and enable the AxOrderMgmt control, in the Unload event we disable our control and save the column widths back into the ini file: ' link the controls together and ' activate the AxOrderMgmt control Private Sub Form_Load() AxClientOrders1.StatusBar = AxClientStatus1 AxClientMgmt1.OrderDisplay = AxClientOrders1 AxClientMgmt1.Active = True ' disable control Private Sub Form_Unload(Cancel As Integer) AxClientMgmt1.SaveColWidths AxClientMgmt1.Active = False Page 9 of 34 Copyright, all rights reserved Edition 1.0, 20.11.2001

Run the application. If you get an error message like the one on the right side the control probably didn t found the ini file. This is most often a result of the wrong working directory. Either close the project, change to your demo1 project directory and double click on the demo1.vbp file or use an absolute path for the ini file. Now you should see a dialog similar to the one below. If you don't see any orders please ensure that the network manager is running and that you have orders available. To create orders you can simply start the order generator from the asanetwork SDK. Examine some of the features. You can sort each column with a click on the column header. You can change the widths of the columns. If you click on an order the status line displays additional information. What is displayed? - The first column contains the order number. - The second column is the position (item) number of this order. - The third column displays the order state together with a bitmap (see Design guide for a description of these symbols). - The forth column displays the license plate of the vehicle. - The fifth and last column display a verbal description of this order position (item). The bottom line shows a green led we are currently connected to the network manager. The remaining space is used for a status line. Here the control displays information about the customer and vehicle for new orders. Page 10 of 34 Copyright, all rights reserved Edition 1.0, 20.11.2001

Step 2, processing orders In this step we'll add some buttons to our application to start, abort and finish orders. Add 3 buttons to your form. Call them "start", "abort" and "finish". Double click on the buttons to set up the event handlers. Add the code shown below to each of the button's event handlers. ' save the selection ' start the selected order Private Sub Start_Click() AxClientMgmt1.SelOrder = AxClientOrders1.ItemIndex AxClientMgmt1.StartOrder ' order aborted by user ' set result flag to raborted Private Sub Abort_Click() AxClientMgmt1.AbortOrder raborted, "aborted by operator", "" ' order finished, transmit result data ' in our demo we use an existing file called gas.xml ' set result according to your testing, e.g. ' rok, rwarning, rbad, rdanger, rtimeout, roverflow Private Sub Finish_Click() AxClientMgmt1.AbortOrder rok, "tests passed", "gas.xml" Page 11 of 34 Copyright, all rights reserved Edition 1.0, 20.11.2001

To start an order we use the StartOrder() method of the AxClientMgmt control. Before we can successfully call any of these order related methods we need to define the order we want to process. This can be done either by assigning a valid value to the SelOrder property or by calling the ItemIndex property of the grid control. ItemIndex returns the index of the currently selected item in the grid control. Assign this index to SelOrder. If the selection is valid, SelOrder is greater than zero. If SelOrder is zero after the assignment, the order is either in the wrong state (i.e. not neutral) or the index is invalid. This selection is used for all further actions like AbortOrder, FinishOrder or InterruptOrder. A selected order is displayed with a gray background (default) in the list. As long as you have not started the order, SelOrder may be changed. ' save the selection ' start the selected order Private Sub Start_Click() AxClientMgmt1.SelOrder = AxClientOrders1.ItemIndex AxClientMgmt1.StartOrder Select an entry in the list and click on the start button. If a customer order system is running (or the order generator) you'll see that the state changes to active. Page 12 of 34 Copyright, all rights reserved Edition 1.0, 20.11.2001

If you select any other item inside the list, the currently assigned SelOrder is displayed with a grey background while the status line displays information about the new selected item. Now click on Abort. The order immediately is set to the neutral state. You only need to call AbortOrder(). Page 13 of 34 Copyright, all rights reserved Edition 1.0, 20.11.2001

' order aborted by user ' set result flag to raborted Private Sub Abort_Click() AxClientMgmt1.AbortOrder raborted, "aborted by operator", "" The first parameter is the result code. Here we use raborted. The second parameter is a brief description. Here we put in "aborted by operator". The last parameter is the path name of a file containing result data. If the order was aborted after you already stored some results you can supply the file name here. In our demo we do not use this parameter. Start the selected order again. The status line has changed and now displays the start time of processing and the device (DLoc). Page 14 of 34 Copyright, all rights reserved Edition 1.0, 20.11.2001

Now we're going to finish this order. Click the finish button. The order is immediately set to the finished state. You only need to call FinishOrder(). ' order finished, transmit result data ' in our demo we use an existing file called gas.xml ' set result according to your testing, e.g. ' rok, rwarning, rbad, rdanger, rtimeout, roverflow Private Sub Finish_Click() AxClientMgmt1.FinishOrder rok, "tests passed", "gas.xml" The first parameter is the result code. In our demo we put in rok. Therefore we get a green check mark. The second parameter is a brief description. Here we put in "tests passed". The last parameter is the path name of a file containing result data. In our demo we use a static file with some results from a gas analyser. Once again the status line changed and now displays the end time of processing and a verbal description of the result code (not the brief result). Page 15 of 34 Copyright, all rights reserved Edition 1.0, 20.11.2001

Step 3, more properties for orders In this step we'll show some more properties of the control: The QueryOnStart and DeleteOnQuery property. Let's start with QueryOnStart. If QueryOnStart is true (default) the control automatically sends a query for new and active orders to the asanetwork. In this way you always make sure, that orders are displayed. As long as you don't provide any way to update the list manually, you should not change this property. DeleteOnQuery (which defaults to false) controls what happens with any existing list. If false the list is not changed before a query is executed. If true, the list is cleared (deleted) and rebuild from the query. What's the difference? If the list is not changed, finished orders remain in the list. If you do any query, only new and active orders are updated. Finished orders are only removed from the list if the dealer management system deletes the whole order. If you clear the list finished orders are removed and the list is rebuild with neutral and active orders only. The best approach is to provide both ways to the user. Add 2 buttons called "Update list" and "Rebuild list". Set both QueryOnStart and DeleteOnQuery to false. Page 16 of 34 Copyright, all rights reserved Edition 1.0, 20.11.2001

Add the code for the event handlers as shown below: ' clear and rebuild the list Private Sub Rebuild_Click() On Error Resume Next AxClientMgmt1.ClearList AxClientMgmt1.QueryOrder "*", AxAwnPosQueryAll ' update list entries Private Sub Update_Click() AxClientMgmt1.QueryOrder "*", AxAwnPosQueryAll Note the error handler for the ClearList method. ClearList may fail if you have active orders in the list. Click on update list, the finished order is still displayed. Page 17 of 34 Copyright, all rights reserved Edition 1.0, 20.11.2001

Click on rebuild list and the finished order is removed. If you look at your working directory you may notice a file called state.dat. This file is used to persistently save the order list if your application is closed. If your restart your application this file is used to fill the order list. You may also have noticed that the list is displayed with grid lines. There s a property called ShowGrid, if it s true the lines are displayed. Page 18 of 34 Copyright, all rights reserved Edition 1.0, 20.11.2001

Step 4, Accessing order data This step shows how we can easily access and change the data before the order is sent to the net. If you look very carefully at the start order command, you'll notice, that the name of the operator is missing. This is true, because this information has to be supplied by the application. Let's add this information now. For every order action there's an OnBeforeXXX event. To add the operator name we use an OnBeforeStarted event. This event is created after you called the StartOrder() method but just before any data is transmitted. So it's the ideal place to do any data modification. ' modify order data ' transmitted with the StartOrder() method Private Sub AxClientMgmt1_OnBeforeStarted() With AxClientMgmt1.CurrentOrder.OrderRealWorker = "J. Worker" End With In the OnBeforeXXX event handlers we have access to the selected send and order data via the properties CuurentSend and CurrentOrder. Note that CurrentSend and CurrentOrder are only valid if you have already called StartOrder! If you start the application again and start an order the order generator now contains the name of the operator (see below). Page 19 of 34 Copyright, all rights reserved Edition 1.0, 20.11.2001

But what if we want to access order data before we called StartOrder? As described above we can t use CurrentOrder because it s undefined before a call to StartOrder was made. In the next example we want to display a dialog before the order is started. For the dialog we need some data (order number and verbal description). To access the data we need to get the index from the list and directly access the data in the list. The list is an AxRefList object and accessible via the OrderList property. ' access order list and ask user then ' save the selection and ' start the selected order Private Sub Start_Click() Dim index As Long Dim OrderObj As AxAwnOrder Dim SendObj As AxAwnSend Dim Msg As String index = AxClientOrders1.ItemIndex With AxClientMgmt1 Set SendObj =.OrderList.Item(index) Set OrderObj = SendObj.Data Msg = "Really start order " & SendObj.Reference.Order Msg = Msg & " - " & OrderObj.OrderTxt & "?" ' now ask user If MsgBox(Msg, vbokcancel, "Question") = vbok Then.SelOrder = index.startorder End If End With Page 20 of 34 Copyright, all rights reserved Edition 1.0, 20.11.2001

You should never store the index in a variable for later processing. The list of orders always may grow or shrink. So it's very likely that your index is no longer the same object as before. Always use DispIndex or SearchOrder() to determine the index number. If you already have an selected order use the SelOrder property. SelOrder is automatically adopted if the list grows or shrinks. Page 21 of 34 Copyright, all rights reserved Edition 1.0, 20.11.2001

Step 5, Crash handling The control automatically keeps track of started orders in the state.dat file as described above. If any order is active, a dirty flag is written tio the ini file. If your application terminates unexpectedly, the previously started order is automatically aborted on restart if the dirty flag is present. If you close your application, the dirty flag is removed and the previously started order is automatically resumed on restart. To demonstrate this feature, start an order and then close the application. If you restart the program you'll notice the previous order is displayed again in the selected and active state. To give you more control over this process two events are available: The OnCrash event only gives you the chance of showing information because generally it makes no sense to resume a crashed system. The OnResume event allows you to either resume the order or abort the processing. ' crash handler Private Sub AxClientMgmt1_OnCrash(ByVal Order As String, ByVal Pos As Long) MsgBox "Application crashed, order " & Order & " aborted!", vbokonly ' resume or abort previously active order Private Sub AxClientMgmt1_OnResume(ByVal Order As String, ByVal Pos As Long) If MsgBox("Resume order " & Order & "?", vbokcancel) = vbok Then ' again use order data for processing Else AxClientMgmt1.AbortOrder raborted, "aborted by operator", "" End If If you click OK the previously selected order is again selected and active: Page 22 of 34 Copyright, all rights reserved Edition 1.0, 20.11.2001

Now kill the application (e.g. use the task manager, go to the process tab, select demo1 and kill the process). Restart the application. Now the order is reset: Page 23 of 34 Copyright, all rights reserved Edition 1.0, 20.11.2001

Building a history client Step 6, the basic form We'll now leave the order handling and start to build a history client. A history client is used to get previously saved results back from the asanetwork. You can then display these old results or use them for comparisons. To display the history form, let's add a new button on the order form called History. Later on we add the OnClick code for this button. Create a new form and again add an AxClientMgmt control. In the same way as before add An AxClientHistory and AxClientStatus control. Here we use the afbraised value for AxBorderStyle and place the status line below the list. Add a button called "Query" and a textbox called plate for the license plate of the vehicle. Save the form as HistoryForm. Page 24 of 34 Copyright, all rights reserved Edition 1.0, 20.11.2001

Select the AxClientMgmt control and change the mode property to mhistory, QueryOnStart to false, DeleteOnQuery to true and add the Ini file and License as before. Again add some code to the Load and Unload event of the form to enable or disable the control. Finally add an event handler for the query button. In this event handler we call the QueryResult method of the control. The first parameter is the service used to send the query, if you enter an empty string, all services defined in the ini file are queried. The second parameter is the license plate we're looking for and the last parameter is the time limit in months. We use 0 = unlimited. Page 25 of 34 Copyright, all rights reserved Edition 1.0, 20.11.2001

' enable control Private Sub Form_Load() AxClientHistory1.StatusBar = AxClientStatus1 AxClientMgmt1.ResultDisplay = AxClientHistory1 AxClientMgmt1.Active = True ' disable control Private Sub Form_Unload(Cancel As Integer) AxClientMgmt1.Active = False ' create a simple query for results Private Sub Query_Click() AxClientMgmt1.QueryResult "", Plate.Text, 0 Back in the order form add this event handler for your "History" button: ' show history form Private Sub History_Click() HistoryForm.Show Start your application and enter a plate number or a piece of a plate number then click query. The control creates a query for every defined service and retrieves the results. Your display now looks like this: - The first column shows the license plate - The second column shows the service which created this result - The third column shows date and time of creation - The last column shows the brief result All results have been retrieved and are stored as files on your hard disk (in the TempDir directory). You have direct access to the AxAwnSend objects and the files using the ResultList property. Page 26 of 34 Copyright, all rights reserved Edition 1.0, 20.11.2001

Now let's add a show button to display the selected result: We use the ItemIndex property again to get the index of the focused item. Then we directly call the asanetwork viewer with the file name of the selected result: ' display selected result with the asanetwork viewer Private Sub Show_Click() Dim index As Long Dim cmdline As String ' get index of selected item index = AxClientHistory1.ItemIndex ' set up path to viewer, if you have the pro version change the exe name cmdline = "c:\progra~1\axonet~1\awnview2\awnview2.exe " ' check if we have enough results If AxClientMgmt1.ResultList.Count >= index Then ' append file name to cmdline cmdline = cmdline & AxClientMgmt1.ResultList.FileName(index) ' start viewer Shell cmdline, vbnormalfocus End If Page 27 of 34 Copyright, all rights reserved Edition 1.0, 20.11.2001

Start you application again, perform a query, select an item and click the "Show" button. The viewer starts up and displays the results: Page 28 of 34 Copyright, all rights reserved Edition 1.0, 20.11.2001

Step 7, Adding a time limit In this step we add the possibility to limit the query for a given period of time. Add a textbox for the input of the time limit. The time limit works in units of months. If you enter e.g. 1, you'll only receive results which are up to 1 month old. if you enter 12 you'll receive all results of the last year. ' create a time limited query for results Private Sub Query_Click() AxClientMgmt1.QueryResult "", Plate.Text, Int(Limit.Text) Page 29 of 34 Copyright, all rights reserved Edition 1.0, 20.11.2001

First example, limit = 1 month (compare this with the next screen shot). Second example, limit = 12 months. Page 30 of 34 Copyright, all rights reserved Edition 1.0, 20.11.2001

Step 8, More properties Again there s the DeleteOnQuery property. If false, you can accumulate different queries, if true the lists are deleted first. Try it. Another property used with queries is the Timeout property. If you start a query the control waits for a response from the network manager. If there is no response in a given time (= Timeout value) the control aborts the query. While the query is running every received item creates an OnQuery event. If the query is finished (either the last item was received or there was a timeout) an OnQueryEnd event is created. We'll use these events to create a blinking panel while a query is running together with a display of the number of received items. Add a label under the query button. Set BorderStyle to 1 Fixed Single. On start of our query we display the word "running". On every OnQuery event we'll toggle the background color of the label between blue and the standard color. The label caption displays the word running and the number of received items. If we receive an OnQueryEnd event, we'll reset the background color and display the total number of received items. Page 31 of 34 Copyright, all rights reserved Edition 1.0, 20.11.2001

' create a time limited query for results Private Sub Query_Click() Label3.Caption = "running" AxClientMgmt1.QueryResult "", Plate.Text, Int(Limit.Text) ' show number of received items and toggle color Private Sub AxClientMgmt1_OnQuery(ByVal cnt As Long) If Label3.BackColor = &H8000000F Then Label3.BackColor = &HFF0000 Else Label3.BackColor = &H8000000F End If Label3.Caption = "running " & Str(cnt) ' query finish, reset color and show results Private Sub AxClientMgmt1_OnQueryEnd(ByVal cnt As Long) Label3.BackColor = &H8000000F Label3.Caption = "finished " & Str(cnt) Query started, notice that the led is green. Page 32 of 34 Copyright, all rights reserved Edition 1.0, 20.11.2001

14 items received: Query finished with 16 items, notice that the led is now off. Page 33 of 34 Copyright, all rights reserved Edition 1.0, 20.11.2001

Topics not covered There are some additional properties and methods not mentioned in this introduction. Please have a look at the online help file for additional information: Methods (items marked with * are for experienced users only) StoreResult save results without an associated order SearchOrder search the list for a specific order and return the index * InsertSend create a new position for a given order HasVehicle returns true if order has extended vehicle data available Properties ReuseFinished if false (default) you can't start an already finished order again ResultRef determines the reference used for history queries: rrlicenseplate, rrvehicleidentification or rrorder Vehicle returns an extended vehicle data object Page 34 of 34 Copyright, all rights reserved Edition 1.0, 20.11.2001