usb-bitp-200 | deditec manual · 4.1.4. access via provided test programs we provide simple...

59
Hardware-Description November USB-BITP-200 2012

Upload: others

Post on 29-Jan-2021

12 views

Category:

Documents


0 download

TRANSCRIPT

  • Hardware-Description

    November

    USB-BITP-200

    2012

  • INDEX

    Index | 2Seite

    1. Introduction 5

    1.1. General remarks 5

    1.2. Customer satisfaction 5

    1.3. Customer response 5

    2. Hardware Description 7

    2.1. Bit Pattern Generator 7

    2.2. Output Cable 8

    3. Firmware update 10

    3.1. DEDITEC Flasher 10

    4. Software 14

    4.1. Using our products 14

    144.1.1. Access via graphical applications 144.1.2. Access via the DELIB driver library 144.1.3. Access via protocol 154.1.4. Access via provided test programs

    4.2. DELIB driver library 16

    164.2.1. Overview 164.2.1.1. Program under diverse operating systems

    174.2.1.2. Program with diverse programming languages

    174.2.1.3. Program independent of the interface

    174.2.1.4. SDK-Kit for Programmer

    184.2.2. Supported operating systems 184.2.3. Supported programming languages 194.2.4. Installation DELIB driver library 214.2.5. DELIB Configuration Utility

    4.3. Integration of the DELIB 22

    224.3.1. Integration of the delib.h in Visual-C/C++ 254.3.2. Integration of the delib.cs in Visual-C#

  • INDEX

    Index | 3Seite

    264.3.3. Integration of the delib.cs in Visual-C# unter Windows 64bit 304.3.4. Integration of the delib.pas in Delphi 314.3.5. Integration of the delib.bas in Visual Basic 324.3.6. Integration of the delib.vb in VB.NET 334.3.7. Integration of the delib.bas in MS-Office (VBA) 354.3.8. Integration of the delib.dll in LabVIEW 354.3.8.1. Integration of the delib.dll in LabVIEW

    444.3.8.2. Usage of the VIs in LabVIEW

    4.4. DELIB CLI (command-line interface) 46

    484.4.1. Customisation for USB-Modules (only Linux) 494.4.2. Customisation for RO-ETH-Modules (only Linux) 504.4.3. DELIB CLI samples

    5. Example program 55

    6. Appendix 58

    6.1. Revisions 58

    6.2. Copyrights and trademarks 59

  • I

    Introduction |Seite 4

    Introduction

  • Introduction |Seite 5

    1. Introduction

    1.1. General remarks

    First of all, we would like to congratulate you to the purchase of a high qualityDEDITEC product.

    Our products are being developed by our engineers according to qualityrequirements of high standard. Already during design and development we takecare that our products have -besides quality- a long availability and an optimalflexibility.

    Modular design

    The modular design of our products reduces the time and the cost of development.Therefor we can offer you high quality products at a competitive price.

    Availability

    Because of the modular design of our products, we have to redesign only a moduleinstead of the whole product, in case a specific component is no longer available.

    1.2. Customer satisfaction

    Our philosophy: a content customer will come again. Therefor customersatisfaction is in first place for us.

    If by any chance, you are not content with the performance of our product, pleasecontact us by phone or mail immediately.

    We take care of the problem.

    1.3. Customer response

    Our best products are co-developments together with our customers. Therefor weare thankful for comments and suggestions.

  • II

    Hardware Description |Seite 6

    Hardware Description

  • Hardware Description |Seite 7

    2. Hardware Description

    The bit pattern generator offers the opportunity to output a given bit pattern with asimple source code software. The bit pattern width is 36 bit and is able to beoutput by a speed up to max 200MHz to all 36 channels. In Addition, the softwareoffers to program an arbitrary repetitive sequence to repeat bit pattern sequences.

    2.1. Bit Pattern Generator

    Power supply via USB-Port (max. 500mA)

    36 channels

    36 Bit bit pattern width

    Sample Puffer: 512 Kbit / channel

    Repeat count: free configurable 1..65535 / unending

    Connector: 2x 20pol connector (contact spacing 2.0 mm)

    Dimensions: 117x79x24 (LxBxH in mm)

    Temperature range: 0°C until +50°C

  • Hardware Description |Seite 8

    2.2. Output Cable

    As an optional accessory for the "USB-BITP-200" there is a specific output cablewith colored and labeled wire ends (diameter ca. 0,8mm). This can be plugged onwires, socket boards or so-called micro-kleps. Micro-kleps are hook clips with arotatable reacher and are also available at us.

  • III

    Firmware update |Seite 9

    Firmware update

  • Firmware update |Seite 10

    3. Firmware update

    3.1. DEDITEC Flasher

    You can find the latest firmware version for your DEDITEC product always at thedownload section of our homepage.

    ( -> http://www.deditec.de/en/module/downloads/firmware-updates.html )

    Approach after download

    Unzip the ZIP archive

    Start the program deditec-flasher.exe

    The following application will be opened:

    You can find a detailed description of the available commands on the followingpage.

    http://www.deditec.de/en/module/downloads/firmware-updates.htmlhttp://www.deditec.de/en/module/downloads/firmware-updates.html

  • Firmware update |Seite 11

    1. Select the Interface of the module of the RO-Series

    Command (Key) Interface

    U USB-Interface

    S Serial Interface (RS-232 / RS-485)

    C CAN-Interface

    E Ethernet-Interface

    V USB2-Interface

    Note:

    1) The current selected interface will be displayed in the last line (Selected Device= USB)

    2) Press key Q to flash "non-RO-Series-products" (USB-Mini-Sticks, USB-Logi-500, ..)

    3) In order to flash products of the RO-CAN-Series, you have to connect themodule with your PC via the CAN/SER adapter.

    2. Additional options

    Command (Key) Description

    D Flasher runs in DEBUG mode

    Therefore, additional information will be displays

    P Reads the current firmware of connected DEDITECproducts

    3. Select the module which you want to flash (RO-Series only)

    Command (Key) Description

    M Flash the RO-Interface module

    A Flash all AD16, AD16-DA4, DA4 or AD16_ISO submodules

    B Flash all DA2_ISO sub modules

    G Flash all STEPPER2 sub modules

    H Flash all O8-R8 or M16 sub modules

    I Flash all PT100 sub modules

    J Flash all CNT8 or CNT/IGR sub modules

    Z Scan the module for available sub modules

  • Firmware update |Seite 12

    After successful update procedure, the message FLASH-OK! appears.

  • IV

    Software |Seite 13

    Software

  • Software |Seite 14

    4. Software

    4.1. Using our products

    4.1.1. Access via graphical applications

    We provide driverinterfaces e.g. for LabVIEW and ProfiLab. The DELIB driverlibrary is the basis, which can be directly activated by ProfiLAB.

    For LabVIEW, we provide a simple driver connection with examples!

    4.1.2. Access via the DELIB driver library

    In the appendix, you can find the complete function reference for the integration ofour API-functions in your software. In addition we provide examples for thefollowing programming languages:

    C

    C++

    C#

    Delphi

    VisualBasic

    VB.NET

    MS-Office

    4.1.3. Access via protocol

    The protocol for the activation of our products is open source. So you are able touse our products on systems without Windows or Linux.

  • Software |Seite 15

    4.1.4. Access via provided test programs

    We provide simple handling test programs for the most important functions of ourproducts. These will be installed automatically by the installation of the DELIBdriver library.

    So you can test directly e.g. relays or you can check the voltage of an A/Dconverter.

  • Software |Seite 16

    4.2. DELIB driver library

    4.2.1. Overview

    The following figure explains the structure of the DELIB driver library

    The DELIB driver library allows an uniform response of DEDITEC hardware withparticular consideration of the following viewpoints:

    Independent of operating system

    Independent of programming language

    Independent of the product

    4.2.1.1. Program under diverse operating systems

    The DELIB driver library allows an uniform response of our products on diverseoperating systems.

    We has made sure, that all of our products can be responded by a few commands.Whatever which operating system you use. - Therefore the DELIB cares!

  • Software |Seite 17

    4.2.1.2. Program with diverse programming languages

    We provide uniform commands to create own applications. This will be solved bythe DELIB driver library.

    You choose the programming language!

    It can be simply developed applications under C++, C, Visual Basic, Delphi orLabVIEW®.

    4.2.1.3. Program independent of the interface

    Write your application independent of the interface !

    Program an application for an USB product of us. - Also, it will work with anethernet or RS-232 product of us !

    4.2.1.4. SDK-Kit for Programmer

    Integrate the DELIB in your application. On demand you receive an installationscript for free, which allows you, to integrate the DELIB installation in yourapplication.

  • Software |Seite 18

    4.2.2. Supported operating systems

    Our products support the following operating systems:

    Windows 7

    Windows Vista

    Windows XP

    Windows 2000

    Linux

    4.2.3. Supported programming languages

    Our products are responsive via the following programming languages:

    C

    C++

    C#

    Delphi

    VisualBasic

    VB.NET

    MS-Office

  • Software |Seite 19

    4.2.4. Installation DELIB driver library

    Start screen of the DELIB installer

    Insert the DEDITEC driver CD into the drive and start „delib_install.exe“. TheDELIB driver library is also available on http://www.deditec.en/delib

    Click on „Install“.

  • Software |Seite 20

    The drivers will be installed.

    The DELIB driver library is now installed. Press „Close“ to finish the installation.

    You can configure your module with the „DELIB Configuration Utility“ (see nextchapter). This is only necessary, if more than one module is present.

  • Software |Seite 21

    4.2.5. DELIB Configuration Utility

    Start the “DELIB Configuration Utility” as follows:

    Start Programs DEDITEC DELIB DELIB Configuration Utility.

    The „DELIB Configuration Utility“ is a program to configure and subdivideidentical USB-modules in the system. This is only necessary if more than onemodule is present.

  • Software |Seite 22

    4.3. Integration of the DELIB

    4.3.1. Integration of the delib.h in Visual-C/C++

    Description of the DELIB integration in Visual-C/C++

    The DELIB Installation defines environment variables to facilitate links to theDELIB-include and DELIB-lib directory.

    DELIB_LIB = C:\Programs\DEDITEC\DELIB\lib

    DELIB_INCLUDE = C:\Programs\DEDITEC\DELIB\include

    Start Visual-C/C++ and open via menu "Projekt -> Einstellungen"

  • Software |Seite 23

    DELIB.H entry in the Visual-C/C++ Project configurations

    Under the tab "C/C++" choose the "Kategorie" Präprozessor and enter on"Zusätzliche Include Verzeichnisse" "$(DELIB_INCLUDE)".

  • Software |Seite 24

    DELIB.LIB entry in the Visual-C/C++ Project configurations

    Under the tab "Linker" extend the existing line in "Zusätzliche IncludeVerzeichnisse" with the ending "$(DELIB_LIB)\delib.lib"

  • Software |Seite 25

    4.3.2. Integration of the delib.cs in Visual-C#

    Description of the DELIB integration in Visual-C#

    You can find the needed files for Visual-C# in the directory C:\Programme\DEDITEC\DELIB\Include\delib.cs. Start Visual-C# and open viamenu "Projekt -> Vorhandes Element hinzufügen" in the directory C:\Programme\DEDITEC\DELIB\Include\ the file "delib.cs" to import.

    Add the following reference in your program:using DeLib;

  • Software |Seite 26

    4.3.3. Integration of the delib.cs in Visual-C# unter Windows 64bit

    Program sample for the DELIB driver library under Windows 64 Bit

    In the following sections there is a description how to compile the project as "x86"

    Show all settings

    Open the options via menue "Extras -> Optionen"

    Check “Alle Einstellungen anzeigen"

  • Software |Seite 27

    Check under "Projekte und Projektmappen" "Erweiterte Buildkonfigurationenanzeigen".

  • Software |Seite 28

    The Configuration Manager

    Open the configuration manager via "Any CPU -> Konfigurations-Manager...".

    In the configuration manager select under der column "Plattform" "Any CPU ->Neu...".

    Under "Neue Plattform" select "x86".

  • Software |Seite 29

    Start debugging

    You can start the debugging as normal via the "Start-Button". Note that the toolbarcombobox for Platform Configuration now lists both "x86" and "AnyCPU" and has"x86" selected

  • Software |Seite 30

    4.3.4. Integration of the delib.pas in Delphi

    Description of the "delib.pas" integration in Delphi

    You can find the needed files for Delphi in the directory C:\Programme\DEDITEC\DELIB\include\delib.pas.

    Start Delphi and open via menu "Projekt -> dem Projekt hinzufügen" the file "delib.pas" to import.

  • Software |Seite 31

    4.3.5. Integration of the delib.bas in Visual Basic

    Description of the "delib.bas" integration in Visual Basic

    You can find the needed files for VB in the directory C:\Programme\DEDITEC\DELIB\include\delib.bas.

    Start Visual Basic and open via menu "Projekt -> Datei hinzufügen..." the file"delibi.bas" to import.

  • Software |Seite 32

    4.3.6. Integration of the delib.vb in VB.NET

    Description of the DELIB integration in VB.NET

    You can find the needed files for VB.NET in the directory C:\Programme\DEDITEC\DELIB\Include\delib.vb. Start VB.NET and open via menu"Projekt -> Vorhandes Element hinzufügen" in the directory C:\Programme\DEDITEC\DELIB\Include\ the file "delib.vb" to import.

  • Software |Seite 33

    4.3.7. Integration of the delib.bas in MS-Office (VBA)

    Description of the "delib.bas" integration in Visual Basic for Applications

    You can find the needed files for VBA in the directory C:\Programme\DEDITEC\DELIB\include\delib.bas.

    Start Microsoft Excel and open via menu "Extras -> Makro -> Visual Basic Editor".

  • Software |Seite 34

    Creation of UserForm

    Create a new UserForm via menu "Einfügen -> UserForm". In the top left-handcorner of the project manager right click on "UserForm -> Datei importieren". Openin the directory C:\Programme\DEDITEC\DELIB\include the file "delib.bas" toimport.

  • Software |Seite 35

    4.3.8. Integration of the delib.dll in LabVIEW

    4.3.8.1. Integration of the delib.dll in LabVIEW

    The LabVIEW-Sampleprogram "Deditec_Modul_Control.vi" is not a EXE-File andyou need to execute this file the LabVIEW development environment.

    Description of the delib.dll integration in LabVIEW Version 11

    - You can find the needed files for LabVIEW in the directorys

    "C:\Windows\System32\delib.dll" and "C:\Programme\DEDITEC\DELIB\include\ delib.h"

    - Start LabVIEW and open the menu "Tools -> Import -> DLL ..."

  • Software |Seite 36

    - Choose the option "create VIs for DLL" and press continue

  • Software |Seite 37

    - In the next window, choose the path to the delib.h and delib.dll and press continue

  • Software |Seite 38

    - Press continue again

    - The Header-File will now be analized. Afterwards press continue.

  • Software |Seite 39

    - Follow the instructions and configurate the name and the saving location for theVIs.

  • Software |Seite 40

    - In the new window choose "Easy error correction" in the drop-down menu andpress continue.

  • Software |Seite 41

    - VIs which are working with 64-bit values must be edited. The display must bechanged from "unsigned long" to "unsigned quad".

    - The following VIs must be edited:

    -> DapiCNT48CounterGet48 (function return)

    -> DapiDIGet64 (function return)

    -> DapiDOSet64 (data)

    -> DapiDOReadBack64 (function return)

  • Software |Seite 42

    - In addition for some VIs you need to change the elementype to "numeric".

    - The following VIs must be edited:

    -> DapiWriteLongLong (value)

    -> DapiReadLongLong (function return)

    - Afterwards press continue.

  • Software |Seite 43

    - You recive a summary of the executed steps.

    - Press continue

    - The VIs will now be created and are ready to use.

  • Software |Seite 44

    4.3.8.2. Usage of the VIs in LabVIEW

    Some functions of the DELIB-library are expecting a string as a parameter value.

    This example shows how to use such functions in LabVIEW.

    We will use the A/D converter function which is used to set the voltage range as anexample.

    The definition of this function is:void DapiADSetMode(ULONG handle, ULONG ch, ULONG mode);

    The voltage ranges for this function are already defined in the DELIB-library.

    Example code in C/C++:DapiADSetMode(handle, 0, ADDA_MODE_UNIPOL_5V);

    This code can also be written like this:DapiADSetMode(handle, 0, 1);

    In the delib.h file can you read the hexadecimal values to determine the modes.The hex values must be convertet to decimal.

    After the installation of the DELIB-library, the delib.h file is located in the followingdirectory: C:\Programs\Deditec\DELIB\Include\delib.h

  • Software |Seite 45

    The function could look like this in LabVIEW:

    The channel and mode are passed as unsigned long

  • Software |Seite 46

    4.4. DELIB CLI (command-line interface)

    In some programming languages (like PHP), you can't include DLLs, therefore isan extra console command, which you can directly call out of the program (withappropriate parameters). You can find this command after installation of the DELIBdriverlibrary in the directory C:\Programme\DEDITEC\DELIB\Programs\Console.

    You can find the DELIB CLI Command for Windows after Installation of the DELIBdriverlibrary in the directory C:\Programme\DEDITEC\DELIB\programs\cli\ .

    The DELIB CLI Command for Linux is located in the directory "/deditec-cli/, afterunzipping the ZIP-Archiv "delib-linux-cli".

    Definition (Windows)

    delib_cli command channel [value | unit ["nounit"] ]

    Definition for USB-Module (Linux)

    sudo delib-cli-usb command channel [value | unit ["nounit"] ]

    Definition for RO-ETH-Module (Linux)

    delib-cli-eth command channel [value | unit ["nounit"] ]

    Note: The parameters are separated by spaces.

    These commands and parameters are not case sensitive.

    Parameter

    command channel value unit nounit

    di1 0, 1, 2, ...

    - hex nounitdi8

    0, 8, 16, ...di16

    di24

    do1 0, 1, 2, ... 0/1 (1-bit command)

    - -do8

    0, 8, 16, ...8-bit value

    (Bit 0 for channel 1, Bit1 for channel 2, ...)do16 16-bit value

    do24 24-bit value

    ai 0, 1, 2, ... - hex, volt, mA nounit

    ao 0, 1, 2, ...

    integer or hexadecimal number

    (starting with 0x).

    For an integer a V for Volt, mA formilli Ampere can be attached.

    - -

  • Software |Seite 47

    Return-value

    Read state of the inputs (in combination with command = di, di8, di16, di32 andai).

    Read state of the inputs as hexadecimal (in combination with command = di, di8,di16, di32 and ai and unit "hex")

    Voltage of the input (in combination with unit "volt" and command "ai")

    Current of the input (in combination with unit "mA" and command "ai")

  • Software |Seite 48

    4.4.1. Customisation for USB-Modules (only Linux)

    In order to access the right module under Linux via DELIB CLI, you have to set themodule id at the command "DapiOpenModule". Therefore you can find in thedirectory "/deditec-cli/source" the file "delib_cli_open_module_usb.c" afterunzipping the ZIP archive.

    By default, the program "delib-cli-usb" (see source code) tries to open a RO-USBmodule. If the module is not found, it will try to open an USB-Mini-Stick, and so on...

    Since this causes unnecessary error-messages, you can simply remark notneeded entries.

    #include "../../delib-sources/delib/delib.h"

    ULONG handle;

    ULONG delib_cli_open_module(){

    handle = DapiOpenModule(RO_USB, 0);if(handle==0){

    handle = DapiOpenModule(USB_MINI_STICK, 0);}if(handle==0){

    handle = DapiOpenModule(USB_RELAIS_8, 0);}if(handle==0){

    handle = DapiOpenModule(USB_OPTOIN_8_RELAIS_8, 0);}if(handle==0){

    handle = DapiOpenModule(USB_OPTOIN_16_RELAIS_16, 0);}if(handle==0){

    handle = DapiOpenModule(USB_OPTOIN_32_RELAIS_32, 0);}

    return handle;}

    Note:

    The project "delib-cli-usb" has to recompiled after each modification. Therefore,you can find in the directory "/deditec-cli/", the shell script "compile_delib_cli_usb.sh", with which you can compile the project under Linux.

  • Software |Seite 49

    4.4.2. Customisation for RO-ETH-Modules (only Linux)

    In order to access a RO-ETH module under Linux, you have to set IP address of themodule. Therefore you can find in the directory "/deditec-cli/source" the file"delib_cli_open_module_eth.c" after unzipping the ZIP archive.

    You have to modify following entry:

    #include "../../delib-sources/delib/delib.h"

    extern char global_ip_addr[];ULONG handle;

    ULONG delib_cli_open_module(){

    sprintf(global_ip_addr, "192.168.1.11"); // Set the IP address of the RO-ETHmodule here

    handle = DapiOpenModule(RO_ETH,0);

    return handle;}

    Note:

    The project "delib-cli-eth" has to recompiled after each modification. Therefore,you can find in the directory "/deditec-cli/", the shell script "compile_delib_cli_eth.sh", with which you can compile the project under Linux.

  • Software |Seite 50

    4.4.3. DELIB CLI samples

    Digital Outputs

    Windowsdelib_cli DO1 17 1-> digital output 18 will be switched on

    delib_cli DO1 3 0-> digital output 4 will be switched on

    delib_cli DO8 0 255-> digital outputs 1-8 will be switched on

    delib_cli DO16 0 0-> digital outputs 1-16 will be switched off

    delib_cli DO16 16 65535-> digital outputs 17-32 will be switched on

    delib_cli DO32 0 4294967295-> digital outputs 1-32 will be switched on

    Linuxsudo delib_cli _usb DO1 17 1-> digital output 18 of an USB-Module will be switched on

    delib_cli _eth DO1 3 0-> digital output 18 of a RO-ETH-Module will be switched off

  • Software |Seite 51

    Digitale Inputs

    Windowsdelib_cli DI1 3Example of a return value: 1 -> reads the state of digital input 4

    delib_cli DI8 0 hexExample of a return value: 0xFF-> reads the state of digital input 4 as hexadecimal

    delib_cli DI16 0 hexExample of a return value: 0xFFFF-> reads the state of digital inputs 1-16 as hexadecimal

    delib_cli DI32 0 hexExample of a return value: 0xFFFFFFFF-> reads the state of digital inputs 1-32 as hexadecimal

    Alternatively you can append the argument "nounit"delib_cli DI8 0 hex nounitExample of a return value: FF-> reads the state of digital inputs 1-8 as hexadecimal

    Linuxsudo delib_cli _usb DI1 3Example of a return value: 1-> reads the state of digital input 4 of an USB-Module

    delib_cli_eth DI8 0 hexExample of a return value: 0xFF-> reads the state of digital input 1-8 of a RO-ETH-Module as hexadecimal

  • Software |Seite 52

    Analog Outputs

    Windowsdelib_cli AO 7 4711->analog output 8 will be set to the decimal value 4711

    delib_cli AO 6 0x4711->analog output 7 will be set to the hexadecimal value 0x4711

    delib_cli AO 7 3.7V-> the voltage of analog output 8 will be set to 3,7 Volt (the comma "," and the dot "." can be used for decimal separation)

    delib_cli AO 7 13.3mA-> the current of analog output 8 will be set to 13,3 mA (the comma "," and the dot "." can be used for decimal separation)

    Linuxsudo delib_cli_usb AO 7 4711-> analog output 8 of an USB-Module will be set to the decimal value 4711

    delib_cli_eth AO 6 0x4711-> analog output 7 of a RO-ETH-Module will be set to the hexadecimal value 0x4711

  • Software |Seite 53

    Analog Inputs

    Windowsdelib_cli AI 2Example of a return value: 1234-> reads the value of analog input 3 as decimal

    delib_cli AI 2 hexExample of a return value: 0x1FA-> reads the value of analog input 3 as hexadecimal

    delib_cli AI 2 VExample of a return value: 12.500000V-> reads the voltage of analog input 3 as point number

    delib_cli AI 2 mAExample of a return value: 20.551600mA-> reads the current of analog input 3 as point number

    Alternatively you can append the argument "nounit"

    delib_cli AI 3 hex nounitExample of a return value: 1FA-> reads the value of analog input 4 as hexadecimal

    delib_cli AI 3 V nounitExample of a return value: 12.500000-> reads the voltage of analog input 4 as point number

    delib_cli AI 3 mA nounitExample of a return value: 20.551600-> reads the current of analog input 4 as point number

    Linuxsudo delib_cli_usb AI 2Example of a return value: 1234-> reads the value of analog input 3 of an USB-Module as decimal

    delib_cli_eth AI 2 hexExample of a return value: 0x1FA-> reads the value of analog input 3 of an RO-ETH-Module as hexadecimal

  • V

    Example program |Seite 54

    Example program

  • Example program |Seite 55

    5. Example program

    // ****************************************************************************// ****************************************************************************// ****************************************************************************// ****************************************************************************// ****************************************************************************//// (c) DEDITEC GmbH, 2009//// web: http://www.deditec.de//// mail: [email protected]//////// dtapi_prog_beispiel_input_output.cpp////// ****************************************************************************// ****************************************************************************// ****************************************************************************// ****************************************************************************// ****************************************************************************////// Folgende Bibliotheken beim Linken mit einbinden: delib.lib// Dies bitte in den Projekteinstellungen (Projekt/Einstellungen/Linker(Objekt-Bibliothek-Module) .. letzter Eintrag konfigurieren#include #include #include "conio.h"#include "delib.h"// ----------------------------------------------------------------------------// ----------------------------------------------------------------------------// ----------------------------------------------------------------------------// ----------------------------------------------------------------------------// ----------------------------------------------------------------------------

    void main(void){unsigned long handle;unsigned long data;unsigned long anz;unsigned long i;unsigned long chan;// ----------------------------------------------------// USB-Modul öffnenhandle = DapiOpenModule(USB_Interface8,0);printf("USB_Interface8 handle = %x\n", handle);if (handle==0){// USB Modul wurde nicht gefundenprintf("Modul konnte nicht geöffnet werden\n");printf("TASTE für weiter\n");getch();

  • Example program |Seite 56

    return;}// Zum Testen - ein Ping senden// ----------------------------------------------------printf("PING\n");anz=10;for(i=0;i!=anz;++i){data=DapiPing(handle, i);if(i==data){// OKprintf(".");}else{// No answerprintf("E");}}printf("\n");

    // ----------------------------------------------------// Einen Wert auf die Ausgänge schreibendata = 255;DapiWriteByte(handle, 0, data);printf("Schreibe auf Adresse=0 daten=0x%x\n", data);// ----------------------------------------------------// Einen Wert auf die Ausgänge schreibendata = 255;DapiWriteByte(handle, 1, data);printf("Schreibe auf Adresse=0 daten=0x%x\n", data);// ----------------------------------------------------// Einen Wert auf die Ausgänge schreibendata = 255;DapiWriteByte(handle, 2, data);printf("Schreibe auf Adresse=2 daten=0x%x\n", data);// ----------------------------------------------------// Einen Wert von den Eingängen lesendata = (unsigned long) DapiReadByte(handle, 0);printf("Gelesene Daten = 0x%x\n", data);// ----------------------------------------------------// Einen A/D Wert lesenchan=11; // read chan. 11data = DapiReadWord(handle, 0xff010000 + chan*2);printf("Adress=%x, ret=%x volt=%f\n", chan, data, ((float) data) / 1024*5);//Bei 5 Volt Ref// ----------------------------------------------------// Modul wieder schliessenDapiCloseModule(handle);printf("TASTE für weiter\n");getch();return ;}

  • VI

    Appendix |Seite 57

    Appendix

  • Appendix |Seite 58

    6. Appendix

    6.1. Revisions

    Rev 1.00 First issue

    Rev 2.00 Design change

    Rev 2.01 Added chapters "Firmware update" and

    "Integration of the DELIB"

    Rev 2.02 Index added

  • Appendix |Seite 59

    6.2. Copyrights and trademarks

    Linux is registered trade-mark of Linus Torvalds.

    Windows CE is registered trade-mark of Microsoft Corporation.

    USB is registered trade-mark of USB Implementers Forum Inc.

    LabVIEW is registered trade-mark of National Instruments.

    Intel is registered trade-mark of Intel Corporation

    AMD is registered trade-mark of Advanced Micro Devices, Inc.

    IntroductionGeneral remarksCustomer satisfactionCustomer response

    Hardware DescriptionBit Pattern GeneratorOutput Cable

    Firmware updateDEDITEC Flasher

    SoftwareUsing our productsAccess via graphical applicationsAccess via the DELIB driver libraryAccess via protocolAccess via provided test programs

    DELIB driver libraryOverviewProgram under diverse operating systemsProgram with diverse programming languagesProgram independent of the interfaceSDK-Kit for Programmer

    Supported operating systemsSupported programming languagesInstallation DELIB driver libraryDELIB Configuration Utility

    Integration of the DELIBIntegration of the delib.h in Visual-C/C++Integration of the delib.cs in Visual-C#Integration of the delib.cs in Visual-C# unter Windows 64bitIntegration of the delib.pas in DelphiIntegration of the delib.bas in Visual BasicIntegration of the delib.vb in VB.NETIntegration of the delib.bas in MS-Office (VBA)Integration of the delib.dll in LabVIEWIntegration of the delib.dll in LabVIEWUsage of the VIs in LabVIEW

    DELIB CLI (command-line interface)Customisation for USB-Modules (only Linux)Customisation for RO-ETH-Modules (only Linux)DELIB CLI samples

    Example programAppendixRevisionsCopyrights and trademarks