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
2.3. Technical data10
2.4. Overview screen11
2.4.1. Overview screen USB-OPTOIN-8-RELAIS-8
2.4.2. Overview screen USB-OPTOIN-16-RELAIS-16
2.4.3. Overview screen USB-OPTOIN-32-RELAIS-32
2.4.4. Overview screen USB-OPTOIN-32
2.4.5. Overview screen USB-RELAIS-32
2.4.6. Overview screen USB-OPTOIN-64
2.4.7. Overview screen USB-RELAIS-64
11
12
13
14
15
16
17
2.5. Pin assignment18
2.5.1. Pin assignment output channels
2.5.2. Pin assignment input channels
18
19
2.6. J2 - Configuration of the power supply20
9
9
9
2.7. Outputs21
2.7.1. Relais outputs
2.7.2. Timeout-protection
2.7.3. Visual control of the outputs
21
21
21
2.8. Inputs22
Index |2Seite
INDEX
2.8.1. Registering short input pulses
2.8.2. Galvanically decouppled through optocouplers
2.8.3. Visual control of the inputs
22
22
22
3. Software24
3.1. Using our products24
3.1.1. Access via graphical applications
3.1.2. Access via the DELIB driver library
3.1.3. Access via protocol
3.1.4. Access via provided test programs
3.2. DELIB driver library26
3.2.1. Overview
3.2.1.1. Program under diverse operating systems
3.2.1.2. Program with diverse programming languages
3.2.1.3. Program independent of the interface
3.2.1.4. SDK-Kit for Programmer
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 programs34
24
24
24
25
26
26
27
27
27
28
28
29
33
3.3.1. Digital Input-Output Demo
34
4. DELIB API reference36
4.1. Management functions36
4.1.1. DapiOpenModule
4.1.2. DapiCloseModule
4.1.3. DapiGetDELIBVersion
4.1.4. DapiSpecialCMDGetModuleConfig
36
37
38
39
4.2. Error handling41
4.2.1. DapiGetLastError
4.2.2. DapiGetLastErrorText
41
42
4.3. Reading Digital inputs43
4.3.1. DapiDIGet1
4.3.2. DapiDIGet8
43
44
Index |3Seite
INDEX
4.3.3. DapiDIGet16
4.3.4. DapiDIGet32
4.3.5. DapiDIGet64
4.3.6. DapiDIGetFF32
4.3.7. DapiDIGetCounter
45
46
47
48
49
4.4. Setting Digital outputs50
4.4.1. DapiDOSet1
4.4.2. DapiDOSet8
4.4.3. DapiDOSet16
4.4.4. DapiDOSet32
4.4.5. DapiDOSet64
4.4.6. DapiDOReadback32
4.4.7. DapiDOReadback64
50
51
52
53
54
55
56
4.5. Setting Output-timeouts57
4.5.1. DapiSpecialCMDTimeout
4.5.2. DapiSpecialCMDTimeoutGetStatus
57
58
4.6. Example program59
5. Appendix64
5.1. Revisions64
5.2. Copyrights and trademarks65
Index |4Seite
Introduction
I
Introduction |Seite5
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.
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 module
instead 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 customer
satisfaction is in first place for us.
If by any chance, you are not content with the performance of our product, please
contact 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 we
are thankful for comments and suggestions.
Introduction |Seite6
Hardware description
II
Hardware description |Seite7
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. The USB bus has been
used successfully for many years in use and is characterized by its high flexibility.
As terminal block, user-friendly terminal strips with locking protection and ejection
mechanism are used. They allow quick replugging . The wire connection itself is
realised with a screwless connector system. A tool is included with each module.
Hardware description |Seite8
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.
After about 20 seconds, the module is detected by the driver and can now be
tested and operated.
2.2.3. Step 3 - Testing the connection and the module
In the Start menu, see "Start -> All Programs -> DEDITEC -> DELIB -> Sample
Programs" you will find some example programs to test your module.
Hardware description |Seite9
2.3. Technical data
Product
Inputs
Outputs
Length x width x height in mm
USB-OPTOIN-8-RELAIS-8
88102,5 x 105 x 74,5
USB-OPTOIN-16-RELAIS-16
16
16
125 x 105 x 74,5
USB-OPTOIN-32
32
-
USB-RELAIS-32
-
32
USB-OPTOIN-32-RELAIS-32
32
32
230 x 105 x 74,5
USB-OPTOIN-64
64
-
USB-RELAIS-64
-
64
USB-Interface (USB 1.1 / USB 2.0)
Power supply: +5V (supply occurs over USB bus)
8/16/32/64 opto-coupler inputs (depending on module)
Variable input voltage range min 5V, max 30V AC (standard: 15-30V)
Galvanically isolated using opto-couplers
Logging of impulses between 2 read out cycles
8/16/32/64 Relay outputs (depending on module)(36V, 1A, 15W, Closer-relay)
Timeout protection
Galvanically isolated using relays
Operating temperature: 10°C .. 50°C
Product specific data:
Hardware description |Seite10
2.4. Overview screen
2.4.1. Overview screen USB-OPTOIN-8-RELAIS-8
Hardware description |Seite11
2.4.2. Overview screen USB-OPTOIN-16-RELAIS-16
Hardware description |Seite12
2.4.3. Overview screen USB-OPTOIN-32-RELAIS-32
Hardware description |Seite13
2.4.4. Overview screen USB-OPTOIN-32
Hardware description |Seite14
2.4.5. Overview screen USB-RELAIS-32
Hardware description |Seite15
2.4.6. Overview screen USB-OPTOIN-64
Hardware description |Seite16
2.4.7. Overview screen USB-RELAIS-64
Hardware description |Seite17
2.5. Pin assignment
Pin
Description
1a
Output Channel 1
1b
Output Channel 1
2a
Output Channel 2
2b
Output Channel 2
3a
Output Channel 3
3b
Output Channel 3
4a
Output Channel 4
4b
Output Channel 4
5a
Output Channel 5
5b
Output Channel 5
6a
Output Channel 6
6b
Output Channel 6
7a
Output Channel 7
7b
Output Channel 7
8a
Output Channel 8
8b
Output Channel 8
2.5.1. Pin assignment output channels
Hardware description |Seite18
2.5.2. Pin assignment input channels
Pin
Description
1a
Input Channel 1
1b
Input Channel 1
2a
Input Channel 2
2b
Input Channel 2
3a
Input Channel 3
3b
Input Channel 3
4a
Input Channel 4
4b
Input Channel 4
5a
Input Channel 5
5b
Input Channel 5
6a
Input Channel 6
6b
Input Channel 6
7a
Input Channel 7
7b
Input Channel 7
8a
Input Channel 8
8b
Input Channel 8
Hardware description |Seite19
2.6. J2 - Configuration of the power supply
The configuration of the power supply via a jumper. (J2)
Supply via the USB bus (J3) of the module
Jumper pin 1 & 2
(+5V DC)
Supply from an external power supply (J1)
Jumper pin 2 & 3
(+7-24V DC)
Hardware description |Seite20
2.7. Outputs
2.7.1. Relais outputs
The relays are able to switch voltages up to 36V. The max. current is 1A at a max.
power of 15W.
Additionally, the relays provide a safe electrical isolation of the module to the
connected equipment.
2.7.2. Timeout-protection
The timeout-protection gives the possibility to switch-off automatically the outputs
to prevent damage. This takes place, if in a predefined time frame any
communication with the module was possible. Reasons could be cable disruption,
PC-crash and so on. This way damage control, surcharge of connected equipment
and risk of accidents can be avoided.
2.7.3. Visual control of the outputs
The state of each output is directly signalized by a separate LED. This simplifies to
detect and rectify wiring errors, because the signals on the cables are directly
observable.
Hardware description |Seite21
2.8. Inputs
2.8.1. Registering short input pulses
Schnelle Zustandswechsel an den Eingängen, die innerhalb von größeren
Auslesezyklen auftreten, werden durch eine zusätzliche Logik erfasst und können
separat per Software ausgelesen werden.
2.8.2. Galvanically decouppled through optocouplers
AC input opto-couplers provide a galvanic isolation of the module towards the
connected equipment. They also provide a safe connection to the module for
reverse currents and high voltage peaks.
2.8.3. Visual control of the inputs
The state of each input is directly signalized by a separate LED. This simplifies to
detect and rectify wiring errors, because the signals on the cables are directly
observable.
Hardware description |Seite22
Software
III
Software |Seite23
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. In addition we provide examples for the
following programming languages:
C
C++
C#
Delphi
VisualBasic
VB.NET
MS-Office
3.1.3. Access via protocol
The protocol for the activation of our products is open source. So you are able to
use our products on systems without Windows or Linux.
Software |Seite24
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.
Software |Seite25
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.
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 |Seite26
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. SDK-Kit for Programmer
Integrate the DELIB in your application. On demand you receive an installation
script for free, which allows you, to integrate the DELIB installation in your
application.
Software |Seite27
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.NET
MS-Office
Software |Seite28
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.en/delib
Software |Seite29
Click on „Install“.
Software |Seite30
The drivers will be installed.
Software |Seite31
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.
Software |Seite32
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.
Software |Seite33
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.
Software |Seite34
DELIB API reference
IV
DELIB API reference |Seite35
4. DELIB API reference
// USB-Modul öffnen
handle = DapiOpenModule(RO_USB1, 0);
printf("handle = %x\n", handle);
if (handle==0)
{
// USB Modul wurde nicht gefunden
printf("Modul konnte nicht geöffnet werden\n");
return;
}
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. module
Return value
handle=handle to the corresponding module
handle=0 -> Module was not found
Remarks
The handle returned by this function is needed to identify the module for all other
functions.
Example program
DELIB API reference |Seite36
4.1.2. DapiCloseModule
// Close the module
DapiCloseModule(handle);
Description
This command closes an opened module.
Definition
ULONG DapiCloseModule(ULONG handle);
Parameters
handle=This is the handle of an opened module
Return value
none
Example program
DELIB API reference |Seite37
4.1.3. DapiGetDELIBVersion
version = DapiGetDELIBVersion(0, 0);
//Bei installierter Version 1.32 ist version = 132(hex)
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
DELIB API reference |Seite38
4.1.4. DapiSpecialCMDGetModuleConfig
Description
This command returns the hardware equipment (number of in-/output channels) of
the module.
ret=DapiSpecialCommand(handle, DAPI_SPECIAL_CMD_GET_MODULE_CONFIG,
DAPI_SPECIAL_GET_MODULE_CONFIG_PAR_DI, 0, 0);
//Gibt die Anzahl der digitalen Eingangskanäle zurück
ret=DapiSpecialCommand(handle, DAPI_SPECIAL_CMD_GET_MODULE_CONFIG,
DAPI_SPECIAL_GET_MODULE_CONFIG_PAR_DO, 0, 0);
//Gibt die Anzahl der digitalen Ausgangskanäle zurück
ret=DapiSpecialCommand(handle, DAPI_SPECIAL_CMD_GET_MODULE_CONFIG,
DAPI_SPECIAL_GET_MODULE_CONFIG_PAR_DX, 0, 0);
//Gibt die Anzahl der digitalen Ein-/Ausgangskanäle zurück
ret=DapiSpecialCommand(handle, DAPI_SPECIAL_CMD_GET_MODULE_CONFIG,
DAPI_SPECIAL_GET_MODULE_CONFIG_PAR_AD, 0, 0);
//Gibt die Anzahl der analogen Eingangskanäle zurück
ret=DapiSpecialCommand(handle, DAPI_SPECIAL_CMD_GET_MODULE_CONFIG,
DAPI_SPECIAL_GET_MODULE_CONFIG_PAR_DA, 0, 0);
//Gibt die Anzahl der analogen Ausgangskanäle zurück
ret=DapiSpecialCommand(handle, DAPI_SPECIAL_CMD_GET_MODULE_CONFIG,
DAPI_SPECIAL_GET_MODULE_CONFIG_PAR_STEPPER, 0, 0);
//Gibt die Anzahl der Stepperkanäle zurück
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)
handle=This is the handle of an opened module
ch=Specifies the number of the output to be set to (0 ..)
data=Specifies the data value that is to be written (0 / 1)
Return value
None
DELIB API reference |Seite50
4.4.2. DapiDOSet8
Description
This command sets 8 digital outputs simultaneously.
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, ..)
data=Specifies the data values, to write to the outputs
Return value
None
DELIB API reference |Seite52
4.4.4. DapiDOSet32
// Einen Wert auf die Ausgänge schreiben
data = 0x0000ff00; // Ausgänge 9-16 werden auf 1 gesetzt
DapiDOSet32(handle, 0, data); // Chan Start = 0
printf("Schreibe auf Ausgänge Daten=0x%x\n", data);
printf("Taste für weiter\n");
getch();
// ---------------------------------------------------// Einen Wert auf die Ausgänge schreiben
data = 0x80000000; // Ausgang 32 wird auf 1 gesetzt
DapiDOSet32(handle, 0, data); // Chan Start = 0
printf("Schreibe auf Ausgänge Daten=0x%x\n", data);
printf("Taste für weiter\n");
getch();
// ---------------------------------------------------// Einen Wert auf die Ausgänge schreiben
data = 0x80000000; // Ausgang 64 wird auf 1 gesetzt
DapiDOSet32(handle, 32, data); // Chan Start = 32
printf("Schreibe auf Ausgänge Daten=0x%x\n", data);
printf("Taste für weiter\n");
getch();
Description
This command sets 32 digital outputs simultaneously.
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, ..)
data=Specifies the data values, to write to the outputs
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, ..)
data=Specifies the data values, to write to the outputs
Return value
None
DELIB API reference |Seite54
4.4.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, ..)
DAPI_SPECIAL_TIMEOUT_SET_VALUE_SEC, 5, 0);
IsError();
printf("Timeout has been set to 5 seconds\n");
printf("Press any key to continue\n");
getch();
// ---------------------------------------------------------// Activate timeout and switch on output channels 0-3
DapiSpecialCommand(handle, DAPI_SPECIAL_CMD_TIMEOUT,
DAPI_SPECIAL_TIMEOUT_ACTIVATE, 0, 0);
IsError();
DapiDOSet8(handle, 0, 15);
IsError();
printf("Timeout has been activated\n");
printf("Output channels 0-3 have been switched on and will be switched
off automatically after 5 seconds\n");
printf("Press any key to continue\n");
getch();