85
Software Introduction and Testing Software Introduction and Testing

Software Introduction and Testing - Advantech

  • Upload
    others

  • View
    12

  • Download
    0

Embed Size (px)

Citation preview

Page 1: Software Introduction and Testing - Advantech

Software Introduction and Testing

Software Introduction and Testing

Page 2: Software Introduction and Testing - Advantech

AgendaAgenda

Introduction32-bit DLL DriverSoftware Support ListActiveDAQ Pro DriverLabVIEW DAQ DriverConclusion

Page 3: Software Introduction and Testing - Advantech

IntroductionIntroduction

Page 4: Software Introduction and Testing - Advantech

IntroductionIntroduction

To have a complete DA&C system, we have to learn how to programming DA&C modules

Advantech plug-in DA&C products is consumed by engineers who use any program development tool

Software support could be really difficult

The easier to use, the more successful drivers are

Page 5: Software Introduction and Testing - Advantech

32-bit DLL Driver32-bit DLL Driver

Page 6: Software Introduction and Testing - Advantech

Advantech’s 32-bit DLL DriverAdvantech’s 32-bit DLL Driver

Supported operation systems: Win2000, WinXPIs a MUST for DA&C cardsSame programs can be easily adopted by different cards with the same functions

Hardware independentImmunity against version changes of hardwareIs the base of most 3rd-party drivers

Page 7: Software Introduction and Testing - Advantech

Driver HierarchyDriver Hierarchy

API is controlling DA&C cards through ADSAPI32 drivers

Dev1.sys

Dev1.dll

ADSAPI32

Dev2.dll

Dev2.sys DevN.sys

DevN.dll

Structure

Function ID

Event Share memoryControl code

Driver handle

GeniD

AQ

API

LabVIEW

ActiveX

DasyLA

B

MA

TLAB

User A

PI

Page 8: Software Introduction and Testing - Advantech

Structure ViewStructure View

Comprehensive software support is based on DLL drivers

3rd-Party Software Users

Hardware (PCL/PCI cards, MIC, PCM, USB)

Microsoft Windows (Windows 98, Windows 2000, Windows XP)

DLL Drivers

VS60

VS.N

etB

CB

,Delphi

ActiveD

AQ

ActiveD

aqPro

Advantech L

abviewD

river

Programming Users System Solution Users

Visual B

asic, VC

++, C++

Builder, D

elphi

GeniD

AQ

AStudio

Mathw

orkM

atlabD

river

DasyL

abD

river

AStudio

ActiveD

AQ

ActiveD

aqPro

Page 9: Software Introduction and Testing - Advantech

DOS SupportDOS Support

Can be found in DA&C companion CD folder “CD\DOS”Basically, all control of the cards are accessing the registerRegister information can be found in the bottom of HW manualOne can use register programming for the followings:- some advanced function- real time application, like RTXDOS support could be1. Register (direct I/O) Programming2. DOS driver

Page 10: Software Introduction and Testing - Advantech

DOS Support Example – PCL-818HGDOS Support Example – PCL-818HG

Register Programming Solution1. Find DEMO example in folder:

DA&C 2.5D\DOS\PCL\PCL818HG.150\DIRECT.IO\C2. Check “Appendix C. Register Structure & Format” of

PCL-818HG’s HW manual

3. Compile the program and make execution file

Page 11: Software Introduction and Testing - Advantech

DOS Support Example – PCL-818HGDOS Support Example – PCL-818HG

DOS Driver Solution1. Find examples in folder:

DA&C 2.5D\DOS\PCL\PCL818HG.150\C

2. Compile the program and make execution file

Page 12: Software Introduction and Testing - Advantech

Software Support List Software Support List

Page 13: Software Introduction and Testing - Advantech

Supported Software for DA&C CardsSupported Software for DA&C Cards

Advantech Device Manager- Utility for installation and testing of DA&C cards- Provided functional tests: AI, AO, DI, DO, Counter

Page 14: Software Introduction and Testing - Advantech

Supported Software for DA&C CardsSupported Software for DA&C Cards

Advantech GeniDAQ- SCADS software for DA&C cards and ADAM modules- Fit in low-speed data monitoring and control applic.- A demo video of operation is available inhttp://support.advantech.com.tw/support/KnowledgeBaseSRDetail.aspx?SR_ID=1-1WDJB6

Page 15: Software Introduction and Testing - Advantech

Supported Software for DA&C CardsSupported Software for DA&C Cards

Advantech WaveScan 2.0- Support PCI cards & USB modules- Real-time monitoring- Data logging

Page 16: Software Introduction and Testing - Advantech

Supported Software for DA&C CardsSupported Software for DA&C Cards

32-bit DLL Driver Examples- Include VB, VC, BCB, Delphi examplesActiveDAQ & ActiveDAQ Pro Examples- ActiveDAQ Pro supports PCI and USB modules- All supports VB.NET and C#.NETThird-party Drivers & Examples- LabVIEW (LabVIEW & LabVIEW DAQ)- MATLAB- DASYLABDOS ExamplesLinux Examples

Page 17: Software Introduction and Testing - Advantech

Additional Support ListsAdditional Support Lists

DAQ Support List- Details support list for ActiveDAQ Pro, LabVIEW, LabVIEW DAQ, Linux and WinCE drivers

MATLAB Support List- http://www.mathworks.com/products/daq/supportedio13998.html

DASYLAB Support List- http://www.dasylab.com/content/driver.php?action=filelist&sid=24

Page 18: Software Introduction and Testing - Advantech

Hands-on Practice – WaveScan 2.0Hands-on Practice – WaveScan 2.0

Based on ActiveDAQ Pro controlIntegrate DI function with AI (for low speed AI only)Extend Hardware support to PCI cardsReal-time monitoringHistory checking

Page 19: Software Introduction and Testing - Advantech

Hands-on Practice – WaveScan 2.0Hands-on Practice – WaveScan 2.0

1. Open WaveScan in the folder:- C:\Program Files\Advantech\ActiveDAQ Pro\WaveScan- Start menu Programs Advantech Automation

WaveScan 2.0 WaveScan 2.0

Page 20: Software Introduction and Testing - Advantech

Hands-on Practice – WaveScan 2.0Hands-on Practice – WaveScan 2.0

2. Set device parameters- Please add a Demo module and select it in WaveScan 2.0

Page 21: Software Introduction and Testing - Advantech

Hands-on Practice – WaveScan 2.0Hands-on Practice – WaveScan 2.0

3. Select DI or DO and Save2Disk and Run

Page 22: Software Introduction and Testing - Advantech

Hands-on Practice – WaveScan 2.0Hands-on Practice – WaveScan 2.0

4. Click “Save As” and create a folder for binary data

Page 23: Software Introduction and Testing - Advantech

Hands-on Practice – WaveScan 2.0Hands-on Practice – WaveScan 2.0

5. Click “History” and select saved project

Page 24: Software Introduction and Testing - Advantech

Hands-on Practice – WaveScan 2.0Hands-on Practice – WaveScan 2.0

6. Click “Play” to start history checking

Page 25: Software Introduction and Testing - Advantech

Hands-on Practice – WaveScan 2.0Hands-on Practice – WaveScan 2.0

7. Click “Convert” and create a folder for analog data

Page 26: Software Introduction and Testing - Advantech

Hands-on Practice – WaveScan 2.0Hands-on Practice – WaveScan 2.0

8. Open the converted .xlt file- in C:\Program Files\Advantech\WaveScan 2.0\Converted Data

Page 27: Software Introduction and Testing - Advantech

Hands-on Practice – WaveScan 2.0Hands-on Practice – WaveScan 2.0

9. Create a chart to plot the data

Page 28: Software Introduction and Testing - Advantech

ActiveDAQ Pro ControlActiveDAQ Pro Control

Page 29: Software Introduction and Testing - Advantech

IntroductionIntroduction

A newly developed driver for USB and PCI modulesRevision of ActiveDAQ

ActiveDAQ doesn’t support high speed function ofPCI-1714, PCI-1712, PCI-1721 and PCI-1755

OCX(ActiveX) structureEfficient programming- 20% of parameter setting- 80% of programmingSupports more interfaces- VB, VC, BCB, Delphi, VB.NET, C#.Net

Page 30: Software Introduction and Testing - Advantech

Features of ActiveDAQ ProFeatures of ActiveDAQ Pro

Straightforward user interfaceProperty page offers access to all settingsDefault settings for immediate executionCan be adopted by software that supports OCX componentSatisfy all high speed functions- Modification of ActiveDAQGUI component support

Page 31: Software Introduction and Testing - Advantech

Structure of ActiveDAQ ProStructure of ActiveDAQ Pro

Based on 32-bit DLL driverObject-oriented Consists of Property, Method and Event

Win32-DLL

Active DAQ PROProperties

Method

Event

DeviceName

DeviceNumber

Resolution

SelectDevice

ReadDiChannel

ReadMeasurementValue

OnDiInterrupt

OnTerminate

OnTimeOut

Page 32: Software Introduction and Testing - Advantech

ActiveDAQ Pro ControlsActiveDAQ Pro ControlsDevice Control- AdvDevice: Set & get device informationAnalog Control- AdvAI: High speed and low speed AI- AdvAO: High speed and low speed AODigital Control- AdvDIO: Digital input and outputThermo Control- AdvThermo: Thermocouple measurementCounter Control- AdvCounter: Read counter inputPulse Control- AdvPulse: Generate pulse output

Page 33: Software Introduction and Testing - Advantech

Comprehensive ExamplesComprehensive Examples

Examples are available in C:\Program Files\Advantech\ActiveDAQ Pro\Examples

Page 34: Software Introduction and Testing - Advantech

Hands-on Practice – Using AdvAI ControlHands-on Practice – Using AdvAI Control

Demand- Implementation of AI control in a C#.NET projectMaterial- USB-4716 (or any other AI module)- DevMgr, 32-bit DLL driver, ActiveDAQ Pro driver- Visual Studio .Net envoronmentGoal

Page 35: Software Introduction and Testing - Advantech

Hands-on Practice – Using AdvAI ControlHands-on Practice – Using AdvAI Control

Step 1. New a C# Windows appl. project

Page 36: Software Introduction and Testing - Advantech

Hands-on Practice – Using AdvAI ControlHands-on Practice – Using AdvAI Control

Step 2. Add ActiveDAQ Pro AdvAI Control

Page 37: Software Introduction and Testing - Advantech

Hands-on Practice – Using AdvAI ControlHands-on Practice – Using AdvAI Control

Step 2. Add ActiveDAQ Pro AdvAI Control (Cnt’d)

Page 38: Software Introduction and Testing - Advantech

Hands-on Practice – Using AdvAI ControlHands-on Practice – Using AdvAI Control

Step 3. Check control’s property

Page 39: Software Introduction and Testing - Advantech

Hands-on Practice – Using AdvAI ControlHands-on Practice – Using AdvAI Control

Step 4. Design the form

Page 40: Software Introduction and Testing - Advantech

Hands-on Practice – Using AdvAI ControlHands-on Practice – Using AdvAI Control

Step 5. Start programming5.1- Create a button to select device (optional)

Create a textbox(textBox1) to show device nameDemo.SelectDevice();textBox1.Text=Demo.DeviceName.ToString();

5.2- Create a button to read the AICreate a textbox(textBox2) to show AI readingDemo.ChannelNow=0; textBox2.Text=Demo.DataAnalog.ToString();

Step 6. Test the program

Page 41: Software Introduction and Testing - Advantech

Hands-on Practice – Using AdvAI ControlHands-on Practice – Using AdvAI Control

Comparison with DLL driver programming- Steps of operation are the same- The program is more complicated

Page 42: Software Introduction and Testing - Advantech

Hands-on Practice – AdvAI & AdvAOHands-on Practice – AdvAI & AdvAO

Goal: Connect AI to AO for self-testing - AO: Output AO as willAI: Read high speed AI value coming from AO ch.

Can check the functionality of both AI & AO

- Different controls can coexist at the same time

- Please refer to ActiveDAQ Pro software manual inC:Program Files\Advantech\ActiveDAQ Pro

- New error-handling mechanism

Page 43: Software Introduction and Testing - Advantech

Hands-on Practice – AdvAI & AdvAOHands-on Practice – AdvAI & AdvAO

1. Connect AO to AI2. Open VB and create a new project3. Design a form for your application

(the one below is for your reference)

Page 44: Software Introduction and Testing - Advantech

Hands-on Practice – AdvAI & AdvAOHands-on Practice – AdvAI & AdvAO

4. Open ActiveDAQ Pro manual and check AdvAO/Properties/DataAnalog

Page 45: Software Introduction and Testing - Advantech

Hands-on Practice – AdvAI & AdvAOHands-on Practice – AdvAI & AdvAO

5. Double-click the output button and paste the example code from the manual

Page 46: Software Introduction and Testing - Advantech

Hands-on Practice – AdvAI & AdvAOHands-on Practice – AdvAI & AdvAO

6. Modify the posted code as shown below:

Page 47: Software Introduction and Testing - Advantech

Hands-on Practice – AdvAI & AdvAOHands-on Practice – AdvAI & AdvAO

7. Open ActiveDAQ Pro manual and check AdvAI/Properties/AcquireBulkDataToMemory

Page 48: Software Introduction and Testing - Advantech

Hands-on Practice – AdvAI & AdvAOHands-on Practice – AdvAI & AdvAO

8. Double-click the AI Scan button and paste the example code from manual

Page 49: Software Introduction and Testing - Advantech

Hands-on Practice – AdvAI & AdvAOHands-on Practice – AdvAI & AdvAO

9. Modify the posted code as shown below:

Page 50: Software Introduction and Testing - Advantech

Hands-on Practice – AdvAI & AdvAOHands-on Practice – AdvAI & AdvAO

10. Compile and run the program

Page 51: Software Introduction and Testing - Advantech

GUI Control ActiveDAQ ProGUI Control ActiveDAQ Pro

Page 52: Software Introduction and Testing - Advantech

IntroductionIntroduction

Graphic User InterfaceActiveX componentWill be released in September 2007Must pay to have Serial Number for installationConsists of two parts:ActiveDAQ Pro Device ControlActiveDAQ Pro GUI Control

Page 53: Software Introduction and Testing - Advantech

IntroductionIntroduction

Totally 7 different controls

Page 54: Software Introduction and Testing - Advantech

InstallationInstallation

Contents in Companion CD

Page 55: Software Introduction and Testing - Advantech

OperationOperation

How to add component (in VS 2005)Add control (Toolbox Choose Item COM Component)

Right-Click

Page 56: Software Introduction and Testing - Advantech

OperationOperation

How to add component (in VS 2005)Add control (Toolbox Choose item COM component)

Page 57: Software Introduction and Testing - Advantech

Graph ControlGraph Control

Includes - Axes control- Cursor control- Annotation of data- Multi-Y axes- X vs. Y graph

Page 58: Software Introduction and Testing - Advantech

Graph ControlGraph Control

Property page for parameter setting

Page 59: Software Introduction and Testing - Advantech

Hands-on Practice - AdvGraphHands-on Practice - AdvGraph

Goal: Add data to graph- Among all the GUI controls, Graph control is the most powerful one

- The first thing of utilizing graph control is to plot data to graph

AI, DI or some calculated results may be representedgraphically (through GUI)

- Annotation helps to highlight points in a graph

Page 60: Software Introduction and Testing - Advantech

Hands-on Practice - AdvGraphHands-on Practice - AdvGraph

Get Started – 1. Add control to the form

Page 61: Software Introduction and Testing - Advantech

Get Started – 2. Create a button to plot graph

Hands-on Practice - AdvGraphHands-on Practice - AdvGraph

Page 62: Software Introduction and Testing - Advantech

Hands-on Practice - AdvGraphHands-on Practice - AdvGraph

Get Started – 3. Create a button to add annotation

Page 63: Software Introduction and Testing - Advantech

Hands-on Practice – AdvGraph & AdvNumEditHands-on Practice – AdvGraph & AdvNumEdit

Goal: Enhance graph with cursor- NumEdit control to replace traditional number control- Add cursor using the same way like adding annotation- Cursor provides capability of making scope application

Page 64: Software Introduction and Testing - Advantech

Hands-on Practice – AdvGraph & AdvNumEditHands-on Practice – AdvGraph & AdvNumEdit

1. Add a button and a AdvNumEdit control- Button is for adding cursor- AdvNumEdit is for cursor control

Page 65: Software Introduction and Testing - Advantech

Hands-on Practice – AdvGraph & AdvNumEditHands-on Practice – AdvGraph & AdvNumEdit

2. Program for adding cursor- the same way as adding annotation- the snap mode should be changed to “advSnapNearestYForFixedX”

3. Program for X-axis control- Double-click to enter the programming of NumEdit_value_change

4. Run and test

Page 66: Software Introduction and Testing - Advantech

Demo of AtiveDAQ ProDemo of AtiveDAQ Pro

With ActiveDAQ Pro and its GUI component, DAQ card can address in many more application

Page 67: Software Introduction and Testing - Advantech

LabVIEW DAQ DriverLabVIEW DAQ Driver

Page 68: Software Introduction and Testing - Advantech

IntroductionIntroduction

Short for Laboratory Virtual Instrument Engineering WorkbenchLabVIEW is a visually-oriented programming development toolPrograms are called VIEvery VI in LabVIEW has three main parts:1. The front panel2. The block (or wiring) diagram window3. Icon & connector

Page 69: Software Introduction and Testing - Advantech

Advantech LabVIEW DAQ DriverAdvantech LabVIEW DAQ Driver

The latest generation of LabVIEW driverWrapper of Advantech 32-bit DLL driver for DA&C cardsWorking with LabVIEW version 7, 7.1, 8.0, 8.2Provide different interfaces:- Easy I/O VIs- Intermediate I/O VIs- Advanced I/O VIs- Utility I/O VIsLabVIEWDAQ VI can replace NI’s DAQ VI

Page 70: Software Introduction and Testing - Advantech

Structure of LabVIEWDAQ DriverStructure of LabVIEWDAQ Driver

Through the structure, driver becomes NI Style

Page 71: Software Introduction and Testing - Advantech

Driver InstallationDriver Installation

Where to find the driver- in CD folder: ..\LabVIEW\LabVIEW.exe- on DA&C module’s supporting web pageSteps of operation1. Install Advantech device manager2. Install 32-bit DLL driver3. Install LabVIEW DAQ driverSoftware ManualCan be found, after installation, in C:\Program Files\National Instruments\LabVIEW X.X\help\Advantech

Page 72: Software Introduction and Testing - Advantech

Where to find LabVIEW DAQ VI?Where to find LabVIEW DAQ VI?

Right-click on the “block diagram window” and selectFucntions All Functions User Libraries Advatech DAQ

Page 73: Software Introduction and Testing - Advantech

Hands-on Practice – Easy VI for polling AIHands-on Practice – Easy VI for polling AI

Goal: To read software polling AI w/ easy AI VI- Only one VI is needed

Page 74: Software Introduction and Testing - Advantech

Hands-on Practice – Easy VI for polling AIHands-on Practice – Easy VI for polling AI

1. Draw VIs out from the block diagram window - By just one VI, normal speed AI can be read

- “Build array” is used to separate multi-ch. data

Page 75: Software Introduction and Testing - Advantech

Hands-on Practice – Easy VI for polling AIHands-on Practice – Easy VI for polling AI

2. Create a “Wait Clock”

3. Wire and run the program

Page 76: Software Introduction and Testing - Advantech

Hands-on Practice – Replace NI DAQ VIHands-on Practice – Replace NI DAQ VIGoal: Use existing LV project based on NI DAQ VI- The pin assign of Advantech LabVIEWDAQ VI is

identical to NI DAQ VI

- By replacing the VI, existing programs based on NI DAQdriver can be used to control Advantech DAQ

- A demo video is available on the webhttp://support.advantech.com.tw/support/KnowledgeBaseSRDetail.aspx?SR_ID=1-1Y5SWB

- All examples NI DAQ driver provides can be replaced in the same manner

Page 77: Software Introduction and Testing - Advantech

Hands-on Practice – Replace NI DAQ VIHands-on Practice – Replace NI DAQ VI1. Find NI DAQ “Cont Acq&Chart (buffered)” examplein C:\Program Files\National Instruments\LabVIEW 8.0\examples\daq\anlogin

Page 78: Software Introduction and Testing - Advantech

Hands-on Practice – Replace NI DAQ VIHands-on Practice – Replace NI DAQ VI2. Run & Error (Doesn’t support the HW)

Page 79: Software Introduction and Testing - Advantech

Hands-on Practice – Replace NI DAQ VIHands-on Practice – Replace NI DAQ VI3. Right click the VI and replace it by LabVIEWDAQ VI- Watch out the Device Number connection of AI_Start

Page 80: Software Introduction and Testing - Advantech

Hands-on Practice – Replace NI DAQ VIHands-on Practice – Replace NI DAQ VI4. Finish the replacement of all VI

Page 81: Software Introduction and Testing - Advantech

Hands-on Practice – Replace NI DAQ VIHands-on Practice – Replace NI DAQ VI5. Run again to test

Page 82: Software Introduction and Testing - Advantech

Demo Operation - FFT Analysis of AIDemo Operation - FFT Analysis of AIGoal : Do FFT Analysis on signal sampled by PCI-1714- We can make use of LV’s VI to do lots of things

Page 83: Software Introduction and Testing - Advantech

Demo Operation - FFT Analysis of AIDemo Operation - FFT Analysis of AIWe can use any level of VI to complete the DAQ partAll functions that are available in LabVIEW can be use with LabVIEW DAQ driversThe FFT part id done by “Spectral Measurement VI”

Page 84: Software Introduction and Testing - Advantech

ConclusionConclusion

Page 85: Software Introduction and Testing - Advantech

ConclusionConclusion

32-bit DLL driver maintains all software supportActiveDAQ Pro provides a better interface of controlling Advantech DA&C cardsDevelopment tools that support OCX can also support ActiveDAQ ProGUI control improves ActiveDAQ ProWaveScan 2.0 is a good tool for data monitoring and data logging applications with any programmingExisting LV programs can be saved with LabVIEW DAQ