USB-TTL-32 / USB-TTL-64 Hardware-Description 2011 November
INDEX 1. Introduction 6 1.1. General remarks 6 1.2. Customer satisfaction 6 1.3. Customer response 6 2. Hardware description 8 2.1. Introduction 8 2.2. Quick installation 9 2.2.1. Step 1 - Installation of the software and driver 2.2.2. Step 2 - Connecting of the module 2.2.3. Step 3 - Testing the connection and the module 9 9 9 2.3. Technical data 10 2.4. Overview screens 11 2.4.1. Overview screen USB-TTL-32 2.4.2. Overview screen USB-TTL-64 2.5. Block diagram 2.5.1.
INDEX 3.2. DELIB driver library 21 3.2.1. Overview 21 3.2.1.1. Program under diverse operating systems 21 3.2.1.2. Program with diverse programming languages 22 3.2.1.3. Program independent of the interface 22 3.2.1.4. SDK-Kit for Programmer 22 3.2.2. Supported operating systems 3.2.3. Supported programming languages 3.2.4. Installation DELIB driver library 3.2.5. DELIB Configuration Utility 3.3. Test programs 3.3.1. Digital Input-Output Demo 4. DELIB API reference 4.1. Management functions 4.
INDEX 4.5.1. DapiDOSet1 4.5.2. DapiDOSet8 4.5.3. DapiDOSet16 4.5.4. DapiDOSet32 4.5.5. DapiDOSet64 4.5.6. DapiDOReadback32 4.5.7. DapiDOReadback64 4.6. Example program 5. Appendix 46 47 48 49 50 51 52 53 57 5.1. Revisions 57 5.2.
Introduction I Introduction | Seite 5
1. Introduction 1.1. General remarks First of all, we would like to congratulate you to the purchase of a high quality DEDITEC product. Our products are being developed by our engineers according to quality requirements of high standard. Already during design and development we take care that our products have -besides quality- a long availability and an optimal flexibility. Modular design The modular design of our products reduces the time and the cost of development.
Hardware description II Hardware description | Seite 7
2. Hardware description 2.1. Introduction The USB-OPTOIN-X-RELAIS-X modules provide relays with a maximum switching voltage of 36V DC (max. 1A, 15 watts) and Opto-in inputs, which are suitable for industrial applications for registration of status or even to count the changes of state of the inputs. Our USB modules have been developed for industrial applications for measurement, control and regulation. The modules all feature a USB interface and can therefore be connected to PC systems with USB bus.
2.2. Quick installation 2.2.1. Step 1 - Installation of the software and driver Now install the driver DELIB library with the file "delib_install.exe" from the supplied DEDITEC-Driver CD. These can be found in the "\zip\DELIB\delib_install.exe" on the DEDITEC-Driver CD. Note: On our website www.deditec.de you can always find the latest DELIB driver version. 2.2.2. Step 2 - Connecting of the module Connect your PC via USB cable to the USB connector of the module.
2.3. Technical data USB-Interface (USB 1.1 / USB 2.0) 5V from the USB bus TTL Pegel 5V to 1,3V TTL-I/O (in 8-way blocks adjustable as input or output) Activity-LED Power (Indicates that the module is in operation) IO-Access (Indicates the access to the TTL-I/O) USB-Activity (Indicates that a signal processing via the USB bus is taking place) Operating temperature 10°C..
2.4. Overview screens 2.4.1.
2.4.2.
2.5. Block diagram 2.5.1.
2.5.2.
2.6. Configuration of the voltage level of TTL-I/O's TTL level of 1.8 V to 5 V: By default, you can select the TTL level of 3.3 V or 5V via jumper. If you remove the jumper on the module, you can apply your own voltage between 1.8 V to 5 V to the TTL-I/O module, so the possibilities of the modules were significantly increased. If you want to apply your own voltage, this is done via the VIN pin see chapter Pin assignment. The TTL-I/O's of the module can be configured in a 16 blocks.
2.7. Pin assignment 2.7.1.
2.7.2. J2 - Pin assignment USB-TTL-I/O 32-63 Port 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 Pin I/O 48 I/O 50 I/O 52 I/O 54 I/O 56 I/O 58 I/O 60 I/O 62 I/O 32 I/O 34 I/O 36 I/O 38 I/O 40 I/O 42 I/O 44 I/O 46 VIN 32-47 GND GND Port 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 Pin I/O 49 I/O 51 I/O 53 I/O 55 I/O 57 I/O 59 I/O 61 I/O 63 I/O 33 I/O 35 I/O 37 I/O 39 I/O 41 I/O 43 I/O 45 I/O 47 VIN 48-63 GND Note: The VIN pin is used to apply your own voltage to the I/O's of the module.
Software III Software | Seite 18
3. Software 3.1. Using our products 3.1.1. Access via graphical applications We provide driverinterfaces e.g. for LabVIEW and ProfiLab. The DELIB driver library is the basis, which can be directly activated by ProfiLAB. For LabVIEW, we provide a simple driver connection with examples! 3.1.2. Access via the DELIB driver library In the appendix, you can find the complete function reference for the integration of our API-functions in your software.
3.1.4. Access via provided test programs We provide simple handling test programs for the most important functions of our products. These will be installed automatically by the installation of the DELIB driver library. So you can test directly e.g. relays or you can check the voltage of an A/D converter.
3.2. DELIB driver library 3.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 with particular consideration of the following viewpoints: Independent of operating system Independent of programming language Independent of the product 3.2.1.1. Program under diverse operating systems The DELIB driver library allows an uniform response of our products on diverse operating systems.
3.2.1.2. Program with diverse programming languages We provide uniform commands to create own applications. This will be solved by the DELIB driver library. You choose the programming language! It can be simply developed applications under C++, C, Visual Basic, Delphi or LabVIEW®. 3.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 an ethernet or RS-232 product of us ! 3.2.1.4.
3.2.2. Supported operating systems Our products support the following operating systems: Windows 7 Windows Vista Windows XP Windows 2000 Linux 3.2.3. Supported programming languages Our products are responsive via the following programming languages: C C++ C# Delphi VisualBasic VB.
3.2.4. Installation DELIB driver library Our DELIB installer start screen. Insert the DEDITEC driver CD into the drive and start „delib_install.exe“. The DELIB driver library is also available on http://www.deditec.
Click on „Install“.
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 next chapter). This is only necessary, if more than one module is present.
3.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 subdivide identical USB-modules in the system. This is only necessary if more than one module is present.
3.3. Test programs 3.3.1. Digital Input-Output Demo Start “Digital Input-Output Demo” as follows: Start Programme DEDITEC DELIB Digital Input-Output Demo. The screenshot shows a test of the RO-USB-O64-R64. The configuration of the module (64 inputs and 64 outputs) is shown on the upper left side.
DELIB API reference IV DELIB API reference | Seite 30
4. DELIB API reference 4.1. Management functions 4.1.1. DapiOpenModule Description This function opens a particular module. Definition ULONG DapiOpenModule(ULONG moduleID, ULONG nr); Parameters moduleID=Specifies the module, which is to be opened (see delib.h) nr=Indicates No of module which is to be opened. nr=0 -> 1. module nr=1 -> 2.
4.1.2. DapiCloseModule Description This command closes an opened module.
4.1.3. DapiGetDELIBVersion Description This function returns the installed DELIB version. Definition ULONG DapiGetDELIBVersion(ULONG mode, ULONG par); Parameters mode=Mode, with which the version is readout (must be 0). par=This parameter is not defined (must be 0). Return value version=Version number of the installed DELIB version [hex]. Example program version = DapiGetDELIBVersion(0, 0); //Bei installierter Version 1.
4.1.4. DapiSpecialCMDGetModuleConfig Description This command returns the hardware equipment (number of in-/output channels) of the module. Definition ULONG DapiSpecialCommand(ULONG handle, DAPI_SPECIAL_CMD_GET_MODULE_CONFIG, par, 0, 0); Parameters handle=This is the handle of an open module.
Return value Get number of digital input channels return=Number of digital input channels Get number of digital output channels return=Number of digital output channels Get number of digital in-/output channels return=Number of digital in-/output channels Get number of analog input channels return=Number of analog input channels Get number of analog output channels return=Number of analog output channels Get number of stepper channels return=Number of stepper channels Example program ret=DapiSpecialCommand(
4.2. Error handling 4.2.1. DapiGetLastError Description This function returns the last registered error. Definition ULONG DapiGetLastError(); Parameters None Return value Error code 0=no error. (see delib.
4.2.2. DapiGetLastErrorText Description This function reads the text of the last registered error.
4.3. Set TTL-In-/Outputs direction 4.3.1. DAPI_SPECIAL_CMD_SET_DIR_DX_8 Description This command sets the direction of the TTL-In/Outputs (8-Bit way). Definition void DapiSpecialCommand(ULONG handle, DAPI_SPECIAL_CMD_SET_DIR_DX_8, ULONG ch, ULONG dir, 0); Parameters handle=This is the handle of an opened module. ch=Specifies the number of the output,from which the direction will be set (0, 8, 16, 24 ..). Values between are invalid. dir=(8-Bit) gives the direction for 8 In/Outputs.
4.4. Reading Digital inputs 4.4.1. DapiDIGet1 Description This command reads a single digit input. Definition ULONG DapiDIGet1(ULONG handle, ULONG ch); Parameters handle=This is the handle of an opened module. ch=Specifies the number of input that is to be read (0 ..). Return value State of the input (0 / 1).
4.4.2. DapiDIGet8 Description This command reads 8 digital inputs simultaneously. Definition ULONG DapiDIGet8(ULONG handle, ULONG ch); Parameters handle=This is the handle of an opened module. ch=Specifies the number of the input, from which it begins to read from (0, 8, 16, 24, 32, ..) Return value State of the read inputs.
4.4.3. DapiDIGet16 Description This command reads 16 digital inputs simultaneously. Definition ULONG DapiDIGet16(ULONG handle, ULONG ch); Parameters handle=This is the handle of an opened module. ch=Specifies the number of the input, from which it begins to read from (0, 16, 32, ..) Return value State of the read inputs.
4.4.4. DapiDIGet32 Description This command reads 32 digital inputs simultaneously. Definition ULONG DapiDIGet32(ULONG handle, ULONG ch); Parameters handle=This is the handle of an opened module. ch=Specifies the number of the input, from which it begins to read from (0, 32, 64, ..) Return value State of the read inputs.
4.4.5. DapiDIGet64 Description This command reads 64 digital inputs simultaneously. Definition ULONGLONG DapiDIGet64(ULONG handle, ULONG ch); Parameters handle=This is the handle of an opened module. ch=Specifies the number of the input,from which it begins to read from (0, 64, ..) Return value State of the read inputs.
4.4.6. DapiDIGetFF32 Description This command reads the flip-flops from the inputs and resets them. (Input state change). Definition ULONG DapiDIGetFF32(ULONG handle, ULONG ch); Parameters handle=This is the handle of an opened module . ch=Specifies the number of the input, from which it begins to read from (0, 32, ..
4.4.7. DapiDIGetCounter Description This command reads the counter of a digital input Definition ULONG DapiDIGetCounter(ULONG handle, ULONG ch, ULONG mode); Parameters handle=This is the handle of an opened module. ch=Specifies the digital input,from which the counter will be read. mode=0 (Normal counter function) mode=DAPI_CNT_MODE_READ_WITH_RESET (Reading and resetting the counter) mode=DAPI_CNT_MODE_READ_LATCHED (Reading the latched counter) Return value Value of the counter.
4.5. Setting Digital outputs 4.5.1. DapiDOSet1 Description This is the command to set a single output. Definition void DapiDOSet1(ULONG handle, ULONG ch, ULONG data); Parameters handle=This is the handle of an opened module ch=Specifies the number of the output to be set to (0 ..
4.5.2. DapiDOSet8 Description This command sets 8 digital outputs simultaneously. Definition void DapiDOSet8(ULONG handle, ULONG ch, ULONG data); Parameters handle=This is the handle of an opened module ch=Specifies the number of the output, from which it begins to write to (0, 8, 16, 24, 32, ..
4.5.3. DapiDOSet16 Description This command sets 16 digital outputs simultaneously. Definition void DapiDOSet16(ULONG handle, ULONG ch, ULONG data); Parameters handle=This is the handle of an opened module ch=Specifies the number of the output, from which it begins to write to (0, 16, 32, ..
4.5.4. DapiDOSet32 Description This command sets 32 digital outputs simultaneously. Definition void DapiDOSet32(ULONG handle, ULONG ch, ULONG data); Parameters handle=This is the handle of an opened module ch=Specifies the number of the output, from which it begins to write to (0, 32, 64, ..
4.5.5. DapiDOSet64 Description This command is to set 64 digital outputs. Definition void DapiDOSet64(ULONG handle, ULONG ch, ULONG data); Parameters handle=This is the handle of an opened module ch=Specifies the number of the output, from which it begins to write to (0, 64, ..
4.5.6. DapiDOReadback32 Description This command reads back the 32 digital outputs. Definition ULONG DapiDOReadback32(ULONG handle, ULONG ch); Parameters handle=This is the handle of an opened module ch=Specifies the number of the input, from which it begins to read from (0, 32, ..) Return value Status of 32 outputs.
4.5.7. DapiDOReadback64 Description This command reads back the 64 digital outputs. Definition ULONGLONG DapiDOReadback64(ULONG handle, ULONG ch); Parameters handle=This is the handle of an opened module ch=Specifies the number of the input, from which it begins to read from (0, 64, ..) Return value Status of 64 outputs.
4.6.
DapiClearLastError(); return TRUE; } return FALSE; } //*************************************************************************** //*************************************************************************** //*************************************************************************** //*************************************************************************** //*************************************************************************** void main(void) { unsigned long handle; unsigned long data; // ------
printf("Value of inputs 0-7 = %d\n", data); printf("Press any key to continue\n"); getch(); // ------------------------------------------------------------------// Switch i/o to outputs DapiSpecialCommand(handle, DAPI_SPECIAL_CMD_SET_DIR_DX_8, 0, 255, 0); IsError(); printf("Channel 0-7 has been set to outputs\n"); printf("Press any key to continue\n"); getch(); // ------------------------------------------------------------------// Write values to outputs 0-7 DapiDOSet8(handle, 0, 0xf0); IsError(); printf("
Appendix V Appendix | Seite 56
5. Appendix 5.1. Revisions Rev 2.
5.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.