0% found this document useful (0 votes)
30 views311 pages

Manual e Canbox Serie

The document provides a comprehensive hardware description of the CAN Box series, including installation, commissioning, and technical specifications. It covers various aspects such as interfaces, digital outputs, and software integration with programming languages. Additionally, it includes detailed instructions for using the DELIB driver library and configuration tools for different operating systems.

Uploaded by

jaiteg4
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
30 views311 pages

Manual e Canbox Serie

The document provides a comprehensive hardware description of the CAN Box series, including installation, commissioning, and technical specifications. It covers various aspects such as interfaces, digital outputs, and software integration with programming languages. Additionally, it includes detailed instructions for using the DELIB driver library and configuration tools for different operating systems.

Uploaded by

jaiteg4
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 311

CAN Box series

Hardware description

2024 December
INDEX

1. Introduction 10
1.1. Foreword 11
1.2. Customer satisfaction 11
1.3. Customer response 11
1.4. Brief description 12
1.5. Scope of delivery 13
2. Commercial data 14
2.1. Product versions 15
3. Commissioning 16
3.1. Step 1 - Safety instructions 17
3.2. Step 2 - Installing the software and drivers 18
3.3. Step 3 - Connecting the power supply 23
3.4. Step 4 - Connect to the PC or network 24
3.4.1. Connection via USB 24

3.5. Step 5 - Function test 24


4. Hardware description 25
4.1. General technical data 26
4.1.1. CAN-IO-BOX 26

4.2. Interfaces 27
4.2.1. USB 27
4.2.2. CAN 27
4.2.3. Pin assignment J3 27

4.3. LEDs 29
4.3.1. Definition of the LEDs 29
4.3.2. Flashing behavior of the LEDs 30

4.4. Block diagram 31


4.5. Digital outputs 32

Index | Seite 2
INDEX

4.5.1. Relais 32
4.5.1.1. Technical data 32

4.5.1.2. Pin assignment J1 33

4.5.1.3. Pin assignment J2 34

4.5.1.4. Relay connection example 35

4.5.2. MOSFET/PWM 36
4.5.2.1. Technical data 36

4.5.2.2. Pin assignment J3 37

4.5.2.3. MOSFET/PWM connection example 38

4.5.3. Timeout Funktion 39

4.6. Analog inputs 40


4.6.1. Technical data 40
4.6.2. Pin assignment J3 40
4.6.3. Connection example A/D inputs 41

5. Software description 42
5.1. Using our products 43
5.1.1. Control via our DELIB driver library 43
5.1.2. Control via supplied test programs 43
5.1.3. Control at protocol level 44
5.1.4. DELIB CLI (command-line interface) für Windows 45
5.1.4.1. Configuration of the DELIB CLI 47

5.1.4.2. DELIB CLI Examples 48

5.1.5. Control via graphical applications 52


5.1.5.1. LabVIEW 52

5.1.5.2. ProfiLab 52

5.1.5.3. Licht24 Pro 53

5.1.6. Integration of the DELIB in programming languages 54


5.1.6.1. Embedding the DELIB in Visual-C/C++ 54

5.1.6.2. Embedding the DELIB in Visual-C/C++ (Visual Studio


2015) 56

5.1.6.3. Embedding the DELIB in Visual-C# 59

5.1.6.4. Embedding the DELIB in Delphi 60

Index | Seite 3
INDEX

5.1.6.5. Embedding the DELIB in Visual-Basic (VB) 61

5.1.6.6. Embedding the DELIB in Visual-Basic.NET (VB.NET) 62

5.1.6.7. Embedding the DELIB in MS-Office (VBA) 63

5.1.6.8. Embedding the DELIB in LabVIEW 65

5.1.6.8.1. Embedding the DELIB in LabVIEW 65

5.1.6.8.2. Using the VIs in LabVIEW 74

5.1.6.8.3. Setting the module ID in LabVIEW 76

5.1.6.9. Embedding the DELIB in Java 78

5.2. DELIB driver library 79


5.2.1. Overview 80
5.2.1.1. Supported programming languages 81

5.2.1.2. Supported operating systems 83

5.2.1.3. SDK kit for programmers 83

5.2.2. DELIB Setup 84


5.2.3. ICT-Tool 89

5.3. DELIB Sample Sources (Windows program examples) 89


5.3.1. Installation DELIB Sample Sources 90
5.3.2. Use of the DELIB Sample Sources 93
5.3.2.1. Step 1 - Product selection 93

5.3.2.2. Step 2 - Category selection 95

5.3.2.3. Step 3 - Programming language selection 96

5.3.2.4. Step 4 - Source code 97

5.4. DELIB for Linux 100


5.4.1. Using the DELIB driver library for Linux 102
5.4.1.1. Delib USB sample in Linux 102

5.4.1.2. Delib ETH sample in Linux 105

5.4.2. DELIB CLI (command-line interface) for Linux 108


5.4.2.1. Configuration of the DELIB CLI 111

5.4.2.2. DELIB CLI Examples 114

6. ICT-Tool 116
6.1. General descriptions 117

Index | Seite 4
INDEX

6.2. Add module 122


6.2.1. USB Module 124
6.2.2. ETH Module 125
6.2.2.1. Ethernet standard method 126

6.2.2.2. Ethernet Direct method 128

6.2.2.3. Search via Broadcast 130

6.2.3. CAN Module 131


6.2.4. SER Module 132

6.3. Configure module 134


6.3.1. Module info 135
6.3.2. Module identification 136
6.3.3. Module restart 137
6.3.4. USB configuration 138
6.3.5. LAN network information 139
6.3.6. LAN network settings 141
6.3.7. WiFi network information 143
6.3.8. WiFi network settings 145
6.3.9. WiFi WPS connection 147
6.3.10. NTP configuration 148
6.3.11. TCP encryption 150
6.3.12. WEB-Login 155
6.3.13. Serial configuration 156
6.3.14. I/O channel names 159
6.3.15. D/A default values 160
6.3.16. CAN configuration 161
6.3.16.1. CAN status interface 161

6.3.16.2. CAN statistics TX/RX 163

6.3.16.3. CAN Main Interface 164

6.3.16.4. CAN Main I/O Init 165

6.3.16.5. CAN TX Mode 167

6.3.16.6. CAN RX Mode 169

6.3.17. Watchdog configuration 170

Index | Seite 5
INDEX

6.4. M2M configuration 171


6.4.1. Statistics 172
6.4.2. Receiver module 173
6.4.3. Jobs 175

6.5. Event control 177


6.5.1. Statistics 178
6.5.2. Event configuration 179
6.5.3. Actions 181

6.6. Test module 182


6.6.1. Timeout test function 182
6.6.2. Digital Out 183
6.6.3. Digital TTL 185
6.6.4. Digital In 187
6.6.5. Digital In Counter 188
6.6.6. Analog In 190
6.6.7. Analog Out 191
6.6.8. Temp 193
6.6.9. Graphical representation 194
6.6.10. CAN Runtime Parameter 196
6.6.11. Puls Generator 197
6.6.12. PWM Out 198
6.6.13. Watchdog switching behavior 200

6.7. Diagnose module 201


6.7.1. Digital cable return test 201
6.7.2. Analog cable return test 204
6.7.3. Access time tests 206
6.7.4. A/D noise graph 208
6.7.5. A/D read with ripple 209
6.7.6. FIFO In/Out 210
6.7.7. Main Loop 212
6.7.8. Module-Config-Memory 213

Index | Seite 6
INDEX

6.8. Firmware update 214


6.8.1. About DEDITEC firmware 214
6.8.2. Update flash files via ICT tool 215
6.8.3. Perform firmware update 216

6.9. Settings 218


6.9.1. General 218
6.9.2. Updates 219
6.9.3. Error log 220
6.9.4. DELIB-DebugView-Global 221
6.9.5. DELIB-DebugView-Details 222

7. DELIB API Reference 224


7.1. Available DEDITEC module IDs 225
7.2. DELIB directory structure 229
7.2.1. Include directory 231
7.2.2. Library directory 231
7.2.3. Library directory for Borland 231
7.2.4. Environment variables 231

7.3. Administrative functions 231


7.3.1. DapiOpenModule 231
7.3.2. DapiCloseModule 233
7.3.3. DapiGetDELIBVersion 233
7.3.4. DapiSpecialCMDGetModuleConfig 234
7.3.5. DapiOpenModuleEx 237

7.4. Error handling 239


7.4.1. DapiGetLastError 239
7.4.2. DapiGetLastErrorText 240
7.4.3. DapiClearLastError 241
7.4.4. DapiGetLastErrorByHandle 242
7.4.5. DapiClearLastErrorByHandle 243

7.5. Manage digital outputs 244

Index | Seite 7
INDEX

7.5.1. DapiDOSet1 244


7.5.2. DapiDOSet8 244
7.5.3. DapiDOSet16 245
7.5.4. DapiDOSet32 246
7.5.5. DapiDOSet64 247
7.5.6. DapiDOSet1_WithTimer 248
7.5.7. DapiDOReadback32 249
7.5.8. DapiDOReadback64 249
7.5.9. DapiDOSetBit32 250
7.5.10. DapiDOClrBit32 251

7.6. A/D converter functions 252


7.6.1. DapiADSetMode 252
7.6.2. DapiADGetMode 254
7.6.3. DapiADGet 254
7.6.4. DapiADGetVolt 255
7.6.5. DapiADGetmA 255
7.6.6. DapiSpecialADReadMultipleAD 256
7.6.7. DapiSpecialADFilterSet 258
7.6.8. DapiSpecialADFilterGet 261

7.7. CAN Runtime Functions 263


7.7.1. RunTimeVarWriteToModule 263

7.8. Manage output timeout 279


7.8.1. DapiSpecialCMDTimeout 279
7.8.1.1. DapiSpecialTimeoutSetValueSec 282

7.8.1.2. DapiSpecialTimeoutActivate 283

7.8.1.3. DapiSpecialTimeoutActivateAutoReactivate 284

7.8.1.4. DapiSpecialTimeoutActivateSecureOutputs 285

7.8.1.5. DapiSpecialTimeoutDeactivate 286

7.8.1.6. DapiSpecialTimeoutGetStatus 287

7.8.1.7. DapiSpecialTimeoutDoValueMaskWRSet32 288

7.8.1.8. DapiSpecialTimeoutDoValueMaskRDSet32 289

7.8.1.9. DapiSpecialTimeoutDoValueMaskWRClr32 290

Index | Seite 8
INDEX

7.8.1.10. DapiSpecialTimeoutDoValueMaskRDClr32 291

7.8.1.11. DapiSpecialTimeoutDoValueLoadDefault 292

7.9. Test functions 293


7.9.1. DapiPing 293

7.10. Register write commands 294


7.10.1. DapiWriteByte 294
7.10.2. DapiWriteWord 295
7.10.3. DapiWriteLong 296
7.10.4. DapiWriteLongLong 297

7.11. Register read commands 298


7.11.1. DapiReadByte 298
7.11.2. DapiReadWord 299
7.11.3. DapiReadLong 300
7.11.4. DapiReadLongLong 301

7.12. Programming example 302


7.13. Delib overview table 304

8. Appendix 308
8.1. Contact / Support 309
8.2. Environment and disposal 309
8.3. Revisions 310
8.4. Copyrights and trademarks 311

Index | Seite 9
Introduction

Introduction | Seite 10
1. Introduction
1.1. Foreword
Congratulations on purchasing a high quality DEDITEC product!
Our products are developed by our engineers according to today's required
quality standards. We pay attention already during the development to flexible
expandability and long availability.

We develop modular!
Due to a modular development we shorten the development time and - what of
course benefits the customer - we sell at a fair price!

We ensure a long delivery availability!


If used semiconductors are no longer available, we can react faster. With us
mostly only modules have to be redesigned and not the whole product. This
increases the delivery availability.

1.2. Customer satisfaction


A satisfied customer is our first priority!
If something is not to your satisfaction, just contact us by phone or mail.
We will take care of it!

1.3. Customer response


The best products grow with our customers. We are always grateful for any
suggestions or proposals.

Introduction | Seite 11
1.4. Brief description
Our CAN-IO-BOX "CB-R8-M4-AD8" is a stand-alone CAN module with an
additional USB interface for quick and easy configuration on a PC or notebook.
The CAN box has 8 changeover relays and 4 MOSFET outputs. In addition, 8
analog signals with a resolution of 12 bits can be recorded.
Typical areas of application are customer-specific conversions in special
vehicle construction, such as harvesting and agricultural machinery,
construction site vehicles, mobile homes, fire engines, emergency vehicles and
much more.

Introduction | Seite 12
1.5. Scope of delivery
The following items are included:
· CAN-Box
· USB cable

Introduction | Seite 13
Commercial data

II

Commercial data | Seite 14


2. Commercial data
2.1. Product versions

Item number Operating voltage A/D Range Power-Off Mounting rail


Mode

CB-R8-M4-AD8_24 +7..+24V DC 0..18V no no

CB-R8-M4-AD8_24_M +7..+24V DC 0..18V no yes

CB-R8-M4-AD8_48 +10..+48V DC 0..18V yes no

CB-R8-M4-AD8_48_M +10..+48V DC 0..18V yes yes

Commercial data | Seite 15


Commissioning

III

Commissioning | Seite 16
3. Commissioning
3.1. Step 1 - Safety instructions
Before commissioning your DEDITEC product, please familiarize yourself with
this manual and read the following points carefully:

· Damage caused by non-observance of these operating instructions will void


the warranty or guarantee of this product. We do not accept any liability for
consequential damage!
· We do not accept any liability for damage to property or personal injury that
could result from improper handling or non-observance of the safety
instructions!
· Avoid touching electronic components on the circuit board directly. This
could lead to electrostatic discharges and destroy sensitive components. As a
precaution, always discharge before touching an electrically grounded object.
· Unauthorized conversions or technical modifications to this product are not
permitted for safety and approval reasons (CE) and will void the warranty or
guarantee.
· Do not operate the module outside the maximum permissible technical data.
· The product is not suitable for operation in damp or wet environments.

Commissioning | Seite 17
3.2. Step 2 - Installing the software and drivers
The DELIB Setup guides you through the installation of our DELIB driver library.
You will then be guided through the configuration process and function test for
our various products.

Our current version of the DELIB setup for Linux and Windows in the 32-bit or
64-bit versions can be downloaded from our homepage.
Link: https://www.deditec.de/en/delib

The DELIB setup guides you step by step through the installation of the DELIB
driver library.

Commissioning | Seite 18
In addition to the DELIB driver library, you also have the option of installing our
"DELIB CLI - Command Line" software.
You can use this program to execute commands directly from the command
line. You can find more information on this in the following chapter:
DELIB CLI (command-line interface) for Windows
DELIB CLI (command-line interface) for Linux

Commissioning | Seite 19
Select your desired installation path and confirm with the "Install" button

Commissioning | Seite 20
Installation progress of the driver library.

Commissioning | Seite 21
After completing the installation, close the setup with the "Finish" button

With "Run the ICT-Tool now" you have the option of starting the ICT-Tool directly
after exiting the DELIB setup.
In addition, you will now find the ICT tool and the DELIB-CLI in your Windows
"Start" directory.

Commissioning | Seite 22
3.3. Step 3 - Connecting the power supply
The power supply is connected to the 22-pin connector J3.

Typ: Würth 649022227222

Pin Description

1 IGN, Ignition plus, (Cl. 15) **

2 V+, Continuous plus, (Cl. 30)

12, 13 GND / Mass

** Only available with the 48V versions

Commissioning | Seite 23
3.4. Step 4 - Connect to the PC or network

Once you have successfully installed the driver library, start the "ICT-Tool"
program in the installation path you have selected or in the Windows start
menu.

3.4.1. Connection via USB


Connect the module to your PC or USB hub using the USB cable supplied.

See chapter USB Configuration

3.5. Step 5 - Function test


With our tool "ICT-Tool" you can start up the module relatively fast and easy and
without programming knowledge and check its functionality.

To do this, follow the instructions in the "ICT-Tool" chapter.

Commissioning | Seite 24
Hardw are description

IV

Hardware description | Seite 25


4. Hardware description
4.1. General technical data
4.1.1. CAN-IO-BOX

Electrical data:
Power supply 24V version: +7V..+24V DC
Power supply 48V version: +10V..+48V DC

Power consumption: Load: approx. 370 mA/12V


Rest: approx. 60 mA/12V

Surroundings:
Ambient temperature: 24V version: 0 to +70°C
48V version: -40 to +86°C
Air humidity: 90 %
Condensation: Not allowed

Mechanics:
Dimensions in mm (HxWxD): 36,2 x 92,5 x 147,6

Hardware description | Seite 26


4.2. Interfaces
4.2.1. USB
Technical data:
Standard: USB 1.1 / USB 2.0
Connection establishment: USB type B
Access time PC to module*: 4,06 ms**

* Calculated with 1000 accesses to the module via the DELIB driver library with the command
DapiDoSet32
** average time for 32-bit accesses

4.2.2. CAN

Technical data:
Standard: ISO 11898
Speed: 1 Mbit/s, 500 Kbit/s,
250 Kbit/s, 125 Kbit/s,
100 Kbit/s, 50 Kbit/s,
20 Kbit/s, 10 Kbit/s
Connection setup: Open CAN protocol
Galvanic isolation: up to 500V rms
Special features: Automatic processing of CAN
packets (Auto RX/TX mode)

4.2.3. Pin assignment J3

Typ: Würth 649022227222

Hardware description | Seite 27


Pin Description

11 CAN-HIGH

22 CAN-LOW

The bus termination with 120 Ohm must be external!

Hardware description | Seite 28


4.3. LEDs
There are a number of status LEDs on the front of the module. These signal the
operating status of the module.

4.3.1. Definition of the LEDs


LED Status (red):
Indicates whether the module is in the bootloader or in the application. see
chapter "Flashing behavior of the LEDs"

LED I/O (green):


Flashes when the module is accessed via the USB or CAN interface.

Hardware description | Seite 29


4.3.2. Flashing behavior of the LEDs
The flashing sequences of the status LEDs are shown below.

1. Bootvorgang
Der Bootvorgang startet direkt nach dem Einschalten der
Spannungsversorgung.

Die Bootvorgang-Sequenz wird einmalig durchlaufen.

2. Applikation oder Bootloader

2.1 Applikation
Der Bootvorgang wurde erfolgreich durchlaufen und das Produkt befindet sich
nun in der Applikation. Das Produkt ist betriebsbereit.

Die Status-LED leuchtet 5 Sekunden und erlischt für etwa 300ms. Die
Applikations-Sequenz wiederholt sich.

Hardware description | Seite 30


4.4. Block diagram

Hardware description | Seite 31


4.5. Digital outputs
4.5.1. Relais
4.5.1.1. Technical data
Quantity: 8
Type: OMRON G5LE-1 (SPDT)
Max. Switching voltage: 48V AC / DC
Max. Switching current: 9A DC with max. one
connected output per
connector, otherwise 6A DC
Max. Switching capacity: 350W per output
Galvanic isolation: Between contact and coil:
2000 VAC
Service life: min. 100000 switching cycles

Hardware description | Seite 32


4.5.1.2. Pin assignment J1

Typ: Würth 649012227222

Pin Description Pin Description

1 NO1 7 NO2

2 COM1 8 COM2

3 NC1 9 NC2

4 NO3 10 NO4

5 COM3 11 COM4

6 NC3 12 NC4

Hardware description | Seite 33


4.5.1.3. Pin assignment J2

Typ: Würth 649012227222

Pin Description Pin Description

1 NO5 7 NO6

2 COM5 8 COM6

3 NC5 9 NC6

4 NO7 10 NO8

5 COM7 11 COM8

6 NC7 12 NC8

Hardware description | Seite 34


4.5.1.4. Relay connection example

Hardware description | Seite 35


4.5.2. MOSFET/PWM
4.5.2.1. Technical data
Quantity: 4
Type: IRFR5505 (P-Ch)
Max. Switching voltage: 48V DC
Min. switching voltage: 2.8V DC
Max. Switching current: 9A DC with max. one
connected output per
connector, otherwise 6A DC
Max. switching capacity: 432W per output

Hardware description | Seite 36


4.5.2.2. Pin assignment J3

Typ: Würth 649022227222

Pin Description Pin Description

3 MOS1-IN 14 MOS1-OUT

4 MOS2-IN 15 MOS2-OUT

5 MOS3-IN 16 MOS3-OUT

6 MOS4-IN 17 MOS4-OUT

Pin Description

12, 13 GND / Mass

!!! The GND / ground line of the MOSFET power supply must be connected to the
GND / ground line of the CAN box. See connection example in section 4.5.2.3.

Hardware description | Seite 37


4.5.2.3. MOSFET/PWM connection example

Hardware description | Seite 38


4.5.3. Timeout Funktion
The timeout function offers the possibility to automatically switch the outputs
on or off in case of a connection loss between the control PC and the DEDITEC
module. This can be defined for each individual channel by software.

Functions:
· Time definable automatic activation of the timeout protection function in
case of timeout (between 0.1 seconds and 6553 seconds).
· In timeout case digital outputs can be activated, deactivated or left
unchanged.
· 3 different timeout modes: "normal", "auto reactive" and "secure output" for
different procedures in case of timeout.

For more details see Chapter Manage output timeout.

Hardware description | Seite 39


4.6. Analog inputs
4.6.1. Technical data

Technical data AD-2 16 bit converter


Number of channels: 8 with 12-bit resolution each
(single ended)
Voltage ranges: 0..18V

4.6.2. Pin assignment J3

Typ: Würth 649022227222

Pin Description Pin Description

7 ANA1-N 18 ANA2-IN

8 ANA3-IN 19 ANA4-IN

9 ANA5-IN 20 ANA6-IN

10 ANA7-IN 21 ANA8-IN

12,13 GND

Hardware description | Seite 40


4.6.3. Connection example A/D inputs

Hardware description | Seite 41


Softw are description

Software description | Seite 42


5. Software description
5.1. Using our products
5.1.1. Control via our DELIB driver library
Included in the delivery of our DELIB driver library is the DELIB-API and various
programs for the configuration test of our products.
The API gives you access to all functions you need to communicate with our
products.

In the chapter DELIB API Referenz you will find all functions of our driver library
explained and provided with application examples.

5.1.2. Control via supplied test programs


With our ICT-Tool you can test the functionality of our control & regulation
products without much configuration effort.

For detailed information see chapter ICT-Tool.

Software description | Seite 43


5.1.3. Control at protocol level
For products with Ethernet, CAN or serial interface we offer our open protocols.

These protocols can be used without our DELIB driver library on devices with
corresponding interface. The way over our protocols are operating system
independent.

Our manual, protocols & register assignment can be found here:


Download PDF:
http://www.deditec.de/pdf/manual_d_deditec_communication_protocols.pdf

Online HTML manual:


http://manuals.deditec.de/de/manual_deditec_communication_protocols/inde
x.html

This manual provides a complete overview of the required register addresses of


our modules as well as the structure of the different communication protocols.

Software description | Seite 44


5.1.4. DELIB CLI (command-line interface) für Windows
Since in some programming languages (such as PHP) no DLLs can be included,
there is an extra command line command for this, which can be called directly
from the program (with the appropriate parameters).
The DELIB CLI command for Windows is located after the installation of the
DELIB driver library in the directory C:\Programs\DEDITEC\DELIB\programs\cli\
.

Definition (Windows)
delib_cli command channel [value | unit ["nounit"] ]
Note: The individual parameters are separated only by a space.
Upper and lower case are not considered here.

Parameter

Command Channel Value unit nounit

di1 0, 1, 2, ...

di8
- hex nounit
di16 0, 8, 16, ...

di32

ff 0, 32, ... - hex nounit

do1 0, 1, 2, ... 0/1 (1-Bit Command)

8-Bit
do8
Value
(Bit 0 for channel - -
16-Bit
do16 0, 8, 16, ... 1, Bit 1 for
Value
channel 2, ...)
32-Bit
do32
Value

Software description | Seite 45


Command Channel Value unit nounit

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

Integer or
hexadecimal
ao 0, 1, 2, ... number - -
(starting with
0x).

Return-Value
State of the read digital inputs
In combination with parameter unit "hex" the state is read as hex

State of the FlipFlips of the digital inputs


In combination with parameter unit "hex" the state is read as hex

Status of the read analog inputs


In combination with parameter unit "hex" the state is read as hex
In combination with parameter unit "volt" the voltage is read
In combination with parameter unit "mA" the current is read

Software description | Seite 46


5.1.4.1. Configuration of the DELIB CLI
Before using the DELIB CLI for the first time, the "delib_cli.cfg" must be edited
with a text editor.

Configuration under Windows


Under Windows the "delib_cli.cfg" is located in the directory "C:
\Programs\DEDITEC\DELIB\programs\cli\" after the installation of the DELIB
driver library.

Contents of the "delib_cli.cfg":


moduleID=14;
moduleNR=0;
RO-ETH_ipAddress=192.168.1.11;

moduleID
The corresponding number of the hardware used must be entered as moduleID.
This number can be taken from the "delib.h".
Under Windows you will find this in the directory C:
\Programs\DEDITEC\DELIB\include\.

moduleNR
The moduleNR is assigned in the ICT-Tool.
This number is used to identify identical hardware.
The default value is 0.

RO-ETH_ipAddress
This entry is only required for the connection to our ETH modules.
The IP address of the ETH modules can be set via the ICT-Tool as well as via the
web interface of the module.

Software description | Seite 47


5.1.4.2. DELIB CLI Examples
Digital outputs
delib_cli DO1 17 1
switches on the 18th digital relay

delib_cli DO1 3 0
switches off the 4th digital relay

delib_cli DO8 0 255


switches on the digital relays 1 to 8

delib_cli DO16 0 0
switches off the digital relays 1 to 16

delib_cli DO16 16 65535


switches on the digital relays 17 to 32

delib_cli DO32 0 4294967295


switches on the digital relays 1 to 32

Software description | Seite 48


Digital inputs
delib_cli DI1 3
Example of a return value: 1
read the state of the 4th digital input and return it

delib_cli DI8 0 hex


Example of a return value: 0xC8
(a signal is present on channels 4, 7 and 8)
read the value of digital input 1-8 as hexadecimal number

delib_cli DI16 0 hex


Example of a return value: 0xE0C0
(a signal is present on channels 7,8, 14 ,15 and 16)
read the value of digital input 1-16 as hexadecimal number

Alternatively, the "nounit" argument can be appended to all output requests


to be formatted as follows:
delib_cli DI8 0 hex nounit
Example of a return value: FF
(a signal is present on channels 1-8)
read the value of digital input 1-8 as hexadecimal number

delib_cli FF 0
Example of a return value: 192
(a change of state has been detected on channels 7 and 8).
read the value of the FlipFlops of the digital inputs 1-32

delib_cli FF 32
Example of a return value: 65535
(a change of state has been detected on channels 33 to 64).
read the value of the FlipFlops of the digital inputs 33-64

delib_cli FF 0 hex
Example of a return value: 0xD00
(a change of state was detected on channels 9, 11 and 12)
read the value of the FlipFlops of the digital inputs 1-32 as hexadecimal
number

Software description | Seite 49


Analog outputs
delib_cli AO 7 4711
sets the decimal value 4711 to the 8th analog output

delib_cli AO 6 0x4711
sets the hexadecimal value 0x4AF1 to the 7th analog output

delib_cli AO 7 3.7V
sets the voltage of the 8th analog output to 3.7 volts
(both comma "," and dot "." can be used for comma separation)

delib_cli AO 7 13.3mA
sets the current of the 8th analog output to 13.3 milliamperes
(both comma "," and period "." can be used for comma separation)

Software description | Seite 50


Analog inputs
delib_cli AI 2
Example of a return value: 1234
reads the value of the 3rd analog input as decimal number

delib_cli AI 2 hex
Example of a return value: 0x1FA
reads the value of the 3rd analog input as hexadecimal number

delib_cli AI 2 V
Example of a return value: 12.500000V
reads the voltage of the 3rd analog input as a comma number

delib_cli AI 2 mA
Example of a return value: 20.551600mA
reads the current of the 3rd analog input as a comma number

Alternatively, the argument "nounit" can also be appended to all output


requests to be formatted as follows:
delib_cli AI 3 hex nounit
Example of a return value: 1FA
reads the value of the 4th analog input as hexadecimal number

delib_cli AI 3 V nounit
Example of a return value: 12.500000
reads the voltage of the 4th analog input as a comma number

Software description | Seite 51


5.1.5. Control via graphical applications
5.1.5.1. LabVIEW
Our DELIB API can be imported and used in LabVIEW. All products that use our
DELIB API are therefore compatible with LabVIEW.

The following chapter shows how to include the DELIB API in LabVIEW:
Including the DELIB in LabVIEW

5.1.5.2. ProfiLab
The ProfiLab software of the company Abacom supports a large number of our
control & regulation products.

Link to the manufacturer: http://www.abacom-online.de/html/profilab-


expert.html

The following I/Os are supported:

Digital inputs/outputs
- Relais
- MOSFET
- Optokoppler
- Bistabile-Relais

Analog inputs/outputs
- Analog to digital converter
- Digital to analog converter

TTL-I/Os
- 8/32/64 TTL channels

Software description | Seite 52


5.1.5.3. Licht24 Pro
The Licht24 Pro software from the company bksoft also supports a high
number of our products.

You can find more information at: http://www.bksoft.de/licht24pro.htm

Software description | Seite 53


5.1.6. Integration of the DELIB in programming languages
5.1.6.1. Embedding the DELIB in Visual-C/C++
To make it easier to reference the DELIB include and the DELIB lib directory,
environment variables are defined when the DELIB is installed.
DELIB_LIB = C:\Programs\DEDITEC\DELIB\lib
DELIB_INCLUDE = C:\Programs\DEDITEC\DELIB\include

These are entered below in the project settings of the compiler.


Start Visual-C/C++ and open the menu "Project Settings".

Software description | Seite 54


DELIB.H entry in the Visual-C/C++ project settings
Under the tab "C/C++" select the "Category" Preprocessor and enter
"$(DELIB_INCLUDE)" under "Additional Include Directories.

DELIB.LIB entry in the Visual-C/C++ project settings


Under the "Linker" tab at "Object/Library Modules" extend the existing line with
the extension "$(DELIB_LIB)\delib.lib".

Software description | Seite 55


5.1.6.2. Embedding the DELIB in Visual-C/C++ (Visual Studio 2015)
To make it easier to reference the DELIB include and DELIB lib directory,
environment variables are defined when the DELIB is installed.

32 Bit DELIB Installation


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

64 Bit DELIB Installation


DELIB64_LIB = C:\Programs\DEDITEC\DELIB64\lib
DELIB64_INCLUDE = C:\Programs\DEDITEC\DELIB64\include

These are entered in the project settings of the compiler in the following.
Visual-C/C++ Start and open in the menu "Project Properties.

DELIB.H entry in the Visual-C/C++ project settings

Software description | Seite 56


Under the tab "C/C++" select the "Category" General and enter
"$(DELIB_INCLUDE)" under "Additional Include Directories".

DELIB.LIB entry in the Visual-C/C++ project settings


Under the "Linker" tab, enter "$(DELIB_LIB)\delib.lib" for "General".

Software description | Seite 57


Software description | Seite 58
5.1.6.3. Embedding the DELIB in Visual-C#
The required file for Visual-C# is located in the directory
C:\Programs\DEDITEC\DELIB\include.
Start Visual-C# and use the menu "Project Add existing element" in the
directory C:\Programme\DEDITEC\DELIB\include\ to open the file delib.cs for
import.

Add the following reference in your program:


using DeLib;

Software description | Seite 59


5.1.6.4. Embedding the DELIB in Delphi
The required file for Delphi is located in the directory
C:\Programme\DEDITEC\DELIB\include.
Start Delphi and use the menu "Project Add to project" in the directory C:
\Programs\DEDITEC\DELIB\include\ to open the file delib.pas for import.

Software description | Seite 60


5.1.6.5. Embedding the DELIB in Visual-Basic (VB)
The required file for Visual-Basic is located in the directory
C:\Programs\DEDITEC\DELIB\include.
Start Visual Basic and use the menu "Project Add file...". in the directory C:
\Programme\DEDITEC\DELIB\include\ open the file delib.bas for import.

Software description | Seite 61


5.1.6.6. Embedding the DELIB in Visual-Basic.NET (VB.NET)
The required file for VB.NET is located in the directory
C:\Programme\DEDITEC\DELIB\include.
Start VB.NET and use the menu "Project Add existing element" in the directory
C:\Programme\DEDITEC\DELIB\include\ to open the file delib.vb for import.

Software description | Seite 62


5.1.6.7. Embedding the DELIB in MS-Office (VBA)
The required file for VBA is located in the directory
C:\Programs\DEDITEC\DELIB\include.
Start Microsoft Excel and open it via the menu "Tools Macro Visual Basic
Editor".

Software description | Seite 63


Creating the UserForm
Create a new worksheet (UserForm) via the menu "Insert UserForm". At the
top left of the Project Manager, right-click on "UserForm Import file". In the
directory C:\Programme\DEDITEC\DELIB\include open the file delib.bas for
import.

Software description | Seite 64


5.1.6.8. Embedding the DELIB in LabVIEW
5.1.6.8.1. Embedding the DELIB in LabVIEW
The LabVIEW sample program "Deditec_Modul_Control.vi" is not an EXE file and
therefore requires the LabVIEW development environment for execution.

Description of the integration of the "delib.dll" in LabVIEW version 11


- The required files for LabVIEW are located in the directory
C:\Windows\System32\delib.dll and in
C:\Programs\DEDITEC\DELIB\include\delib.h
- Start LabVIEW and select the following option "Tools Import DLL ...".

Software description | Seite 65


- Select the item "Create VIs for DLL" and press "Next".

Software description | Seite 66


- In the next window, use the browser buttons to specify the location of the
delib.dll and delib.h files and continue with "Next".

Software description | Seite 67


- Click on "Next" again to continue.
- The header file will now be analyzed. Then click "Next" again in the following
window to continue.

Software description | Seite 68


- Follow the further instructions or adjust the configuration and the location for
the VIs.

Software description | Seite 69


- In the following window, select the "Simple error handling" option from the
drop-down menu and continue with "Next".

Software description | Seite 70


- For VIs that work with 64-bit values, the representation must be changed from
"Unsigned Long" to "Unsigned Quad".
- The following VIs must be edited:
DapiCNT48CounterGet48 (function return)
DapiDIGet64 (function return)
DapiDOSet64 (data)
DapiDOReadBack64 (function return)

Software description | Seite 71


- For some VIs, the element type must also be changed to "Numeric" and then
the representation must be changed to "Unsigned Quad".
- The following VIs must be edited:
DapiWriteLongLong (value)
DapiReadLongLong (function return)

Software description | Seite 72


- A summary of the steps performed appears.
- Press "Next" to continue.

- The VIs are now created and can be used.

Software description | Seite 73


5.1.6.8.2. Using the VIs in LabVIEW
In our sample programs, some functions use so-called defines as transfer
parameters.
These defines are not supported in LabVIEW.

This example is intended to show how such functions can be used in LabVIEW.

As an example we use the function to configure the voltage range of an A/D


converter.

The definition for the function is:


void DapiADSetMode(ULONG handle, ULONG ch, ULONG mode);

The voltage ranges for the function are already predefined in the DELIB driver
library.

Sample code in C/C++:


DapiADSetMode(handle, 0, ADDA_MODE_UNIPOL_5V);
Alternatively, you can use the following notation:
DapiADSetMode(handle, 0, 0x01);

Here the hexadecimal value, which you can take from the delib.h file, was
passed as parameter for the mode

Software description | Seite 74


The delib.h file can be found after the installation of the DELIB driver library in
the directory C:\Programs\Deditec\DELIB\Include

In LabVIEW, the function could then look like this:

Software description | Seite 75


5.1.6.8.3. Setting the module ID in LabVIEW
In the following example the addressing of a RO-ETH module in LabVIEW is
shown.
The connection to the module is established by means of the function
DapiOpenModule.

The definition for this function is:


ULONG DapiOpenModule(ULONG moduleID, ULONG nr);

The module ID (e.g. "RO_ETH") of the used module is usually passed as


parameter for moduleID.
An overview of all possible module IDs can be taken from the file "delib.h".
The delib.h can be found after the installation of the DELIB driver library in the
directory C:\Programs\Deditec\DELIB\Include

Example in C:
handle = DapiOpenModule(RO_ETH, 0); // opens a RO-ETH module with module

Software description | Seite 76


no. 0.
Alternatively, you can use the following notation:
handle = DapiOpenModule(8, 0);
Since it is not possible in LabVIEW to pass these "C-Defines" as parameters for
the function DapiOpenModule, the alternative notation must be used here.

Example in Labview:

Software description | Seite 77


5.1.6.9. Embedding the DELIB in Java
The required files for Java are located in the following directory, depending on
the DELIB installation
C:\Program Files (x86)\DEDITEC\DELIB\include\DelibJava (32 bit installation)
C:\Program Files\DEDITEC\DELIB64\\include\DelibJava (64 bit installation)

If Eclipse is used, the DelibJava folder can be added to the project simply by
dragging and dropping.
Afterwards the used modules still have to be imported.

Software description | Seite 78


5.2. DELIB driver library
The DELIB driver library contains the DELIB API and various programs for the
configuration test of our products.

Via the API you have access to all functions you need to communicate with our
products.

In the chapter DELIB API Referenz you will find all functions of our driver library
explained and provided with application examples.

Software description | Seite 79


5.2.1. Overview
The following figure explains the structure of the DELIB driver library

The DELIB driver library enables a uniform response of DEDITEC hardware, with
special consideration of the following aspects:

· Operating system independent


· Programming languages independent
· Product independent

We offer these versions of the driver library:


· 32/64-bit DELIB driver library for Windows
· 32/64-bit DELIB driver library for Linux
· 32/64-bit DELIB Driver Library ETH

Software description | Seite 80


DELIB Driver library ETH
While the DELIB is available for ALL products, the DELIB-ETH does not access
any other drivers (like USB).
This means that the DELIB-ETH does not need to be installed.
Customers who write their own applications do not have to create their own
SETUP which also installs e.g. USB drivers.
The DELIB-ETH.dll file only has to be located in the program directory of the
application and serves as interface between customer application and
hardware.
The DELIB-ETH provides all DELIB commands and can easily be replaced by the
old DELIB for Ethernet applications.

5.2.1.1. Supported programming languages


The following programming languages are supported by the DELIB driver
library:
·C

Software description | Seite 81


· C++
· C#
· Delphi
· VisualBasic
· VB.NET
· MS-Office (VBA)
· Java (platform independent, only for Ethernet products)
· Java JNI (for Windows only, all products are supported)

If provided by the programming language/development environment, we


support both 32-bit and 64-bit projects.

Software description | Seite 82


5.2.1.2. Supported operating systems
The following operating systems are compatible with our DELIB driver library:

32-Bit:
· Windows 10
· Windows 7
· Windows 8
· Windows Server 2012
· Windows Server 2008
· Windows Vista
· Windows XP
· Windows Server 2003
· Windows 2000
· Linux

64-Bit:
· Windows 10 x64
· Windows 7 x64
· Windows 8 x64
· Windows Server 2012 x64
· Windows Server 2008 x64
· Windows Vista x64
· Windows XP x64
· Windows Server 2003 x64
· Linux x64

5.2.1.3. SDK kit for programmers


Integrate the DELIB into your application. On request, we will provide you with
installation scripts free of charge that enable you to include the DELIB
installation in your application.

Software description | Seite 83


5.2.2. DELIB Setup
The DELIB Setup guides you through the installation of our DELIB driver library.
You will then be guided through the configuration process and function test for
our various products.

Our current version of the DELIB setup for Linux and Windows in the 32-bit or
64-bit versions can be downloaded from our homepage.
Link: https://www.deditec.de/en/delib

The DELIB setup guides you step by step through the installation of the DELIB
driver library.

Software description | Seite 84


In addition to the DELIB driver library, you also have the option of installing our
"DELIB CLI - Command Line" software.
You can use this program to execute commands directly from the command
line. You can find more information on this in the following chapter:
DELIB CLI (command-line interface) for Windows
DELIB CLI (command-line interface) for Linux

Software description | Seite 85


Select your desired installation path and confirm with the "Install" button

Software description | Seite 86


Installation progress of the driver library.

Software description | Seite 87


After completing the installation, close the setup with the "Finish" button

With "Run the ICT-Tool now" you have the option of starting the ICT-Tool directly
after exiting the DELIB setup.
In addition, you will now find the ICT tool and the DELIB-CLI in your Windows
"Start" directory.

Software description | Seite 88


5.2.3. ICT-Tool
With our new ICT tool, your module can be easily configured, tested, diagnosed
and flashed.
A more detailed description of the individual functions can be found in the
chapter ICT-Tool.

5.3. DELIB Sample Sources (Windows program examples)


The DELIB Sample Sources offer sample programs including source code for
almost all DEDITEC products.
To simplify the quick start with our modules, you will find source codes for the
following programming languages:

·C
· C++
· C#
· Delphi
· VisualBasic
· VB.NET
· MS-Office
· LabVIEW
· Java

Software description | Seite 89


5.3.1. Installation DELIB Sample Sources
You can install the DELIB Sample Sources via a separate setup.
You can also find a current version of the sample sources on the Internet under
the following link in the Samples tab:
https://www.deditec.de/en/downloads/software/

Startup screen of the DELIB Sample Sources Installer

Software description | Seite 90


Press Next.

Select the installation folder and press Install.

Software description | Seite 91


The DELIB sample sources are now installed.

The DELIB Sample Sources have been successfully installed. Press Close to
finish the installation.

Software description | Seite 92


5.3.2. Use of the DELIB Sample Sources
After installing the DELIB Sample Sources you can find them under

Start Programs DEDITEC DELIB Sample Sources Sources

Now the Windows Explorer opens with an overview of all products for which a
sample program is available.

5.3.2.1. Step 1 - Product selection


For example you need a help for programming the digital inputs of a RO-ETH
module (e.g. RO-ETH-O16) in the programming language Visual-C.
Since it is a RO-ETH product, select or open the ro-eth-series folder.

Software description | Seite 93


Software description | Seite 94
5.3.2.2. Step 2 - Category selection
In the next step, you will find an overview of the available categories for the
selected product.
Since we focus on the digital inputs in this example, select the category digital-
input

Software description | Seite 95


5.3.2.3. Step 3 - Programming language selection
In this step you will see all available programming examples of the selected
category, sorted by programming languages.
Since we are focusing on the Visual-C programming language in this example,
open the vc folder.

Software description | Seite 96


5.3.2.4. Step 4 - Source code
After selecting the programming language you will get the following overview:

You can now open the source code of the sample program (in this case .cpp
file) with any text editor.

Software description | Seite 97


In addition, you will find an already compiled and executable program for this
project in the debug folder.

Software description | Seite 98


Software description | Seite 99
5.4. DELIB for Linux
Download the Delib Linux driver library under
"www.deditec.de/de/downloads/produkte/" in the tab "DELIB+Protocols" or
under "www.deditec.de/media/zip/delib/delib-linux.zip" directly on your Linux
system.

Software description | Seite 100


Unzip the "delib-linux.zip" to any destination folder. To do this, double-click the
zip file and then use the "Unzip" button in the top menu bar.

Select your destination folder and then click the "Unzip" button.

Software description | Seite 101


5.4.1. Using the DELIB driver library for Linux
5.4.1.1. Delib USB sample in Linux
Presets
In this program example a USB_RELAIS_8 module is addressed. If you use
another module, you have to enter the following in the file
"/samples/usb_sample/source/usb_sample.c" with the command
"DapiOpenModule". The exact name can be found in "delib.h". You can find it in
the directory
"/delib-sources/delib/library/delib/delib.h".

Compiling the USB sample


To compile the test program, open a terminal window and navigate with the
command
"cd /<directory path>" to the "/samples/usb_sample" directory.
Tip: If there are spaces in your folder name, enter them in " " as shown in the
example below.

Software description | Seite 102


To compile, now open the shell script contained in it with the command
"sudo sh ./1_compile_usb_sample.sh".

If necessary, enter your user password.

If the compilation was successful, "compiling successful" should now appear in


the terminal window.
The file "usb_sample" has been added to the directory.

Now you can execute the sample program with "sudo ./usb_sample".

IMPORTANT!! You need admin rights to run it. Therefore use the command with
"sudo".

Software description | Seite 103


The program is now executed.
In this example all digital outputs of the USB_RELAIS_8 are switched on and off
again in a loop.

Software description | Seite 104


5.4.1.2. Delib ETH sample in Linux
Presets
In this program example the module is addressed with the IP "192.168.1.21".
You can change this in the file
"/samples/ethernet_sample/source/eth_sample.c" (see picture below).
If you have preset a password for an encrypted TCP connection, you can also
enter it there (see picture below). If you have not specified a password, you can
leave this line unchanged.
The configuration of the ETH modules can be set via the ICT-Tool, as well as via
the web interface of the module.

Software description | Seite 105


If you use a module without digital inputs, you must comment out the lines in
the same file as shown below.

Compiling the ETH sample


For compiling the test program, open a terminal window and navigate with the
command
"cd /<directory path>" to the "/samples/ethernet_sample" directory.
Tip: If there are spaces in your folder name, enter them as shown in the example
below
in " " as shown in the example below.

To compile, now open the desired shell script with the command
"sudo sh ./<DATEINAME>"
· If you want to access the module via an unencrypted TCP connection, use the
file "1_compile_ethernet_sample.sh".
· If you want to control the module over an encrypted TCP connection, use the
file "2_compile_ethernet_sample_with_encryption.sh".

Software description | Seite 106


If necessary, enter your user password.

If the compilation was successful, "compiling successful" should now appear in


the terminal window.
The file "ethernet_sample" has been added to the directory.

Now you can execute the sample program with "sudo ./ethernet_sample".
IMPORTANT!! You need admin rights to run it. Therefore use the command with
"sudo".

The program is now executed.


In this example, all outputs of the module are switched on and off again in a
loop.

Software description | Seite 107


5.4.2. DELIB CLI (command-line interface) for Linux

The DELIB CLI command for Linux is located in the folder /deditec-cli/ after
unpacking the zip archive "delib-linux-cli".

Definition for USB modules (Linux)


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

Definition for ETH modules (Linux)


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

Note:
The individual parameters are separated only by a space.
Upper and lower case are not considered here.

Software description | Seite 108


Parameter

Command Kabal Value unit nounit

di1 0, 1, 2, ...

di8
0, 8, - hex nounit
di16
16, ...
di32

ff 0, 32, ... - hex nounit

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

8-bit
do8
value
(Bit 0 for channel 1, - -
0, 8, 16 bit
do16 Bit 1 for channel
16, ... value
2, ...)
32-bit
do32
value

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

Integer or hexadecimal
ao 0, 1, 2, ... number - -
(starting with 0x).

Return value

State of the read digital inputs


In combination with parameter unit "hex" the state is read as hex

State of the FlipFlips of the digital inputs


In combination with parameter unit "hex" the state is read as hex

Software description | Seite 109


Status of the read analog inputs
In combination with parameter unit "hex" the state is read as hex
In combination with parameter unit "volt" the voltage is read
In combination with parameter unit "mA" the current is read

Software description | Seite 110


5.4.2.1. Configuration of the DELIB CLI
Presets
Before using the DELIB CLI for the first time, the "delib_cli.cfg" must be edited
with a text editor.
You can find the "delib_cli.cfg" in the directory "/delib_cli/".

Contents of the "delib_cli.cfg":


moduleID=14;
moduleNR=0;
RO-ETH_ipAddress=192.168.1.11;

moduleID
The corresponding number of the hardware used must be entered as moduleID.
This number can be taken from the "delib.h".
Under Linux you find this in the zip archive of the "delib-linux" under the path
"delib-sources\delib\library\delib".

moduleNR
The moduleNR is assigned in the ICT-Tool.
This number is used to identify identical hardware.
The default value is 0.

RO-ETH_ipAddress
This entry is only required for the connection to our ETH modules.
The IP address of the ETH modules can be set via the ICT-Tool as well as via the
web interface of the module.

Software description | Seite 111


Compiling the Delib CLI sample
To compile the test program, open a terminal window and navigate with the
command
"cd /<directory path>" to the "../delib_cli/" directory.
Hint: If there are spaces in your folder name, enter them as shown in the
example below
in " " as shown in the example below.

To compile, now open the desired shell script with the command
"sudo sh ./<DATEINAME>"
· ETH - "1_compile_delib-cli_eth.sh"
· USB - "2_compile_delib-cli_usb.sh"

If necessary, enter your user password.

If the compilation was successful, "compiling successfull" should now appear


in the terminal window. The file "delib_cli" has been created in the directory. Now
you can compile the sample program with
"sudo ./delib_cli [command] [channel] [value | unit ["nounit"] ] ".

IMPORTANT!! You need admin rights to run it. Therefore use the command with
"sudo".

Software description | Seite 112


Software description | Seite 113
5.4.2.2. DELIB CLI Examples
Digital outputs
sudo delib_cli DO1 17 1
switches on the 18th digital relay of a USB module

sudo delib_cli DO1 3 0


switches off the 4th digital relay of a RO-ETH module

Digital inputs
sudo delib_cli DI1 3
Example of a return value: 1
read the state of the 4th digital input of a USB module and return it

sudo delib_cli DI8 0 hex


Example of a return value: 0xFF
(a signal is present on channels 1 to 8)
read the value of digital input 1-8 of a RO-ETH module as hexadecimal
number

sudo delib_cli FF 0
Example of a return value: 192
(a change of state has been detected on channels 7 and 8).
read the value of the FlipFlops of the digital inputs 1-32

sudo delib_cli FF 32
Example of a return value: 65535
(a change of state has been detected on channels 33 to 64).
read the value of the FlipFlops of the digital inputs 33-64

sudo delib_cli FF 0 hex


Example of a return value: 0xD00
(a change of state was detected on channels 9, 11 and 12)
read the value of the FlipFlops of the digital inputs 1-32 as hexadecimal
number

Software description | Seite 114


Analog outputs
sudo delib_cli AO 7 4711
sets the decimal value 4711 to the 8th analog output of a USB module

sudo delib_cli AO 6 0x4711


sets the hexadecimal value 0x4AF1 to the 7th analog output of a RO-ETH
module

Analog inputs
sudo delib_cli AI 2
Example of a return value: 1234
reads the value of the 3rd analog input as decimal number of a USB
module

sudo delib_cli AI 2 hex


Example of a return value: 0x1FA
reads the value of the 3rd analog input as hexadecimal number of a RO-
ETH module

Software description | Seite 115


ICT-Tool

VI

ICT-Tool | Seite 116


6. ICT-Tool
The ICT-Tool gives you full control over your DEDITEC modules. With this all-in-
one software,
you can flash, configure and test your module without additional software. This
is particularly important for the initial commissioning of the module.
In the following chapters, the various areas of the ICT-Tool are described in
more detail.

6.1. General descriptions


Description Program start:

1. Displays the name of the DEDITEC software used


2. Displays the currently used version number of the software
3. Displays the DELIB version currently in use
4. The list of added modules is updated here
5. Click on the EN or DE to change the language between English and German
6. Closes the program

ICT-Tool | Seite 117


7. In the Selectors module, you can switch between the individual areas of the
software (a module must first be added)
8. You can add a module to the software using the + symbol. You can find more
information on this in the chapter: Add module

ICT-Tool | Seite 118


Beschreibung bei erfolgreicher Modulverbindung

1. Displays the current firmware version of the interface module

2. Calls up the information window (see below). There you will find all I/O-
specific information

3. Indicates whether the module is encrypted or unencrypted

4. Indicates whether there is a connection to the module

5. Displays the IP address of the module (via Ethernet) or the module number
(via USB)

6. Closes the module and takes you back to the module selector

7. Displays the current network configuration, firmware and module ID of your


module

8. Opens the manual for your module locally as a PDF

9. Opens the manual for your module in the browser as an HTML version

10. Shows you all available module IDs. This is required for programming your

ICT-Tool | Seite 119


own projects.

ICT-Tool | Seite 120


Information window
Depending on the connected module, information on the interface and
submodules used is displayed here.
Among other things, you can see the number of connected inputs and outputs
and which DEDITEC commands are supported.

In this example, a WEU-RELAIS-8 from our Startet series with 8 digital outputs
was connected via Ethernet.

ICT-Tool | Seite 121


6.2. Add module
To be able to use our products with the ICT-Tool, they must be added to the
start screen of the program.

USB modules
ModulesWith our modules with USB interface, this is done automatically via
plug and play. The modules are displayed directly on the start screen and can be
used immediately.

CAN modules
As our CAN modules are also configured via the USB interface, no further
settings are necessary here either.
This does not apply to our older RO-CAN1 series modules, which are also
integrated in the same way as our Ethernet and serial modules, as explained in
the next step.

Ethernet and serial modules


Click on the + symbol to add our products with an Ethernet or serial interface
and our modules from the old RO-CAN series to the ICT-Tool.
In the following window, you have the option of selecting the module directly
using the quick selection on the left-hand side of the screen or you can navigate
to the desired product using the series preview images.

ICT-Tool | Seite 122


In the following chapters you will find more detailed information on integrating
and configuring the interface of your module.

ICT-Tool | Seite 123


6.2.1. USB Module
Our USB modules are connected via plug and play. The modules are
automatically recognized and can be used immediately.
If there are several USB modules of the same series, the module number of the
module must also be changed.
Further information on this can be found in the chapter: USB configuration

ICT-Tool | Seite 124


6.2.2. ETH Module
To add Ethernet modules, you have the option of doing this via a registry entry
or directly via the IP address of the module. The following table illustrates the
respective advantages and disadvantages.

Ethernet Standard Ethernet direct

General · Administration rights may be · No Administration rights are


required required

Installation · The required .DLL and driver · No installation necessary. The


files are installed using the corresponding DLL only needs to
DELIB setup be in the program directory

Configure modules · Simple configuration using the · Simple configuration using the
ICT tool ICT tool
· Module configurations are · Module configuration on the
entered in the Windows registry computer is not necessary, as
the IP address is entered
directly into the application
software

Addressing the modules via your · Simple integration into a project, · DapiOpenModuleExt opens the
own software as ModuleID and ModuleNR are module directly, specifying the
used (DapiOpenModule) IP address etc.
· Application software does not
need to know the IP address, as
this is stored on the computer in
the registry. This makes it
easier to distribute software to
different computers

Third-party applications (e.g. · DapiOpenModule command · is often more difficult in our


LabView) requires only 2 parameters, experience
therefore easy to integrate

ICT-Tool | Seite 125


6.2.2.1. Ethernet standard method
Here you can add your module via a registry entry.

Quick selection

Available
Modules that have already been added are listed here. The number in brackets
corresponds to the assigned module number

New module
All unused module numbers are listed here. The number in brackets corresponds
to the assigned module number.

Configuration

Module status
With this option, you can add an ethernet module to the ICT tool. If the check
mark is not set, the module is removed again.

ICT-Tool | Seite 126


IP/Hostname
You can enter the IP address of the module here. If the "use Hostname"
checkbox is ticked, the configured hostname is used.

Port
The port number of the module is entered here. The "default port" button writes
the default port "9912" in the field

Timeout
The timeout of the module can be set here. (milliseconds)

Encryption type
Here you can set whether the module should be used unencrypted or encrypted
(User/Admin).

Search via Broadcast


Available modules in the network can be found here. More on this in the chapter:
Search via broadcast

Identify Module
You can use the Identify function to visually check on the board which module
is being addressed with the IP entered.
When starting the identification, the status LED of the respective module starts
to flash very quickly. This is particularly helpful when using several
several modules.

SAVE/TEST
Here you can save the settings you have made and test communication with
the module.
(Administration rights may be required)

EXIT
This takes you back to the module selector

ICT-Tool | Seite 127


6.2.2.2. Ethernet Direct method
Here you can insert your module directly via the IP address.

Configuration

IP/Hostname
You can enter the IP address of the module here. If the "use Hostname"
checkbox is ticked, the configured hostname is used.

Port
The port number of the module is entered here. The "default port" button writes
the default port "9912" in the field

Timeout
The timeout of the module can be set here. (milliseconds)

Encryption type
Here you can set whether the module should be used unencrypted or encrypted
(User/Admin).

ICT-Tool | Seite 128


Search via Broadcast
Available modules in the network can be found here. More on this in the chapter:
Search via Broadcast

Identify Module
You can use the Identify function to visually check on the board which module
is being addressed with the IP entered.
When starting the identification, the status LED of the respective module starts
to flash very quickly. This is particularly helpful when using several
several modules.

SAVE/TEST
Here you can save the settings you have made and test communication with
the module.
(Administration rights may be required)

EXIT
This takes you back to the module selector

ICT-Tool | Seite 129


6.2.2.3. Search via Broadcast
You can use the broadcast function to find and add modules that are
connected to the network.

Select
This accepts the module's preconfigured network settings.

Ident
You can use the Identify function to visually check on the board which module
is being addressed with the selected IP.
When starting the identification, the status LED of the respective module starts
to flash very quickly. This is particularly helpful when using several
several modules.

Edit
Here you can directly change the network settings of the selected module and
save them in the module.

ICT-Tool | Seite 130


6.2.3. CAN Module
CAN modules are connected to the PC via the USB interface for configuration.
Settings on the CAN interface and the TX and RX packets can be made in the
configuration area.
Further information can be found in the chapter: CAN configuration

ICT-Tool | Seite 131


6.2.4. SER Module
Here you can assign serial modules to a free COM port.
The serial interface can be configured in the configuration area. You can also
set there
whether you want to use the module via the serial interface with the ICT tool.
Further information on this can be found in the chapter: Serial configuration

Quick selection

Available
Modules that have already been added are listed here. The number in brackets
corresponds to the assigned module number

New module
All unused module numbers are listed here. The number in brackets corresponds
to the assigned module number.

ICT-Tool | Seite 132


Configuration

Module name
Displays the selected module

Module status
With this option, you can add a serial module to the ICT tool. If the check mark
is not set, the module is removed again.

COM-Port
Here you can assign a free COM port to the module.

Communication attempts in the event of an error


Here you can set how often attempts should be made to access the interface in
the event of an error before actions are terminated.

SAVE/TEST
Here you can save the settings you have made and test communication with
the module.
(Administration rights may be required)

EXIT
This takes you back to the module selector

ICT-Tool | Seite 133


6.3. Configure module
The module's configuration settings can be viewed or changed in the
configuration area.

ICT-Tool | Seite 134


6.3.1. Module info
The ICT-Tool not only allows you to configure your module quickly and easily,
you can also display a lot of important module information at a glance.

Module name
Displays the name of the DEDITEC module currently in use.

Module ID
Displays the ID of the module you are using. This is required for programming
your own software with DELIB commands.

Firmware version
Displays the current firmware version installed on the module.

DIP switch positions


Displays the current DIP switch setting of your ETH interface.

ICT-Tool | Seite 135


6.3.2. Module identification
Identifies the module that you are currently addressing with the ICT-Tool to
prevent confusion.
This is particularly helpful if several modules are in operation at the same time.
Identification is started by pressing the “Identify module” button.
Depending on the module series, the following LEDs flash on your module:
· The “Int.Act” LED flashes on our ETH_LC modules
· The “Status” LED flashes on our WEU modules

ICT-Tool | Seite 136


6.3.3. Module restart
You can restart your module here.

Module status
Indicates whether the connection to the module has been successfully re-
established after the restart.
OK: Connection was successfully established
Error: Module not found after restart

ICT-Tool | Seite 137


6.3.4. USB configuration
You can change the module number of your USB module here.
This is necessary if you want to operate several modules of the same type.
To be able to open the correct module, the corresponding module number is
required in addition to the module ID.

Current module no.


Shows which module number is currently assigned

New module no.


You can assign a new module number to the module here.

ICT-Tool | Seite 138


6.3.5. LAN network information
Here you will find all the important LAN network information for your module at
a glance.

MAC address
The MAC address is the physical address of the product and is permanently
linked to the hardware.

Board Name
Displays the current board name of your module.

LAN status
The connection status of your connected module is displayed here.
If the status "Query not supported (FW update)" is displayed, your module
requires a more up-to-date firmware.

ICT-Tool | Seite 139


DHCP active
Indicates whether the module is connected via DHCP.

IP address, netmask, standard gateway and TCP port


Displays the current network configuration to which the module is connected.

ICT-Tool | Seite 140


6.3.6. LAN network settings
Here you can configure the LAN network settings of your module.

Board Name
The board name can be used for device identification. If DHCP is active, the
board name is used as the host name.
This option is particularly useful when using several modules.
For example, you can assign a special board name such as "Garage" or "Gazebo"
to a module. You can then control the module directly in the module selector
under this name.
More information on connecting the module by board name
see chapter: Using the module selector

ICT-Tool | Seite 141


DHCP active
If this option is activated, the device attempts to obtain a valid IP address from
a DHCP server in the network at startup.
The board name is used as the host name. If DHCP is activated via the DIP
switch, this setting is ignored.

IP address, subnet mask, default gateway and TCP port


These settings are used if DHCP is deactivated.

Load factory settings


The IP configuration is reset to the factory settings here. These look as follows:

Factory settings

Board name Module dependent

DHCP off

IP-Adresse 192.168.1.1

Subnet mask 255.255.255.0

Default gateway 192.168.1.254

TCP Port 9912

ICT-Tool | Seite 142


6.3.7. WiFi network information
Here you will find all the important WiFi network information for your module at
a glance.

MAC address
The MAC address is the physical address of the product and is permanently
linked to the hardware.

Board Name
Displays the current board name of your module.

ICT-Tool | Seite 143


WLAN status
The connection status of your connected module is displayed here.
If the status "Query not supported (FW update)" is displayed, your module
requires a more up-to-date firmware.

WLAN active
Indicates whether the module is connected via WLAN.

IP address, netmask, standard gateway and TCP port


Displays the current network configuration to which the module is connected.

Router name
Shows which router name is used to connect via WLAN.

Router password
Displays the router password used.

ICT-Tool | Seite 144


6.3.8. WiFi network settings
Here you can make changes to the WiFi settings of your module.

Board name
The board name can be used for device identification. If DHCP is active, the
board name is used as the host name.
This option is particularly useful when using several modules.
For example, you can assign a special board name such as "Garage" or "Gazebo"
to a module. You can then control the module directly in the module selector
under this name.
For more information on connecting the module by board name, see chapter:
Using the module selector

ICT-Tool | Seite 145


WLAN active
You can use this option to activate or deactivate your module's WLAN.

Router name
Here you can enter the router name to be used for a connection via WLAN.

Router password
You can enter the router password of the router used here.
If necessary, ask your system administrator.

TCP port
The TCP port used is shown here. The port can only be changed for LAN network
configurations.

Load factory settings


The WiFi configuration is reset to the factory settings here. These look as
follows:

Factory settings

Board name Module dependent

WLAN active off

Router name DefaultSSID

Password DefaultPWD

ICT-Tool | Seite 146


6.3.9. WiFi WPS connection
Here you can connect your module to your PC network using the WPS function.

To do this, press the “WPS Start” button in the ICT-Tool (see image below) or
press and hold the Config button on your module for 7 seconds.
The WPS status should now change to “starting WPS connection”. Now start
the WPS search on your router.
If the connection is successful, the WLAN status changes to “DHCP is ON”. The
router name and password used will also appear.

ICT-Tool | Seite 147


6.3.10. NTP configuration
Changes to the NTP service can be made here.

NTP service active


If this option is activated, the NTP service is activated.

Server
Here you can set the NTP server to be used.

Port
Here you can set the NTP port to be used.

ICT-Tool | Seite 148


Timezone
Here you can set the time zone to be used by the module.

Load factory settings


The TCP encryption settings are reset to the factory settings here. These look as
follows:

Factory settings

NTP service active on

Server 0.de.pool.ntp.org

Port 123

Timezone (GMT) Greenwich Mean Time:


Dublin, Edinburgh, Lisbon, London

ICT-Tool | Seite 149


6.3.11. TCP encryption
1.Access and recovery options
To ensure tap-proof TCP communication between the user and the module, this
can be encrypted using a password. Encryption takes place automatically in
delib.dll.
The user's entries are transmitted in encrypted form, decrypted by the module
itself and then executed.

In order to also write the password securely to the module, in addition to direct
configuration via USB, it is also possible to encrypt the password in the ICT tool
via Ethernet using the temporary admin mode.
When configuring with the temporary admin mode, switches or buttons must be
physically operated directly on the board to ensure that no unauthorized person
can carry out this configuration.

The following encryption options are available:

Encryption type Meaning

unencrypted The module can be accessed


unencrypted

user encryption · TCP transmission is encrypted


· The I/Os can be accessed, but no
changes can be made to the module
configuration

admin encryption · TCP transmission is encrypted


· Full access to I/Os and module
configuration

temp admin Temporary encryption mode to transfer


the set password to the module in
encrypted form

Attention: If the options "Allow unencrypted protocol" and "Allow admin-

ICT-Tool | Seite 150


encrypted protocol" are deactivated, you can no longer make any settings to
the module configuration.

If you no longer have access to the module, you can change the encryption
settings as follows:
a) via USB: For modules with USB and Ethernert interface, you can make
settings to the module configuration at any time via USB cable.
b) via web interface: You can make and save encryption settings via the web
interface.
c) via DIP switch: With DIP-3 you can activate the factory settings of the
module. This allows you to make and save changes to the encryption settings.

Remark
Please note that changes to the DIP switches only take effect after the module
has been restarted.

ICT-Tool | Seite 151


2. General information

Allow unencrypted protocol


This configuration is used to activate or deactivate unencrypted access.
on = allows unencrypted access
off = only encrypted access is permitted

Allow user-encrypted protocol


With this option, you allow access to the module via user protocol.
Users who have this access can only operate the I/Os of the module.
Changes to the module configuration, e.g. LAN configuration, cannot be made.
A user password is required for this option.

ICT-Tool | Seite 152


Allow admin-encrypted protocol
With this option, you allow access to the module via admin protocol.
Users who have this access can change the module configuration and operate
the I/Os of the module.
An admin password is required for this option.

Allow I/O access via webinterface


Use this option to activate or deactivate access to the module via the web
interface.

3. setting the encryption


Select one or more encryption options as required and, if necessary, assign a
secure password.
In the image above, it has been specified that the module can be opened either
via user or admin access.
The unencrypted and web interface access have been deactivated.
Next, go back to the module selection and click on the cogwheel of the now
encrypted module.

Using the "Encryption type" option, you can now specify whether the module
should be opened as User or Admin.
Enter the previously defined password in the text field to the right and save the
change.
The module now starts with the defined access rights.

ICT-Tool | Seite 153


The image below shows that the module should be opened with user access.

ICT-Tool | Seite 154


6.3.12. WEB-Login
Here you can make settings on the module's web interface.

Session Time
Specifies the number of seconds of inactivity on the web interface after which
the user is automatically logged out.
Setting from 10 - 65535 seconds possible.

Account name
Specifies the user name for logging in to the web interface.
Please note that it is case-sensitive.

Account password
Specifies the password for logging in to the web interface.
For security reasons, the password must also be confirmed by re-entering it.
Please note that the password is case-sensitive.

ICT-Tool | Seite 155


6.3.13. Serial configuration
Here you can carry out the entire configuration of our products with serial
interface.

Preferred mode (Special mode)


In preferred mode, the module is automatically operated with the following
settings:
Baud rate: 115200
Modul-Nr. 0
Echo = Off
Register-Mode = On

ICT-Tool | Seite 156


Baud rate
If the preferred mode is deactivated, the communication speed can be set.
625000
250000
125000
115200
57600
50000
38400
19200
9600
4800
2400
1200
600
300

RS485 modul address


Address for identification in the RS485 bus.

Echo
Characters received serially are sent back by the module.

DT-SER-CMD-MODE
Deactivate the register mode to activate the text mode.
This option must be activated in order to access the ICT tool via the serial
interface.

ICT-Tool | Seite 157


Load factory settings
Hier wird die serielle Konfiguration auf die Werkseinstellungen zurückgesetzt.
Diese sehen wie folgt aus:

Factory settings

Special mode activate OFF

Baud rate 115200

RS485 module adress 0

Echo activate OFF

DT-SER-CMD-MODE activate OFF

ICT-Tool | Seite 158


6.3.14. I/O channel names
You can set the channel names of your main module or submodule here.

Note:
The channel name may be a maximum of 16 characters long.

Set default channel name


Write the text shown above as a suggested name in the text fields.
You must also save it to apply it to the module.

ICT-Tool | Seite 159


6.3.15. D/A default values
Here you can set the D/A mode and value of the respective channels of your
module with which the module is to be started.

Mode
Here you can set the D/A mode that the respective channel should have at
module start.

Value
Here you can set the D/A value that the respective channel should have at
module start.

ICT-Tool | Seite 160


6.3.16. CAN configuration
6.3.16.1. CAN status interface
All important information about your CAN interface is displayed here

CAN baud rate


Displays the currently set baud rate of your CAN interface

DT-CAN-CMD-MODE - Module address [hex]


Determines the address under which the module is identified in the CAN bus.

DT-CAN-CMD-MODE - Response address[hex]


Specifies the module address to which a confirmation is sent as soon as a
packet is received.

CAN is active
(only displayed if the module supports this function)

Use EXT ID
Displays the extended ID of the interface module used

CAN config mode selection

ICT-Tool | Seite 161


Displays the CAN configuration mode used

ICT-Tool | Seite 162


6.3.16.2. CAN statistics TX/RX
All important statistics for the TX and RX packages are displayed here.

The following TX information is displayed:


· Total number of packages sent
· Number of packets sent per second
· Average time required to send a parcel

The following RX information is displayed:


· Total number of packages received

ICT-Tool | Seite 163


6.3.16.3. CAN Main Interface
These settings can be used to configure the CAN interface.

Baud rate
The baud rate at which the module should communicate can be set here.

Address Mode
The address mode specifies how many bits are used for addressing.

DT-CAN-CMD-MODE - Modul-Address[hex]
Determines the address under which the module is identified in the CAN bus.

DT-CAN-CMD-MODE - Response-Address[hex]
Specifies the module address to which a confirmation is sent as soon as a
packet is received.

ICT-Tool | Seite 164


6.3.16.4. CAN Main I/O Init
These settings are used to configure the connected submodules. The respective
filter / mode in which the connected submodules are started can be set.

A/D mode
The value range specifies the range in which analog signals are converted
digitally (e.g. in the 0-10V range).

A/D filter
The A/D filter can be set here.

D/A mode
The value range specifies the range in which digital signals are converted to
analog (e.g. in the 0-10V range).

Counter mode
Is responsible for the counter mode. You can choose to count up with 16 bits or
count up and down with 8 bits each.

ICT-Tool | Seite 165


Timeout mode
The timeout mode can be set here. More information on the individual modes
can be found in the chapter: DapiSpecialCMDTimeout. If no timeout is required,
it can be deactivated with "Deactivate".

Output Timeout
Specifies the time after which the outputs switch off if a module can no longer
be reached.

CNT48 mode
Sets which counter mode is to be used. There are 6 different modes to choose
from.

CNT48 submode
Depending on the mode selected under "CNT48 Mode", corresponding submodes
are available for selection here.

CNT48 filter
Sets the filter for how long a signal must be at least for it to be recognized as
high. You can choose from 16 predefined filters between 20ns and 5ms.

ICT-Tool | Seite 166


6.3.16.5. CAN TX Mode
Here you can make settings for the TX packages.

Activate
Activates this TX mode

Trigger mode
Specifies which mode should be used for sending. The following modes are
available for selection: "Interval" , "RX event" and "Fast as possible" modes.

ICT-Tool | Seite 167


Interval
If the interval mode is set, you can also specify the time interval at which the
transmission should take place.

Address mode
Specifies the bit mode to be used. You can choose between 11-bit mode and 29-
bit mode.

Send to CAN-ID[hex]
Sends the CAN packets to this address. In the example above, the packet is sent
to address 0x200.

Mode
Here you can specify which data should be sent to the previously set address.

ICT-Tool | Seite 168


6.3.16.6. CAN RX Mode
You can make settings to the RX packages here.

Activate
Activates this RX mode

Address mode
The 11-bit or 29-bit address mode can be set here.

Receive at CAN-ID[hex]
Specifies the recipient address. In the example above, a CAN packet is received
at address 0x100.

Mode
If a packet is received at the set address, the content of the data packet is
forwarded to the digital outputs 1-64, whereupon the outputs are switched on or
off.

ICT-Tool | Seite 169


6.3.17. Watchdog configuration
You can make settings on your watchdog stick here.

Deactivated
Relay 1 and 2 monitoring not active

Activated
Relay 1 and 2 monitoring active

Retriggered
Watchdog time relay 1 and 2 is reset

Timeout
Watchdog time relay 1 and 2 was not reset

Relais Setting after x msec


Time-delayed switching of the relays after a timeout

ICT-Tool | Seite 170


6.4. M2M configuration
M2M stands for “Machine-to-Machine” and represents direct communication
between two or more devices.
It enables, for example, the automated transmission of measured values or
remote monitoring of machines and systems.

The possibility of M2M transmission between our DEDITEC modules is


supported by two interfaces, Ethernet and CAN.

For M2M communication via Ethernet, it must be noted that the transmitter
module must explicitly have the M2M function.
However, all DEDITEC products with an Ethernet interface can be used as
receiver modules.

M2M communication via the CAN interface is supported by all our CAN
modules.
Settings can be made in the CAN configuration area of the ICT tool.
You can find more information on this in the chapter: CAN-Configuration

ICT-Tool | Seite 171


6.4.1. Statistics
Here you get an overview of the activity of the transmitter and receiver module

The following transmitter information is displayed:


· Activity status: If the check mark is set, this action is currently being carried
out
· Total number of actions performed. Is reset to 0 after a module restart
· Number of actions per second
· Number of DELIB errors occurring when executing commands from the
DEDITEC driver library. You can find help for debugging errors in the chapter:
DELIB-DebugView-Global

The following receiver module information is displayed:


· Connected: If the check mark is set, the transmitter and receiver modules are
connected to each other
· IP address of the receiver module
· Number of connection attempts

ICT-Tool | Seite 172


6.4.2. Receiver module
You can set the network settings of the receiver module here.

Designation
Enter the desired name for the receiver module here.

IP address / Port
You can specify the network settings of the receiver module here.

Timeout[msec]
The timeout specifies how long an attempt should be made to establish a
connection to the module. If this time is set too short, the timeout may be
triggered before the module has been opened properly. The duration of the
connection attempts after a connection to the module is lost is also specified
with the timeout.

Encryption type / pw
Here you can specify the encryption settings of the receiver module.
These settings are used to establish the connection to the receiver module.
Make sure that these settings have also been made in the receiver module.

ICT-Tool | Seite 173


You can find more information on this in the chapter: TCP encryption

ICT-Tool | Seite 174


6.4.3. Jobs
Use an job to define which input signal is to be sent from the transmitter
module to which output of a receiver module.
In this image example, DI data is sent every 100ms from channel 3(CH Start) to
channel 8 ((CH Start) + (CH Count)) to channels 0-5 of the receiver module.

Job
Here you can specify whether you want to send digital or analog input signals.

Mode
In normal mode, the current states of the input channels are transmitted to the
receiver module.
In test mode, alternating high / low packets are transmitted to the receiver
module. This makes it easier for you to check your transmit/receive
configuration.

Receiver module
Here you can select which receiver module should receive the information. The
receive module is defined in the "Receive modules" tab.

ICT-Tool | Seite 175


Interval
Set the time intervals at which the transmitter module should send the
information.

Transmitter module start channel


Set the input channel from which the information is to be sent to the receiver
module.

Number of channels to be transmitted


Enter the number of input channels to be transmitted to the receiver module
here, starting with your entry in the &quot field;Transmitter module start
channel"

Receiver module start channel


Set here from which output channel of the receiver module the information is to
be output by the transmitter module.

ICT-Tool | Seite 176


6.5. Event control
The event control can be used to configure actions that are automatically
executed by the module as soon as a certain condition is met.
Both the event condition and the action can be set separately.

Which events and actions can be configured depends on the module.


You can find help on configuring the event here: Configuration events
You can find help on configuring the action here: Configuration actions

The following module series are supported by Event Control:


· BS-WEU series
· BS-USB series
· NET series
· UC series
· CANBox series

The following module series are not supported by Event Control:


· Starter series
· RO series
· COS series

ICT-Tool | Seite 177


6.5.1. Statistics
Various information about the events and actions is displayed here.

ICT-Tool | Seite 178


6.5.2. Event configuration
With the help of an event, a certain action is executed as soon as a condition is
fulfilled.
For example, voltages can be automatically output via the D/A converter or
relays can be switched when a previously defined switching threshold is
reached at the A/D inputs,
or a signal is detected at a digital input.
You can also specify how long the condition must be fulfilled before an action
can be carried out.
These settings are saved directly in the Modul-Configuration-Memory of the
module.

Depending on the features of your product, you can choose from different
modes:

"DI"
High or low signal of a digital input.

"DI flip-flop"
If the status of the digital input changes, the flip-flop of the channel is set and
then reset again.

"DO readback"
The status of the output channel is read out and returned using a DO readback
command.

"A/D"
The current voltage of the analogue input is read out.

ICT-Tool | Seite 179


ICT-Tool | Seite 180
6.5.3. Actions
An action defines what should happen within an event once a condition has
been met.

Different modes can be defined depending on the features of your product:

"Set DO output"
Switches a digital output on or off.

"Set D/A output"


Outputs voltage at an analogue output.

"Send CAN packet"


The set CAN TX event is triggered.
For this function, the trigger mode in the CAN TX package must be set to "TX-
Event".
You can find more information on configuring the TX mode in the chapter: CAN
TX-Mode.

ICT-Tool | Seite 181


6.6. Test module
Tests can be carried out on the modules in the I/O area.

6.6.1. Timeout test function


Timeout settings can be made in the "Read/Write" area.
These functions can be used to trigger a timeout case.

1 The field flashes repeatedly to indicate whether there is a connection to the


module. If the field remains empty, communication is interrupted.
2 Unchecking the box interrupts the connection and triggers a timeout. Ticking
the box again restores the connection.
3 As the user interface is not updated automatically in the event of a timeout,
this can be triggered by clicking on the "Manual" button.
4 The current timeout status is displayed here.
5 The desired timeout mode can be set here. For more information, see chapter:
DapiSpecialCMDTimeout.
6 Here you can set the time at which the timeout should be triggered.
7 "Activate" activates the timeout. Deactivate" deactivates it.

ICT-Tool | Seite 182


6.6.2. Digital Out
Here you can switch the individual digital outputs of your module on and off.
An LED on each output relay on the board of your module indicates the current
status of the output (LED on = relay on).

On/Off
Switches the respective output relay on or off.

Readback
Displays the current status of the respective relay (on or off).

Switch all states OFF / Switch all states ON


With these buttons, all outputs of the module can be switched on or off
simultaneously.

ICT-Tool | Seite 183


Switch channels with timer function
(Only displayed if supported by the module)
In the timer area, enter a time (in seconds) after which the relays should be
switched on or off. Press "set" to start the timer.

Invert DO-Timer
If this option is activated, the relay is deactivated after the timer has expired. If
this option is deactivated, the relay is activated after the timer has expired.

ICT-Tool | Seite 184


6.6.3. Digital TTL
Here you can switch the individual digital outputs of your module on and off.
An LED on each output relay on the board of your module indicates the current
status of the output (LED on = relay on).

On/Off
Switches the respective output relay on or off.

Readback
Displays the current status of the respective relay (on or off).

ICT-Tool | Seite 185


Switch all states OFF / Switch all states ON / Test 1000x all on/off
These buttons can be used to switch all of the module's outputs on or off
simultaneously.
With the "Test 1000x ll on/off" test button, the outputs of the module are
automatically switched on and off 1000 times.

Set TTL direction


Here you can set the direction (input/output) of your module 8-channel by 8-
channel.
These settings are retained until the module is restarted.

ICT-Tool | Seite 186


6.6.4. Digital In
Here you will find information on the digital inputs, as well as the input counter
and the flip-flop filter.

State on/off
Shows the current status of the individual input channels.

Counter
Displays the counter readings of the input counters.

FlipFlop
Displays the change in input status since the last readout.

Read with reset


This option is used to specify whether the counters are to be reset the next time
they are read.

ICT-Tool | Seite 187


6.6.5. Digital In Counter
You can test your Digital In Counter module here

Counter
Displays the current counter reading of the channel.

Latched
Displays the current counter reading of the buffer memory.

Filter
The input filter can be set here.

Mode
The counter mode can be set here.

Sub-Mode
The counter-sub mode can be set here.

Reset
All meter readings are reset here.

Latch

ICT-Tool | Seite 188


Reads all meter readings from the buffer memory and displays them.

ICT-Tool | Seite 189


6.6.6. Analog In
Here you can change and test settings in A/D mode.

Value
Reads out the value on the respective A/D channel.

Set mode for all channels


Selection of the voltage/current range for all channels in which measurements
are to be taken. Only modes that are supported by your module are displayed.

Mode readback
Reads the currently used A/D mode from the module.

Set filter for all channels


Selection of the A/D filter to be used for all channels.

Filter readback
Reads the currently used A/D filter from the module.

ICT-Tool | Seite 190


6.6.7. Analog Out
In this area, you can make and test settings on the D/A channels of your
module.

Value
The value to be output on the respective D/A channel can be entered here.

Mode
Selection of the voltage/current range in which the value of the respective
channel is to be output. Only modes that are supported by the module can be
selected.

Readback
Reads back the actual value of the respective D/A channel.

ICT-Tool | Seite 191


Set mode for all channels
This function can be used to change the voltage/current range for all available
channels at once.

ICT-Tool | Seite 192


6.6.8. Temp
Here you can read out the applied temperatures and the status of the sensor.

Value
Indicates the current temperature.

Status
Displays the current status of the temperature sensor.

ICT-Tool | Seite 193


6.6.9. Graphical representation
Here you can display read A/D, temperature and FIFO values graphically.

A/D Mode
Here you can specify the A/D mode of the A/D converter

A/D Filter
Here you can specify which A/D filter is to be used

Channel
Specifies which channel is to be displayed graphically

Interval [ms]
Specifies the interval at which the data should be read

ICT-Tool | Seite 194


Filter
Specifies how much data is to be displayed

Start / Stop
Starts or ends the graphical output

Reset
Deletes the current issue

ICT-Tool | Seite 195


6.6.10. CAN Runtime Parameter
Here you can make CAN settings on the TX and RX packets in runtime.
These changes are not saved in the module and are lost after a module restart.

Read
Reads out the current configuration of the respective parameter

Write
Saves the current configuration of the respective parameter

RX-/TX-Option
Here you can select which parameter you want to change.
The new value must be specified in HEX.

ICT-Tool | Seite 196


6.6.11. Puls Generator
You can test the Pulse Generator here.

Low-Time[ns], High-Time[ns], No. of Pulses


The low time, high time and the number of pulses to be generated can be set
here.

ICT-Tool | Seite 197


6.6.12. PWM Out
You can make settings to your PWM module here.

Value
Here you can set the PWM ratio of a channel.
PWM ratio from 0% to 100% in 1% steps

Readback (Value)
Indicates the PWM ratio of the respective channel.

Frequency
Here you can set the PWM frequency of the module

Readback (Frequency)
Returns the set PWM frequency.

ICT-Tool | Seite 198


Set mode for all channels
This function can be used to change the voltage/current range for all available
channels at once.

ICT-Tool | Seite 199


6.6.13. Watchdog switching behavior
You can test the switching behavior of the watchdog stick here

Watchdog enable
Activates the watchdog

Watchdog disable
Deactivates the watchdog

Watchdog retrigger
Resets the watchdog stick status

Watchdog auto retrigger


Automatically resets the status of the watchdog stick after the specified time

ICT-Tool | Seite 200


6.7. Diagnose module
In the Diagnostics area, you can diagnose the functionality of your I/Os.
You can run function tests and display the evaluation.
Additional cabling is required for the cable return tests. You can configure these
cables yourself,
or order them directly from our store.

6.7.1. Digital cable return test


In this test, digital outputs are switched in 8 blocks. The voltage is then sent to
the respective 8 digital inputs via a read-back cable and then read out.
It is important that the selected I/Os correspond to the wired inputs and
outputs. This test only works with an additional test cable.

ICT-Tool | Seite 201


DO State
Displays the status of the current output. Switching is automatic.

DI State
Displays the status of the current input. Switching is automatic.

ch area
Specifies which I/Os are to be used for the test.

delay (in ms)


Here you can set the delay time to be waited between the write and read
command.
This is required for relays that have a longer switching time.

Data write / Data read


Shows which value was written and read back. This happens automatically.
If necessary, check your wiring in the event of deviations

Total count
Shows how many commands have been executed.

Readback error count


Indicates whether there was an error during the test when reading back the
written value directly. This value is independent of the wiring.

Kabel-Verify error count


Indicates whether there was a deviation between the value sent and received via
the feedback cable during the test.

ICT-Tool | Seite 202


Delib error count
Indicates whether there was an error when executing a DELIB command during
the test.

Delay Time, min, max


Displays the time required for a DapiDOSet8, DapiDOReadBack64 and
DapiDIGet8 command.
Min/Max shows the lowest or highest value during the tests.

ICT-Tool | Seite 203


6.7.2. Analog cable return test
In this test, voltages in the range of +9/-9 V are applied to the selected D/A
channels and read out at the corresponding A/D channels using a feedback
cable.
It is important that the selected I/Os correspond to the wired inputs and
outputs.
This test only works with an additional test cable.
An additional A/D module can be used as a reference module for this test.

D/A channel
Specifies the D/A channel to be used for the test

Delay time in ms
Specifies the time to wait between a write and read command. This is required
for slower A/D converters.

ICT-Tool | Seite 204


A/D channel
Specifies the A/D channel to be used for the test

A/D filterlevel
Indicates which A/D filter level is to be used for this test

D/A to A/D duration


Shows how much time is required for a DapiDASet and DapiADGet command
(incl. delay time)

Total count
Shows how many commands have been executed.

Delib error count


Indicates whether there was an error when executing a DELIB command during
the test.

[< 10 mV], [>10 mV / < 100 mV], [ > 100 mv]


Shows how often the respective deviation range has occurred.

Max. deviation
Displays the highest deviation within a deviation range.

ICT-Tool | Seite 205


6.7.3. Access time tests
Depending on the module configuration, you can perform different access time
tests. In addition to register accesses, accesses to the digital and analog I/Os
of your module can also be tested.
The time required to send commands to the module or to request values from
the module is measured.
The test is carried out automatically with different bits or channels. Depending
on the interface used, different time measurements may occur.

Test evaluation
The lowest, highest and average time required is determined here. The access
time per second is also determined.

Test with delay


Here you can set the delay time between the commands with which the test is
to be executed

ICT-Tool | Seite 206


Total Count
Indicates how many commands have been executed

Test runs
Here you can select how often commands should be executed per bit or channel

Endless run
If this box is ticked, the test starts again from the beginning after each run.
The evaluations are saved and adjusted.

ICT-Tool | Seite 207


6.7.4. A/D noise graph
Here you can display the noise of an A/D channel graphically.

A/D Mode
Specifies which A/D mode is to be used for the test

A/D Filter
Specifies which A/D filter is to be used for the test

Channel
Specifies which channel should be displayed

Start
Starts the graphical output

Stop
Ends the graphical output

Reset
Resets the graphical output

ICT-Tool | Seite 208


6.7.5. A/D read with ripple
Here you can read out the A/D channels of your module and display the
deviations.

Value
Displays the voltage connected to the channel.

Offset
Displays the last deviation when measuring the voltage.

Set mode for all channels


Here you can change the A/D mode for all channels
mode_rb: Returns the written mode

Set filter for all channels


Here you can change the A/D filter for all channels
filter_rb: Returns the written filter level

Frequency_rb
Indicates the current frequency with which the deviation is measured.

ICT-Tool | Seite 209


Start/Stop
Start or end the test

6.7.6. FIFO In/Out


Here you can test the FIFO-In or FIFO-Out of the module

FIFO instance
Indicates which instance is to be used (FIFO-Out: 0-3, FIFO-In: 4-7)

Submodule nr.
Specifies which submodule is to be used for the FIFO read/write

Start channel
Specifies the start channel for the FIFO

End channel
Specifies the end channel for the FIFO

Frequency
Specify the frequency at which the FIFO is to be read/written

ICT-Tool | Seite 210


FIFO mode
Specifies which mode is to be used for the FIFO

TODO
How the FIFO should be read/written

ICT-Tool | Seite 211


6.7.7. Main Loop
Information on the main loop of your module is displayed here

Module type
Indicates whether it is an interface/submodule.

Number of runs (min/max)


Shows how often the main loop has been run through since the module was
started.

Run duration [ms] (min/max)


Shows how long a main loop run takes.

Evaluation time [sec]


Shows how many seconds the measurement has been running.

Session memory used


Shows the amount of session memory used.

ICT-Tool | Seite 212


6.7.8. Module-Config-Memory
Information on the Module-Config-Memory is displayed here

Mod_cfg_mem(EEPROM) Directory entries


Indicates how many directory entries exist in the Module-Config-Memory

Mod_cfg_mem(EEPROM) Free bytes


Specifies the number of free bytes in the Module-Config-Memory

Sess memory used


Indicates the number of bytes used in the memory

ICT-Tool | Seite 213


6.8. Firmware update
6.8.1. About DEDITEC firmware
Most DEDITEC products have their own microcontroller. This processor is
responsible for controlling all hardware processes.
The flasher integrated in the ICT-Tool can be used to subsequently change the
firmware required for the processor. With this tool, the customer has the option
of transferring newly published firmware versions directly to the module on site.

Note:
As new firmware versions usually "unlock" new functions for your product, we
therefore recommend that you regularly update the firmware of your DEDITEC
products.
Please note that the flashing process can only be carried out via one interface.
This may vary depending on the product series.

Install Flashfiles manually


In some cases it is necessary to update the flash files manually, e.g. if
administrator rights are not available on the PC.

Step 1
Download the latest version of the Flash files at
http://www.deditec.de/zip/deditec-flash_files.zip

Step 2
Unpack the downloaded ZIP archive into the following directory, depending on
the DELIB installation:

x86
C:\Program Files(x86)\DEDITEC\DELIB\programs\

x64
C:\Program Files\DEDITEC\DELIB\programs

ICT-Tool | Seite 214


6.8.2. Update flash files via ICT tool
You can download the latest firmware for your module here.
Under "Online firmware" you can see when the firmware was last updated on our
homepage.

ICT-Tool | Seite 215


6.8.3. Perform firmware update
You can update the firmware of your interface and submodule here.
To benefit from the latest functions and prevent errors, we recommend that you
always keep your DEDITEC product up to date.

ICT-Tool | Seite 216


1. Here you will find all the necessary information on the various firmware
versions. Under "Newest FW" you can see whether there is a newer firmware
version for your module.

2. All important information, error and status messages that occurred during the
flash process are entered here.

3. The flash process is started with the "Flash Module" button.

ICT-Tool | Seite 217


6.9. Settings
6.9.1. General
Here you can make general settings for the ICT-Tool.

Language
Specifies the language in which the ICT-Tool should be displayed.
Currently, only German and English can be selected.

ICT-Tool | Seite 218


6.9.2. Updates
Here you can search for the latest DELIB and firmware updates.

Check for updates on www.deditec.de when starting the program


Specifies whether to check for updates when the program is started.
A functioning Internet connection is required for this.

Search for and install DELIB updates


Here you can search for the latest DELIB updates

Search for and install firmware files


You can search for the latest firmware files here

ICT-Tool | Seite 219


6.9.3. Error log
Here you can make settings to the deditec_debug.log.
This is saved under the following path:
C:\Users\?USER?\AppData\Local\DEDITEC

Enable writing debug output to a debug.log


Specifies whether debug output should be written to an external .log

Activate log notification


Here you can set whether you want to be notified if the .log is too large or too
old

cccDelete the debug.log after...


Here you can set whether the debug.log should be deleted automatically if the
size or age of the file is exceeded

Delete the debug.log after...


Here you can set after how many days the log should be deleted

Maximum log size


Here you can set how large the log may be before it is deleted

ICT-Tool | Seite 220


6.9.4. DELIB-DebugView-Global
You can activate the debug output here. You can also set whether any errors
that occur should be displayed.
This is particularly helpful in the event of an error so that the module can be
debugged more quickly.
The information is written to a separate .log file and can also be output by
monitoring tools such as DEBUGView.

ICT-Tool | Seite 221


6.9.5. DELIB-DebugView-Details
Here you can set which and how detailed information should be recorded.
This is particularly helpful in the event of an error so that the module can be
debugged more quickly.
The information is written to a separate .log file and can also be output by
monitoring tools such as DEBUGView.

ICT-Tool | Seite 222


ICT-Tool | Seite 223
DELIB API Reference

VII

DELIB API Reference | Seite 224


7. DELIB API Reference
7.1. Available DEDITEC module IDs
Here you can find a list with all available module IDs.
This ID is needed for example to open the module and get a "handle".
More information can be found in the chapter DapiOpenModule.

Modul Name ID

USB_Interface8 1

USB_CAN_STICK 2

USB_LOGI_500 3

USB_SER_DEBUG 4

RO_SER 5

USB_BITP_200 6

RO_USB1 7

RO_USB 7

RO_ETH 8

USB_MINI_STICK 9

USB_LOGI_18 10

RO_CAN 11

USB_SPI_MON 12

USB_WATCHDOG 13

USB_OPTOIN_8 14

DELIB API Reference | Seite 225


Modul Name ID

USB_RELAIS_8 14

USB_OPTOIN_8_RELAIS_8 15

USB_OPTOIN_16_RELAIS_16 16

USB_OPTOIN_32 16

USB_RELAIS_32 16

USB_OPTOIN_32_RELAIS_32 17

USB_OPTOIN_64 17

USB_RELAIS_64 17

BS_USB_8 15

BS_USB_16 16

BS_USB_32 17

USB_TTL_32 18

USB_TTL_64 18

RO_ETH_INTERN 19

BS_SER 20

BS_CAN 21

BS_ETH 22

NET_ETH 23

RO_CAN2 24

RO_USB2 25

DELIB API Reference | Seite 226


Modul Name ID

RO_ETH_LC 26

ETH_RELAIS_8 27

ETH_OPTOIN_8 27

ETH_O4_R4_ADDA 28

ETHERNET_MODULE 29

ETH_TTL_64 30

NET_USB2 31

NET_ETH_LC 32

NET_USB1 33

NET_SER 34

NET_CAN_OPEN 35

NET_RAS_PI 36

USB_CANOPEN_STICK 37

ETH_CUST_0 38

WEU_RELAIS_8 39

WEU_OPTO_8 39

WEU_E_RELAIS_8 40

BS_WEU 41

BS_WEU_E 42

UC_USB 43

DELIB API Reference | Seite 227


Modul Name ID

UC_CAN 44

BS_USB2 45

CAN_BOX 46

DELIB API Reference | Seite 228


7.2. DELIB directory structure
After successful installation the following directory tree is available:

$DELIB_DIR
¦
¦ -> include Includes for programming languages
¦ -> lib Library
¦ -> lib\bc Borland Compiler Library
¦ -> prod_pics Product images
¦ -> programs Modul-Testprogramme
+- > USB-Driver Driver for USB modules

Please note that the "$DELIB_DIR" folder may vary, depending on the operating
system and DELIB version.

DELIB Installation Windows Path


Installation

32 Bit 32 Bit C:\Programs\DEDITEC\DELIB\

32 Bit 64 Bit C:\Programs (x86)\DEDITEC\DELIB\

64 Bit 64 Bit C:\Programs\DEDITEC\DELIB64\

DELIB API Reference | Seite 229


In addition, the following files are installed in the Windows System folder:
$SYSDIR\delib.dll, or $SYSDIR\delib64.dll (32 Bit, or 64 Bit DELIB version)
$SYSDIR\delibJNI.dll, or $SYSDIR\delibJNI64.dll (32 Bit, or 64 Bit DELIB
version)

$SYSDIR\ftbusui.dll
$SYSDIR\ftd2xx.dll
$SYSDIR\FTLang.dll
$SYSDIR\drivers\ftdibus.sys

Please note that the "$SYSDIR" folder may vary, depending on the operating
system and DELIB version.

DELIB Installation Windows Path


Installation

32 Bit 32 Bit C:\Windows\System32

32 Bit 64 Bit C:\Windows\SysWOW64

64 Bit 64 Bit C:\Windows\System32

DELIB API Reference | Seite 230


7.2.1. Include directory
The include directory created for the DELIB contains the files which describe
the corresponding library functions. These are given for the programming
languages C (.h), Delphi (.pas) and Visual Basic (.bas).

7.2.2. Library directory


This contains the file "DELIB.lib". It serves as a link for compiling own programs
which use the "DELIB.dll".

7.2.3. Library directory for Borland


For Borland Compiler there is a separate DELIB.lib, which is located in the
subdirectory "bc". This also serves as a link for compiling own programs that
use the "DELIB.dll".

7.2.4. Environment variables


Two environment variables point to important directories that contain files for
the C, Delphi and Visual Basic programming languages.

“DELIB_INCLUDE” points to the include directory.

%DELIB_INCLUDE% à c:\Programs\DEDITEC\DELIB\include"

“DELIB_LIB" points to the library directory.

%DELIB_LIB% à c:\ Programs\DEDITEC\DELIB\lib

7.3. Administrative functions


7.3.1. DapiOpenModule
Description
This function opens a specific module.

Definition
ULONG DapiOpenModule(ULONG moduleID, ULONG nr);

Parameter

DELIB API Reference | Seite 231


moduleID=Specifies the module to be opened (see delib.h)
nr=Specifies which one (in case of multiple modules) should be opened.
nr=0 1. Module
nr=1 2. Module

Return value
handle=Corresponding handle for the module
handle=0 Module was not found

Comment
The handle returned by this function is needed to identify the module for all
other functions.

Programming example
// Open USB module
handle = DapiOpenModule(RO_USB1, 0);
printf("handle = %x\n", handle);
if (handle==0)
{
// USB module was not found
printf("Module could not be opened\n");
return;
}

DELIB API Reference | Seite 232


7.3.2. DapiCloseModule
Description
This command closes an open module.

Definition
ULONG DapiCloseModule(ULONG handle);

Parameter
handle=This is the handle of an open module.

Return value
None

Programming example
// Close module
DapiCloseModule(handle);

7.3.3. DapiGetDELIBVersion
Description
This function returns the installed DELIB version.

Definition
ULONG DapiGetDELIBVersion(ULONG mode, ULONG par);

Parameters
mode=Mode used to read the version (must be 0).
par=This parameter is not defined (must be 0).

Return value
version=Version number of the installed DELIB version [hex].

Programming example
version = DapiGetDELIBVersion(0, 0);
//With version 1.32 installed, version = 132(hex)

DELIB API Reference | Seite 233


7.3.4. DapiSpecialCMDGetModuleConfig
Description
Diese Funktion gibt die Hardwareausstattung (Anzahl der Ein- und
Ausgangskanäle) des Moduls zurück.

Definition
ULONG DapiSpecialCommand(ULONG handle,
DAPI_SPECIAL_CMD_GET_MODULE_CONFIG, par, 0, 0);

Parameter
handle=Dies ist der handle eines offenen Moduls

Querying the number of digital input channels


par=DAPI_SPECIAL_GET_MODULE_CONFIG_PAR_DI

Query number of digital input flip-flops


par=DAPI_SPECIAL_GET_MODULE_CONFIG_PAR_DI_FF

Query number of digital input counters (16-bit counter)


par=DAPI_SPECIAL_GET_MODULE_CONFIG_PAR_DI_COUNTER

Query number of digital input counters (48-bit counter)


par=DAPI_SPECIAL_GET_MODULE_CONFIG_PAR_CNT48

Querying the number of digital output channels


par=DAPI_SPECIAL_GET_MODULE_CONFIG_PAR_DO

Querying the number of digital pulse generator outputs


par=DAPI_SPECIAL_GET_MODULE_CONFIG_PAR_PULSE_GEN

Querying the number of digital PWM outputs


par=DAPI_SPECIAL_GET_MODULE_CONFIG_PAR_PWM_OUT

Querying the number of digital input/output channels


par=DAPI_SPECIAL_GET_MODULE_CONFIG_PAR_DX

DELIB API Reference | Seite 234


Querying the number of analog input channels
par=DAPI_SPECIAL_GET_MODULE_CONFIG_PAR_AD

Querying the number of analog output channels


par=DAPI_SPECIAL_GET_MODULE_CONFIG_PAR_DA

Query number of temperature channels


par=DAPI_SPECIAL_GET_MODULE_CONFIG_PAR_TEMP

Query number of stepper channels


par=DAPI_SPECIAL_GET_MODULE_CONFIG_PAR_STEPPER

Return value

Querying the number of digital input channels


return=number of digital input channels

Query number of digital input flip-flops


return=number of digital input flip-flops

Query number of digital input counters (16-bit counter)


return=number of digital input counters (16-bit counter)

Query number of digital input counters (48-bit counter)


return=number of digital input counters (48-bit counter)

Querying the number of digital output channels


return=number of digital output channels

Querying the number of digital pulse generator outputs


return=number of digital pulse generator outputs

Querying the number of digital PWM outputs


return=number of digital PWM outputs

DELIB API Reference | Seite 235


Querying the number of digital input/output channels
return=number of digital input/output channels

Querying the number of analog input channels


return=number of analog input channels

Querying the number of analog output channels


return=number of analog output channels

Query number of temperature channels


return=number of temperature channels

Query number of stepper channels


return=number of stepper channels

Programmierbeispiele
ret=DapiSpecialCommand(handle,
DAPI_SPECIAL_CMD_GET_MODULE_CONFIG,
DAPI_SPECIAL_GET_MODULE_CONFIG_PAR_DI, 0, 0);
//Returns the number of digital input channels
ret=DapiSpecialCommand(handle,
DAPI_SPECIAL_CMD_GET_MODULE_CONFIG,
DAPI_SPECIAL_GET_MODULE_CONFIG_PAR_DO, 0, 0);
//Returns the number of digital output channels
ret=DapiSpecialCommand(handle,
DAPI_SPECIAL_CMD_GET_MODULE_CONFIG,
DAPI_SPECIAL_GET_MODULE_CONFIG_PAR_DX, 0, 0);
//Returns the number of digital input/output channels
ret=DapiSpecialCommand(handle,
DAPI_SPECIAL_CMD_GET_MODULE_CONFIG,
DAPI_SPECIAL_GET_MODULE_CONFIG_PAR_AD, 0, 0);
//Returns the number of analog input channels
ret=DapiSpecialCommand(handle,
DAPI_SPECIAL_CMD_GET_MODULE_CONFIG,
DAPI_SPECIAL_GET_MODULE_CONFIG_PAR_DA, 0, 0);
//Returns the number of analog output channels
ret=DapiSpecialCommand(handle,
DAPI_SPECIAL_CMD_GET_MODULE_CONFIG,
DAPI_SPECIAL_GET_MODULE_CONFIG_PAR_STEPPER, 0, 0);
//Returns the number of stepper channels

DELIB API Reference | Seite 236


7.3.5. DapiOpenModuleEx
Description
This function opens specifically a module with Ethernet interface. The
parameters IP address, port number, the duration of the timeout and the
encryption type can be determined.
The module is opened independently of the settings made in the ICT-Tool.

Definition
ULONG DapiOpenModuleEx(ULONG moduleID, ULONG nr, unsigned char*
exbuffer, 0);

Parameter
moduleID = Specifies the module to be opened (see delib.h)
nr = Specifies which module (in case of multiple modules) should be opened.
nr = 0 1. Module
nr = 1 2. Module
exbuffer = Buffer for IP address, port number, duration of timeout and
encryption type

Return value
handle = Corresponding handle for the module
handle = 0 Module was not found

DELIB API Reference | Seite 237


Comment
The handle returned by this function is needed to identify the module for all
other functions.
This command is supported by all modules with Ethernet interface.

Universelle Ethernet moduleID


The moduleID:
ETHERNET_MODULE = 29

is a universal Ethernet moduleID and can be used to address any Ethernet


product.

Encryption Type
The following encryption types are available:

DAPI_OPEN_MODULE_ENCRYPTION_TYPE_NONE =0
DAPI_OPEN_MODULE_ENCRYPTION_TYPE_NORMAL = 1
DAPI_OPEN_MODULE_ENCRYPTION_TYPE_ADMIN = 2

Programming example
// Open ETH-Module with parameter
DAPI_OPENMODULEEX_STRUCT open_buffer;

strcpy((char*) open_buffer.address, "192.168.1.10");


open_buffer.portno = 0;
open_buffer.timeout = 5000;
open_buffer.encryption_type = 0;

handle = DapiOpenModuleEx(RO_ETH, 0, (unsigned char*)


&open_buffer, 0);
printf("Module handle = %x\n", handle);

DELIB API Reference | Seite 238


7.4. Error handling
7.4.1. DapiGetLastError
Description
This function returns the last captured error. If an error has occurred, it must be
cleared with DapiClearLastError() otherwise every call to DapiGetLastError() will
return the "old" error.
If several modules are to be used, it is recommended to use
DapiGetLastErrorByHandle().

Definition
ULONG DapiGetLastError();

Parameter
None

Return value
Error code
0=no error. (see delib_error_codes.h)

Programming example
BOOL IsError()
{
unsigned char msg[500];
unsigned long error_code = DapiGetLastError();
if (error_code != DAPI_ERR_NONE)
{
DapiGetLastErrorText((unsigned char*) msg,
sizeof(msg));
printf("Error Code = 0x%x * Message = %s\n",
error_code, msg);
DapiClearLastError();
return TRUE;
}
return FALSE;
}

DELIB API Reference | Seite 239


7.4.2. DapiGetLastErrorText
Description
This function reads the text of the last captured error. If an error has occurred, it
must be cleared with DapiClearLastError() otherwise every call to
DapiGetLastErrorText() will return the "old" error.

Definition
ULONG DapiGetLastErrorText(unsigned char * msg, unsigned long msg_length);

Parameter
msg = Buffer for the text to be received
msg_length = Length of the text buffer

Programmierbeispiel
BOOL IsError()
{
unsigned char msg[500];
unsigned long error_code = DapiGetLastError();

if (error_code != DAPI_ERR_NONE)
{
DapiGetLastErrorText((unsigned char*) msg,
sizeof(msg));
printf("Error Code = 0x%x * Message = %s\n",
error_code, msg);

DapiClearLastError();

return TRUE;
}

return FALSE;
}

DELIB API Reference | Seite 240


7.4.3. DapiClearLastError
Description
This function clears the last error captured with DapiGetLastError().

Definition
void DapiClearLastError();

Parameter
None

Return value
None

Programming example
BOOL IsError()
{
unsigned char msg[500];
unsigned long error_code = DapiGetLastError();

if (error_code != DAPI_ERR_NONE)
{
DapiGetLastErrorText((unsigned char*) msg,
sizeof(msg));
printf("Error Code = 0x%x * Message = %s\n",
error_code, msg);

DapiClearLastError();

return TRUE;
}

return FALSE;
}

DELIB API Reference | Seite 241


7.4.4. DapiGetLastErrorByHandle
Description
This function returns the last captured error of a specific module (handle). If an
error has occurred, it must be cleared with DapiClearLastErrorByHandle()
otherwise every call to DapiGetLastErrorByHandle() returns the "old" error.

Definition
ULONG DapiGetLastErrorByHandle(ULONG handle);

Parameter
handle=This is the handle of an open module.

Return value
Error code
0=no error. (see delib_error_codes.h)

Programmierbeispiel
BOOL IsError(ULONG handle)
{
unsigned long error_code =
DapiGetLastErrorByHandle(handle);

if (error_code != DAPI_ERR_NONE)
{
printf("Error detected on handle 0x%x - Error
Code = 0x%x\n", handle, error_code);

DapiClearLastErrorByHandle(handle);

return TRUE;
}

return FALSE;
}

DELIB API Reference | Seite 242


7.4.5. DapiClearLastErrorByHandle
Description
This function clears the last error of a specific module (handle) captured with
DapiGetLastErrorByHandle().

Definition
void DapiClearLastErrorByHandle();

Parameter
handle=This is the handle of an open module.

Return value
None

Programming example
BOOL IsError(ULONG handle)
{
unsigned long error_code =
DapiGetLastErrorByHandle(handle);

if (error_code != DAPI_ERR_NONE)
{
printf("Error detected on handle 0x%x - Error
Code = 0x%x\n", handle, error_code);

DapiClearLastErrorByHandle(handle);

return TRUE;
}

return FALSE;
}

DELIB API Reference | Seite 243


7.5. Manage digital outputs
7.5.1. DapiDOSet1
Description
This command sets a single output.

Definition
void DapiDOSet1(ULONG handle, ULONG ch, ULONG data);

Parameter
handle=This is the handle of an open module
ch=Indicates the number of the output to be set (0 .. )
data=Indicates the data value that will be written (0 / 1)

Return value
None

7.5.2. DapiDOSet8
Description
This command sets 8 digital outputs simultaneously.

Definition
void DapiDOSet8(ULONG handle, ULONG ch, ULONG data);

Parameter
handle=This is the handle of an open module.
ch=Gives the number of the output from which to write (0, 8, 16, 24, 32, ..)
data=Indicates the data values that will be written

Return value
None

DELIB API Reference | Seite 244


7.5.3. DapiDOSet16
Description
This command sets 16 digital outputs simultaneously.

Definition
void DapiDOSet16(ULONG handle, ULONG ch, ULONG data);

Parameter
handle=This is the handle of an open module
ch=Gives the number of the output, from which should be written (0, 16, 32, ..)
data=Gives the data values that will be written

Return value
None

DELIB API Reference | Seite 245


7.5.4. DapiDOSet32
Description
This command sets 32 digital outputs simultaneously.

Definition
void DapiDOSet32(ULONG handle, ULONG ch, ULONG data);

Parameter
handle=This is the handle of an open module
ch=Gives the number of the output, from which should be written (0, 32, 64, ..)
data=Gives the data values that will be written

Return value
None

Programming example
// Write a value to the outputs
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();
// ----------------------------------------------------
// Write a value to the outputs
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();
// ----------------------------------------------------
// Write a value to the outputs
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();

DELIB API Reference | Seite 246


7.5.5. DapiDOSet64
Description
This command sets 64 digital outputs simultaneously.

Definition
void DapiDOSet64(ULONG handle, ULONG ch, ULONG data);

Parameter
handle=This is the handle of an open module
ch=Gives the number of the output from which to write (0, 64, ..)
data=Gives the data values that will be written

Return value
None

DELIB API Reference | Seite 247


7.5.6. DapiDOSet1_WithTimer
Description
This function sets a digital output (ch) to a value (data - 0 or 1) for a specified
time in ms.

Definition
void DapiDOSet1_WithTimer(ULONG handle, ULONG ch, ULONG data, ULONG
time_ms);

Parameter
handle=This is the handle of an open module
ch=Gives the number of the output to write from (0, 32, 64, ..)
data=Gives the data values that will be written
time_ms=Gives the time in which the output is set [ms].

Return value
None

Comment:
This command is only supported by our RO-O8-R8 module.
This command loses its validity if it is overwritten with other values.
If you want to deactivate the command, you have to overwrite it with
time_ms=0.

Modules that are supported by these commands can be found in our


DELIB overview table.

Programming example
DapiDOSet1_WithTimer(handle, 2, 1, 1000);
//Setting channel 2 for 1000msec to 1

DELIB API Reference | Seite 248


7.5.7. DapiDOReadback32
Description
This command reads back the 32 digital outputs.

Definition
ULONG DapiDOReadback32(ULONG handle, ULONG ch);

Parameter
handle=This is the handle of an open module
ch=Gives the number of the output to read back from (0, 32, 64, ..)

Return value
State of 32 outputs.

7.5.8. DapiDOReadback64
Description
This command reads back the 64 digital outputs.

Definition
ULONG DapiDOReadback64(ULONG handle, ULONG ch);

Parameter
handle=This is the handle of an opened module
ch=Indicates the number of the output from which to read back (0, 64, ..)

Return value
State of 64 outputs.

DELIB API Reference | Seite 249


7.5.9. DapiDOSetBit32
Description
This command can be used to switch outputs specifically to 1 without
changing the states of the neighboring outputs.

Definition
void DapiDOSetBit32(uint handle, uint ch, uint data);

Parameter
handle = This is the handle of an opened module
ch = Indicates the number of the output, from which is to be written
data = Specifies the data value to be written (up to 32 bits)

Return value
None

Comment:
Only the bits with a valence of 1 in the data parameter are considered by the
command..

Programming example
data = 0x1; // Output 0 is set to 1, the state of output 1-31 remains
unaffected
DapiDOSetBit32(handle, 0, data);
data = 0xf; // Output 0-3 is set to 1, the state of output 4-31 remains
unaffected
DapiDOSetBit32(handle, 0, data);
data = 0xff; // Output 0-7 is set to 1, the state of output 8-31 remains
unaffected
DapiDOSetBit32(handle, 0, data);
data = 0xff000000; // Output 23-31 is set to 1, the state of output 0-
22 remains unaffected
DapiDOSetBit32(handle, 0, data);

DELIB API Reference | Seite 250


7.5.10. DapiDOClrBit32
Description
This command can be used to switch outputs specifically to 0 without
changing the states of the neighboring outputs.

Definition
void DapiDOClrBit32(uint handle, uint ch, uint data);

Parameter
handle = This is the handle of an open module
ch = Specifies the number of the output from which to write
data = Specifies the data value to be written (up to 32 bits)

Return value
None

Comment:
Only the bits with a valence of 1 in the data parameter are taken into account
by the command.

Programming example
data = 0x1; // Output 0 is set to 0, the state of output 1-31 remains
unaffected
DapiDOSetBit32(handle, 0, data);
data = 0xf; // Output 0-3 is set to 0, the state of output 4-31 remains
unaffected
DapiDOSetBit32(handle, 0, data);
data = 0xff; // Output 0-7 is set to 0, the state of output 8-31 remains
unaffected
DapiDOSetBit32(handle, 0, data);
data = 0xff000000; // Output 23-31 is set to 0, the state of output 0-
22 remains unaffected
DapiDOSetBit32(handle, 0, data);

DELIB API Reference | Seite 251


7.6. A/D converter functions
7.6.1. DapiADSetMode
Description
This command sets the mode for a D/A converter.

Definition
void DapiDASetMode(ULONG handle, ULONG ch, ULONG mode);

Parameter
handle=This is the handle of an open module
ch=Indicates the channel of the D/A converter (0 .. )
mode=Specifies the mode for the D/A converter (see delib.h)

Return value
None

Comment
The following modes are supported:
(these depend on the D/A module used)

Unipolar voltages:

Mode Value range

ADDA_MODE_UNIPOL_10V 0V .. 10V

ADDA_MODE_UNIPOL_5V 0V .. 5V

ADDA_MODE_UNIPOL_2V5 0V .. 2,5V

DELIB API Reference | Seite 252


Bipolar voltages:

Mode Value range

ADDA_MODE_BIPOL_10V -10V .. +10V

ADDA_MODE_BIPOL_5V -5V .. +5V

ADDA_MODE_BIPOL_2V5 -2,5V .. +2,5V

Currents:

Mode Value range

ADDA_MODE_0_20mA 0 .. 20 mA

ADDA_MODE_4_20mA 4 .. 20 mA

ADDA_MODE_0_24mA 0 .. 24 mA

ADDA_MODE_0_25mA 0 .. 25 mA

ADDA_MODE_0_50mA 0 .. 50 mA

DELIB API Reference | Seite 253


7.6.2. DapiADGetMode
Description
This command reads back the set mode of an A/D converter. Mode description
see DapiADSetMode.

Definition
ULONG DapiADGetMode(ULONG handle, ULONG ch);

Parameter
handle=This is the handle of an open module
ch=Indicates the channel of the A/D converter (0 .. )

Return value
Mode of the A/D converter

7.6.3. DapiADGet
Description
This command reads a data value from one channel of an A/D converter.

Definition
ULONG DapiADGet(ULONG handle, ULONG ch);

Parameter
handle=This is the handle of an open module
ch=Indicates the channel of the A/D converter (0 .. )

Return value
Value from A/D converter in digits

DELIB API Reference | Seite 254


7.6.4. DapiADGetVolt
Description
This command reads a data value from one channel of an A/D converter in
volts.

Definition
float DapiADGetVolt(ULONG handle, ULONG ch);

Parameter
handle=This is the handle of an open module
ch=Indicates the channel of the A/D converter (0 .. )

Return value
Value from A/D converter in volts

7.6.5. DapiADGetmA
Description
This command reads a data value from one channel of an A/D converter in mA.

Definition
float DapiADGetmA(ULONG handle, ULONG ch);

Parameter
handle=This is the handle of an open module
ch=Indicates the channel of the A/D converter (0 .. )

Return value
Value from A/D converter in mA.

Comment
This command is module dependent. Of course it only works if the module also
supports the current mode.

DELIB API Reference | Seite 255


7.6.6. DapiSpecialADReadMultipleAD
Description
This command stores the values of certain adjacent channels of an A/D
converter simultaneously in an intermediate buffer. This way the values can be
read out one after the other.
The advantage of this is that on the one hand the A/D values are buffered
simultaneously, on the other hand the values of several A/D channels
(compared to the commands DapiADGetVolt, DapiADGetmA or DapiADGet) can
be queried much faster afterwards.

Definition
void DapiSpecialCommand(ULONG handle, DAPI_SPECIAL_CMD_AD,
DAPI_SPECIAL_AD_READ_MULTIPLE_AD, ULONG start_ch, ULONG end_ch);

Parameter
handle=This is the handle of an open module.
start_ch=Gives the start channel of the A/D converter, from which the values
are buffered (0, 1, 2, ..).
end_ch=Gives the end channel of the A/D converter up to which the values are
buffered (0, 1, 2, ..).

Return value
None.

Comment
The values buffered with command DapiSpecialADReadMultipleAD can be read
afterwards with commands DapiADGetVolt, DapiADGetmA or DapiADGet. So
that the buffered value is really read, the parameter "ch" must be logically linked
with 0x8000 "or" for these functions (see examples).

DELIB API Reference | Seite 256


Programming example
DapiSpecialCommand(handle, DAPI_SPECIAL_CMD_AD,
DAPI_SPECIAL_AD_READ_MULTIPLE_AD, 0, 15);
// Buffers the values of AD channel 0..15

DapiSpecialCommand(handle, DAPI_SPECIAL_CMD_AD,
DAPI_SPECIAL_AD_READ_MULTIPLE_AD, 0, 63);
// Buffers the values of AD channel 0..63

DapiSpecialCommand(handle, DAPI_SPECIAL_CMD_AD,
DAPI_SPECIAL_AD_READ_MULTIPLE_AD, 16, 31);
// Buffers the values of AD channel 16..31

value = DapiADGetVolt(handle, 0x8000 | 0);


// Returns the buffered value of AD channel 0 in volts.

value = DapiADGetmA(handle, 0x8000 | 15);


// Gibt den gepufferten Wert von AD-Kanal 15 in mA zurück.

value = DapiADGet(handle, 0x8000 | 63);


// Gibt den gepufferten Wert von AD-Kanal 63 in Digits zurück.

DELIB API Reference | Seite 257


7.6.7. DapiSpecialADFilterSet
Explanation
A/D converters with a higher resolution are very precise measuring instruments
that can detect even the smallest changes in the measurement signal. In
practice, electrical or electromagnetic interference often affects the
measurement signal via the connecting cable and distorts it. The measurement
signals can be smoothed and optimised with the help of an A/D filter.
The software-based filter we use has already been integrated into the
microcontroller that controls the A/D converter. Various filter levels can be set
and read back via software commands.
The filter principle is based on averaging a sum of measurements. The higher
the filter level is selected, the more measurements are used to calculate the
average value. However, this also means that the sampling rate of the A/D
converter is reduced as the filter level increases.

Description
This command can be used to set the A/D filter level of your A/D module.
Depending on the module, the adjustable filter level may vary.
For a module with several submodules, the A/D filter level can be set individually
for each submodule.

If a 0 is transferred as the filter level, the filter level is deactivated.

Definition
void DapiSpecialCommand(handle, DAPI_SPECIAL_CMD_AD, cmd, par1, par2);

DELIB API Reference | Seite 258


Parameter
handle=This is the handle of an open module.
cmd=DAPI_SPECIAL_AD_FILTER_SET
par1=((filterlevel & 0xff) << 8) | (submodule_nr & 0xff)
filterlevel: Specifies which filter level is to be set
submodule_nr: specifies the submodule on which the filter is to be set. If the
module does not have any submodules, the value 0xff is transferred
par2 = 0

Return value
none.

Remark
Each time the module is restarted, the A/D filter is initially switched off and can
be activated if required. It is therefore advisable to set the A/D filter in the
initialisation of your project.

Programming example
filterlevel = 10
submodule_nr = 0
DapiSpecialCommand(handle, DAPI_SPECIAL_CMD_AD,
DAPI_SPECIAL_AD_FILTER_SET, ((filterlevel & 0xff) << 8)
| (submodule_nr & 0xff) , 0);
// A/D filter of submodule 0 is set to 10

filterlevel = 5
submodule_nr = 3
DapiSpecialCommand(handle, DAPI_SPECIAL_CMD_AD,
DAPI_SPECIAL_AD_FILTER_SET, ((filterlevel & 0xff) << 8)
| (submodule_nr & 0xff) , 0);
// A/D filter of submodule 3 is set to 5

filterlevel = 6
DapiSpecialCommand(handle, DAPI_SPECIAL_CMD_AD,
DAPI_SPECIAL_AD_FILTER_SET, ((filterlevel & 0xff) << 8)
| (0xff & 0xff) , 0);
// A/D filter of the main module is set to 6 (only for modules without
submodule)

filterlevel = 2

DELIB API Reference | Seite 259


DapiSpecialCommand(handle, DAPI_SPECIAL_CMD_AD,
DAPI_SPECIAL_AD_FILTER_SET, ((filterlevel & 0xff) << 8)
| (0xff & 0xff) , 0);
// A/D filter of the main module is set to 2 (only for modules without
submodule)

DELIB API Reference | Seite 260


7.6.8. DapiSpecialADFilterGet
Description
This command can be used to read out the A/D filter level of the A/D module.
For a module with submodules, the submodule number must be transferred.

Definition
void DT.Delib.DapiSpecialCommand(handle, DAPI_SPECIAL_CMD_AD, cmd, par1,
par2);

Parameter
handle=This is the handle of an open module.
cmd=DAPI_SPECIAL_AD_FILTER_GET
par1=(submodule_nr & 0xff)
submodule_nr: specifies the submodule from which the filter is to be read. If the
module has no submodules, the value 0xff is transferred
par2 = 0

Return-Value
A/D filterlevel

DELIB API Reference | Seite 261


Programming example
unsigned long filterlevel = DapiSpecialCommand(handle,
DAPI_SPECIAL_CMD_AD, DAPI_SPECIAL_AD_FILTER_GET, (0 &
0xff) , 0);
// A/D filter of submodule 0 is read out

unsigned long filterlevel = DapiSpecialCommand(handle,


DAPI_SPECIAL_CMD_AD, DAPI_SPECIAL_AD_FILTER_GET, (5 &
0xff) , 0);
// A/D filter of submodule 5 is read out

unsigned long filterlevel = DapiSpecialCommand(handle,


DAPI_SPECIAL_CMD_AD, DAPI_SPECIAL_AD_FILTER_GET, (0xff
& 0xff) , 0);
// A/D filter of the main module is read out (only for modules without
submodule)

DELIB API Reference | Seite 262


7.7. CAN Runtime Functions
7.7.1. RunTimeVarWriteToModule
Description
When the module is started, the settings are loaded from the Module-
Configuration-Memory and used. With the help of these commands the settings
can be changed and read out during runtime.
However, they are not stored in the Module-Configuration-Memory and are
therefore lost after a module restart.

Parameter
handle = this is the handle of an opened module
par = runtime variable to be written or read out
index = Specifies the index of the TX/RX packet [value range 0-7].
value = The value by which the runtime variable is to be changed. With the read
function a reference is passed here

Comment
The value must always be specified as a hex value. The return value is also in
hex. A list of modules that support these functions can be found in our Delib
Übersichtstabelle.

DELIB API Reference | Seite 263


Definition
For a better understanding of our examples, we use the function
RunTimeVarWriteToModule for writing and RunTimeVarReadFromModule for
reading.

The source code in it is as follows:


//Reading the values
public static uint RunTimeVarReadFromModule(uint handle, uint par,
uint index, ref uint value)
{
byte[] dummy_buff = new byte[] { 0 };
uint u0 = 0;

if(DT.Delib.DapiSpecialCommandExt(handle,
DT.Ext.DAPI_SPECIAL_CMDEXT_CAN_RD_RUNTIME_VALUE,
par, index, value, ref value, ref u0, ref u0,
dummy_buff, 0, dummy_buff, 0, dummy_buff, 0, ref u0) !=
DT.RETURN_OK)
{
return DT.Error.DAPI_ERR_DEV_CONFIG_READ_ERROR;
}
return DT.Error.DAPI_ERR_NONE;
}

//Writing the values


public static uint RunTimeVarWriteToModule(uint handle, uint par,
uint index, uint value)
{
byte[] dummy_buff = new byte[] { 0 };
uint u0 = 0;

if(DT.Delib.DapiSpecialCommandExt(handle,
DT.Ext.DAPI_SPECIAL_CMDEXT_CAN_WR_RUNTIME_VALUE,
par, index, value, ref u0, ref u0, ref u0,
dummy_buff, 0, dummy_buff, 0, dummy_buff, 0, ref u0) !=
DT.RETURN_OK)
{
return DT.Error.DAPI_ERR_DEV_CONFIG_READ_ERROR;
}
return DT.Error.DAPI_ERR_NONE;
}

DELIB API Reference | Seite 264


par = DAPI_SPECIAL_CMDEXT_CAN_RUNTIME_DEV_BAUDRATE
With this command the baud rate of the interface can be set/read out.

Baudrate Value

1 MBit/s 0x00

500 KBit/s 0x01

250 KBit/s 0x02

125 KBit/s 0x03

100 KBit/s 0x04

50 KBit/s 0x05

20 KBit/s 0x06

10 KBit/s 0x07

Programming example

RunTimeVarWriteToModule(handle,
DAPI_SPECIAL_CMDEXT_CAN_RUNTIME_DEV_BAUDRATE, 0, 0x01);
// Here the baud rate is set to 500 KBit/s.

uint val = 0;
RunTimeVarReadFromModule(handle,
DAPI_SPECIAL_CMDEXT_CAN_RUNTIME_DEV_BAUDRATE, 0, ref
val);
// Here the baud rate is passed to the variable val.

DELIB API Reference | Seite 265


par = DAPI_SPECIAL_CMDEXT_CAN_RUNTIME_DEV_USEEXTID
With this command the bit mode can be set/read out.

useExtID Value

11 Bit Mode 0x00

29 Bit Mode 0x01

Programming example

RunTimeVarWriteToModule(handle,
DAPI_SPECIAL_CMDEXT_CAN_RUNTIME_DEV_USEEXTID, 0, 0x00);
// Here the Ext-ID of the interface is set to the 11 bit mode.

uint val = 0;
RunTimeVarReadFromModule(handle,
DAPI_SPECIAL_CMDEXT_CAN_RUNTIME_DEV_USEEXTID, 0, ref
val);
// Here the used bit mode of the variable val is passed.

DELIB API Reference | Seite 266


par = DAPI_SPECIAL_CMDEXT_CAN_RUNTIME_TX_IS_ACTIVE
With this command the trigger mode can be set/read out.
When using the "Interval Mode (0x01)", you can also use the Interval command
to set the time interval in which the TX packets are to be sent.

Trigger Mode Value

OFF 0x00

Interval Mode 0x01

RX-Event 0x02

Fast as possible 0x03

Programming example

RunTimeVarWriteToModule(handle,
DAPI_SPECIAL_CMDEXT_CAN_RUNTIME_TX_IS_ACTIVE, 1, 0x00);
// Here the trigger mode of the TX packet[1] is set to OFF.

uint val = 0;
RunTimeVarReadFromModule(handle,
DAPI_SPECIAL_CMDEXT_CAN_RUNTIME_TX_IS_ACTIVE, 0, ref
val);
// Here the trigger mode status of the TX packet[0] is passed to the variable
val.

DELIB API Reference | Seite 267


par = DAPI_SPECIAL_CMDEXT_CAN_RUNTIME_TX_INTERVAL
With this command the interval can be set/read out.

Interval count Value Bit [4..7]

1 0x01

2 0x02

3 0x03

4 0x04

.. 9 .. 0x09

Interval unit Value Bit [0..3]

* 1 ms 0x01

* 10 ms 0x02

* 100 ms 0x03

* 1 sec 0x04

Example
An interval of 700ms corresponds to a value of 0x73
An interval of 40ms corresponds to a value of 0x42

Programming example

RunTimeVarWriteToModule(handle,
DAPI_SPECIAL_CMDEXT_CAN_RUNTIME_TX_INTERVAL, 1,
(((0x02 << 4) & 0xf0) | (0x04 & 0x0f)));
// Here the interval of the TX packet[1] is set to 40ms.

uint val = 0;
RunTimeVarReadFromModule(handle,
DAPI_SPECIAL_CMDEXT_CAN_RUNTIME_TX_INTERVAL, 0, ref
val);
// Here the interval of the TX packet[0] is passed to the variable val.

DELIB API Reference | Seite 268


par = DAPI_SPECIAL_CMDEXT_CAN_RUNTIME_TX_USE_EXT_ID
With this command the bit mode can be set/read out.

useExtID Value

11 Bit Mode 0x00

29 Bit Mode 0x01

Programming example

RunTimeVarWriteToModule(handle,
DAPI_SPECIAL_CMDEXT_CAN_RUNTIME_TX_USE_EXT_ID, 1,
0x00);
// Here the Ext-ID of the TX packet[1] is set to 11 bit mode.

uint val = 0;
RunTimeVarReadFromModule(handle,
DAPI_SPECIAL_CMDEXT_CAN_RUNTIME_TX_USE_EXT_ID, 0, ref
val);
// Here the used bit mode of the TX packet[0] is passed to the variable val.

par = DAPI_SPECIAL_CMDEXT_CAN_RUNTIME_TX_CANID
With this command the CAN-ID can be set/read out.

Programming example

RunTimeVarWriteToModule(handle,
DAPI_SPECIAL_CMDEXT_CAN_RUNTIME_TX_CANID, 1, 0x1e);
// Here the CAN-ID of the TX packet[1] is set to the 30.

uint val = 0;
RunTimeVarReadFromModule(handle,
DAPI_SPECIAL_CMDEXT_CAN_RUNTIME_TX_CANID, 0, ref val);
// Here the used CAN-ID of the TX packet[0] is passed to the variable val.

DELIB API Reference | Seite 269


par = DAPI_SPECIAL_CMDEXT_CAN_RUNTIME_TX_MODE
With this command the TX mode can be set/read out.

TX-Mode Value

OPTO-IN 1-64 0x01

OPTO-IN 65-128 0x24

OPTO-IN 129-192 0x25

OPTO-IN 193-256 0x26

A/D CH 1-4 (16 Bit) 0x02

A/D CH 5-8 (16 Bit)", 0x03

A/D CH 9-12 (16 Bit) 0x04

A/D CH 13-16 (16 Bit) 0x05

A/D CH 17-20 (16 Bit) 0x06

A/D CH 21-24 (16 Bit) 0x07

A/D CH 25-28 (16 Bit) 0x08

A/D CH 29-32 (16 Bit) 0x09

Counter16 1-4 (16 Bit) 0x0a

Counter16 5-8 (16 Bit) 0x0b

Counter16 9-12 (16 Bit) 0x0c

Counter16 13-16 (16 Bit) 0x0d

Counter16 17-20 (16 Bit) 0x0e

Counter16 21-24 (16 Bit) 0x0f

Counter16 25-28 (16 Bit) 0x10

DELIB API Reference | Seite 270


TX-Mode Value

Counter16 29-32 (16 Bit) 0x11

Cnt48 1-2 (32 Bit) 0x12

Cnt48 3-4 (32 Bit) 0x13

Cnt48 5-6 (32 Bit) 0x14

Cnt48 7-8 (32 Bit) 0x15

PT-100 1-2 (32 Bit) 0x16

PT-100 3-4 (32 Bit) 0x17

PT-100 5-6 (32 Bit) 0x18

PT-100 7-8 (32 Bit) 0x19

Cnt48 1 (64 Bit) 0x1a

Cnt48 2 (64 Bit) 0x1b

Cnt48 3 (64 Bit) 0x1c

Cnt48 4 (64 Bit) 0x1d

Testcounter 8 bit 0x1e

DO Readback 1-64 0x1f

DO Readback 1-32 0x23

Custom1 0x20

Custom2 0x21

Custom3 0x22

Programming example

DELIB API Reference | Seite 271


RunTimeVarWriteToModule(handle,
DAPI_SPECIAL_CMDEXT_CAN_RUNTIME_TX_MODE, 1, 0x0f);
// Here the mode of the TX packet [1] is set to the TX mode "Counter16 21-24
(16 bit)".

uint val = 0;
RunTimeVarReadFromModule(handle,
DAPI_SPECIAL_CMDEXT_CAN_RUNTIME_TX_MODE, 0, ref val);
// Here the used TX mode of the TX packet[0] is passed to the variable val.

DELIB API Reference | Seite 272


par = DAPI_SPECIAL_CMDEXT_CAN_RUNTIME_RX_IS_ACTIVE
This command enables/disables the RX package

Trigger Mode Value

OFF 0x00

ON 0x01

Programming example

RunTimeVarWriteToModule(handle,
DAPI_SPECIAL_CMDEXT_CAN_RUNTIME_RX_IS_ACTIVE, 1, 0x00);
// Here the RX package[1] is set to OFF.

uint val = 0;
RunTimeVarReadFromModule(handle,
DAPI_SPECIAL_CMDEXT_CAN_RUNTIME_RX_IS_ACTIVE, 0, ref
val);
// Here the status of the RX packet[0] is passed to the variable val.

DELIB API Reference | Seite 273


par = DAPI_SPECIAL_CMDEXT_CAN_RUNTIME_RX_USE_EXT_ID
With this command the bit mode can be set/read out.

UseExtID Value

11 Bit Mode 0x00

29 Bit Mode 0x01

Programming example

RunTimeVarWriteToModule(handle,
DAPI_SPECIAL_CMDEXT_CAN_RUNTIME_RX_USE_EXT_ID, 1,
0x00);
// Here the Ext-ID of the RX packet[1] is set to the 11 bit mode.

uint val = 0;
RunTimeVarReadFromModule(handle,
DAPI_SPECIAL_CMDEXT_CAN_RUNTIME_RX_USE_EXT_ID, 0, ref
val);
// Here the used bit mode of the RX packet[0] is passed to the variable val.

DELIB API Reference | Seite 274


par = DAPI_SPECIAL_CMDEXT_CAN_RUNTIME_RX_CANID
With this command the CAN-ID can be set/read out.

Programming example

RunTimeVarWriteToModule(handle,
DAPI_SPECIAL_CMDEXT_CAN_RUNTIME_RX_CANID, 1, 0x1e);
// Here the CAN ID of the RX packet[1] is set to the 30.

uint val = 0;
RunTimeVarReadFromModule(handle,
DAPI_SPECIAL_CMDEXT_CAN_RUNTIME_RX_CANID, 0, ref val);
// Here the used CAN-ID of the RX packet[0] is passed to the variable val.

DELIB API Reference | Seite 275


par = DAPI_SPECIAL_CMDEXT_CAN_RUNTIME_RX_MODE
With this command RX-Mode can be set/read.

RX-Mode Value

Digital Out 1-64 0x01

D/A CH 1-4 0x02

D/A CH 5-8 0x03

D/A CH 9-12 0x04

D/A CH 13-16 0x05

D/A CH 17-20 0x06

D/A CH 21-24 0x07

D/A CH 25-28 0x08

D/A CH 29-32 0x09

Stepper No. 1 0x0a

Stepper No. 2 0x0b

Stepper No. 3 0x0c

Stepper No. 4 0x0d

Stepper No. 5 0x0e

Stepper No. 6 0x0f

Stepper No. 7 0x10

Stepper No. 8 0x11

D/A CH 1-4 (custom) 0x12

D/A CH 5-8 (custom) 0x13

DELIB API Reference | Seite 276


RX-Mode Value

D/A CH 9-12 (custom) 0x14

D/A CH 13-16 (custom) 0x15

D/A CH 17-20 (custom) 0x16

D/A CH 21-24 (custom) 0x17

D/A CH 25-28 (custom) 0x18

D/A CH 29-32 (custom) 0x19

Trigger Auto TX 1 0x1a

Trigger Auto TX 2 0x1b

Trigger Auto TX 3 0x1c

Trigger Auto TX 4 0x1d

Custom1 0x1e

Custom2 0x1f

Custom3 0x20

PWM CH 1-8 0x21

PWM CH 9-16 0x22

PWM CH 17-24 0x23

PWM CH 25-32 0x24

PWM CH 33-40 0x25

PWM CH 41-48 0x26

PWM CH 49-56 0x27

DELIB API Reference | Seite 277


RX-Mode Value

PWM CH 57-64 0x28

Trigger Auto TX 5 0x29

Trigger Auto TX 6 0x2a

Trigger Auto TX 7 0x2b

Trigger Auto TX 8 0x2c

Programming example

RunTimeVarWriteToModule(handle,
DAPI_SPECIAL_CMDEXT_CAN_RUNTIME_RX_MODE, 1, 0x0f);
// Here the mode of the RX package [1] is set to the RX mode "Stepper No. 6

uint val = 0;
RunTimeVarReadFromModule(handle,
DAPI_SPECIAL_CMDEXT_CAN_RUNTIME_RX_MODE, 0, ref val);
// Here the used RX mode of the RX packet[0] is passed to the variable val.

DELIB API Reference | Seite 278


7.8. Manage output timeout
7.8.1. DapiSpecialCMDTimeout
Description
This command is used to set the timeout protection function.
There are three different timeout methods since 2021.

"normal" timeout
This is the timeout that our modules have had since 2009.
Procedure for the timeout command:
The timeout is activated by command.
If then a so-called timeout event takes place (pause between two accesses to
the module is greater than the allowed timeout time) the following happens:
- All outputs are switched off
- The timeout status goes to "2
- The timeout LED turns on (for modules that have such a status)
Further accesses to the outputs are then still possible, but the timeout is no
longer active. Not again until it has been reactivated.

DELIB API Reference | Seite 279


"auto reactivate" Timeout
This is a timeout mode implemented since 2021 that automatically re-enables
the timeout after the timeout event occurs.
Procedure for the timeout command:
The timeout is activated by command.
If then a so-called timeout event takes place (pause between two accesses to
the module is greater than the allowed timeout time) the following happens:
- All outputs are switched off
- The timeout status goes to "4
- The timeout LED turns on (for modules that have such a status)
Further accesses to the outputs are then still possible. AND the timeout is still
active. If the timeout time is exceeded again, the outputs are switched off
again.

DELIB API Reference | Seite 280


"secure outputs" Timeout
This is a timeout mode implemented since 2021 that prevents write access to
the outputs after the timeout event has occurred.This ensures that the software
must first restore the outputs to a "safe" state because the module's timeout
mechanism has changed the outputs to predefined values.
Procedure for the timeout command:
The timeout is activated by command.
If then a so-called timeout event takes place (pause between two accesses to
the module is greater than the allowed timeout time) the following happens:
- All outputs are switched off
- The timeout status goes to "6
- The timeout LED turns on (for modules that have such a status)
Further access to the outputs is NOT possible. Only after reactivating the
timeout or deactivating the timeout the outputs can be written.

Definition
DapiSpecialCommand(handle, DAPI_SPECIAL_CMD_TIMEOUT, cmd, par1, par2);

Parameter
handle=This is the handle of an open module
cmd = function to be executed
par1 = value passed to the function
par2 = value passed to the function

DELIB API Reference | Seite 281


7.8.1.1. DapiSpecialTimeoutSetValueSec
Description
This command is used to set the timeout time.

Definition
DapiSpecialCommand(handle, DAPI_SPECIAL_CMD_TIMEOUT, cmd, par1, par2);

Parameter
cmd = DAPI_SPECIAL_TIMEOUT_SET_VALUE_SEC
par1 = Seconds [s]
par2 = Milliseconds [100ms] (Value 6 = 600ms)

Comment
The permissible value range of the time specification is between 0.1 seconds
and 6553 seconds

Programming example
DapiSpecialCommand(handle, DAPI_SPECIAL_CMD_TIMEOUT,
DAPI_SPECIAL_TIMEOUT_SET_VALUE_SEC, 3, 7);
//Timeout time is set to 3.7sec.

DELIB API Reference | Seite 282


7.8.1.2. DapiSpecialTimeoutActivate
Description
This command activates the "normal" timeout.
After the timeout event,.
- ..all outputs are switched off
- ..the timeout status is set to "2
- ..the timeout LED is switched on (for modules that have such a status)
Further accesses to the outputs are then still possible, but the timeout is no
longer active.
Not again until it has been reactivated.

Definition
DapiSpecialCommand(handle, DAPI_SPECIAL_CMD_TIMEOUT, cmd, 0, 0);

Parameter
cmd = DAPI_SPECIAL_TIMEOUT_ACTIVATE

Programming example
DapiSpecialCommand(handle, DAPI_SPECIAL_CMD_TIMEOUT,
DAPI_SPECIAL_TIMEOUT_ACTIVATE, 0, 0);
//The "normal" timeout is activated.

DELIB API Reference | Seite 283


7.8.1.3. DapiSpecialTimeoutActivateAutoReactivate
Description
This command activates the "auto reactivate" timeout.
In this mode, the timeout is automatically reactivated after the timeout event.
After the timeout event.
- ..all outputs are switched off
- ..the timeout status is set to "4
- ..the timeout LED is switched on (for modules that have such a status)
Further accesses to the outputs are then still possible AND the timeout is still
active.
If the timeout time is exceeded again, the outputs are switched off again.

Definition
DapiSpecialCommand(handle, DAPI_SPECIAL_CMD_TIMEOUT, cmd, 0, 0);

Parameter
cmd = DAPI_SPECIAL_TIMEOUT_ACTIVATE_AUTO_REACTIVATE

Programming example
DapiSpecialCommand(handle, DAPI_SPECIAL_CMD_TIMEOUT,
DAPI_SPECIAL_TIMEOUT_ACTIVATE_AUTO_REACTIVATE, 0, 0);
//The "auto reactivate" timeout is activated.

DELIB API Reference | Seite 284


7.8.1.4. DapiSpecialTimeoutActivateSecureOutputs
Description
This command activates the "secure" timeout.
In this mode, write access to the outputs after a timeout event is prevented.
This ensures that the software first has to restore a "secure" state of the
outputs,
because the timeout mechanism of the module has changed the outputs to
predefined values.
After the timeout event.
- ..all outputs are switched off
- ..the timeout status is set to "6
- ..the timeout LED is switched on (for modules that have such a status)
Further accesses to the outputs are NOT possible. Only after reactivating the
timeout or deactivating the timeout the outputs can be written.

Definition
DapiSpecialCommand(handle, DAPI_SPECIAL_CMD_TIMEOUT, cmd, 0, 0);

Parameter
cmd = DAPI_SPECIAL_TIMEOUT_ACTIVATE_SECURE_OUTPUTS

Programmierbeispiel
DapiSpecialCommand(handle, DAPI_SPECIAL_CMD_TIMEOUT,
DAPI_SPECIAL_TIMEOUT_ACTIVATE_SECURE_OUTPUTS, 0, 0);
//The "secure" timeout is activated.

DELIB API Reference | Seite 285


7.8.1.5. DapiSpecialTimeoutDeactivate
Description
This command disables the timeout.

Definition
DapiSpecialCommand(handle, DAPI_SPECIAL_CMD_TIMEOUT, cmd, 0, 0);

Parameter
cmd = DAPI_SPECIAL_TIMEOUT_DEACTIVATE

Programming example
DapiSpecialCommand(handle, DAPI_SPECIAL_CMD_TIMEOUT,
DAPI_SPECIAL_TIMEOUT_DEACTIVATE, 0, 0);
//Disables the timeout.

DELIB API Reference | Seite 286


7.8.1.6. DapiSpecialTimeoutGetStatus
Description
Dieser Befehl dient dem Auslesen des Timeout-Status.

Definition
ULONG DapiSpecialCommand(handle, DAPI_SPECIAL_CMD_TIMEOUT,
DAPI_SPECIAL_TIMEOUT_GET_STATUS, 0, 0);

Parameter
cmd = DAPI_SPECIAL_TIMEOUT_GET_STATUS

Return value
Return = 0 (timeout is disabled)

Values for the "normal" timeout


Return = 1 (Timeout "normal" is activated)
Return = 2 (Timeout "normal" has occurred)

Values for the "auto reactivate" timeout


Return = 3 (Timeout "auto reactivate" is activated)
Return = 4 (Timeout "auto reactivate" has occurred one or more times)

Values for the "secure" timeout


Return = 5 (Timeout "secure" is activated).
Return = 6 (Timout "secure" has taken place. In this status, writing to the
outputs is prevented).

Programming example
unsigned long status = DapiSpecialCommand(handle,
DAPI_SPECIAL_CMD_TIMEOUT,
DAPI_SPECIAL_TIMEOUT_GET_STATUS, 0, 0);
printf("Status = %lu\n", status);
//Query the timeout status with output.

DELIB API Reference | Seite 287


7.8.1.7. DapiSpecialTimeoutDoValueMaskWRSet32
Description
This command determines the outputs to be set in case of a timeout.

Definition
DapiSpecialCommand(handle, DAPI_SPECIAL_CMD_TIMEOUT, cmd, ch, par2);

Parameter
cmd = DAPI_SPECIAL_TIMEOUT_DO_VALUE_MASK_WR_SET32
ch = Indicates the number of the output from which to write (0, 32, 64, ..)
par2 = [32 Bit] Specifies the outputs which are to be activated in case of a
timeout.

Programmierbeispiel
DapiSpecialCommand(handle, DAPI_SPECIAL_CMD_TIMEOUT,
DAPI_SPECIAL_TIMEOUT_DO_VALUE_MASK_WR_SET32, 0, 0xff);
//The first 8 relays are switched on in the timeout case.

DELIB API Reference | Seite 288


7.8.1.8. DapiSpecialTimeoutDoValueMaskRDSet32
Description
This command is used to read out the transferred values.

Definition
ULONG DapiSpecialCommand(handle, DAPI_SPECIAL_CMD_TIMEOUT, cmd, 0, 0);

Parameter
cmd = DAPI_SPECIAL_TIMEOUT_DO_VALUE_MASK_RD_SET32

Return value
[32 bit] Value passed to the SET command

Programmierbeispiel
long value = DapiSpecialCommand(handle,
DAPI_SPECIAL_CMD_TIMEOUT,
DAPI_SPECIAL_TIMEOUT_DO_VALUE_MASK_RD_SET32, 0, 0);
printf("%0x\n", value);
//The value that was passed to the SET command is read out and displayed.

DELIB API Reference | Seite 289


7.8.1.9. DapiSpecialTimeoutDoValueMaskWRClr32
Description
This command determines the outputs that are to be switched off in the event
of a timeout.

Definition
DapiSpecialCommand(handle, DAPI_SPECIAL_CMD_TIMEOUT, cmd, ch, par2);

Parameter
cmd = DAPI_SPECIAL_TIMEOUT_DO_VALUE_MASK_WR_CLR32
ch = Specifies the number of the output from which to write (0, 32, 64, ..)
par2 = [32 Bit] Specifies the outputs which are to be deactivated in case of a
timeout.

Programming example
DapiSpecialCommand(handle, DAPI_SPECIAL_CMD_TIMEOUT,
DAPI_SPECIAL_TIMEOUT_DO_VALUE_MASK_WR_CLR32, 0, 0xff);
//The first 8 relays are switched off in the timeout case.

DELIB API Reference | Seite 290


7.8.1.10. DapiSpecialTimeoutDoValueMaskRDClr32
Description
This command is used to read out the transferred values.

Definition
ULONG DapiSpecialCommand(handle, DAPI_SPECIAL_CMD_TIMEOUT, cmd, 0, 0);

Parameter
cmd = DAPI_SPECIAL_TIMEOUT_DO_VALUE_MASK_RD_CLR32

Return value
[32 bit] Value that is passed to the CLR command

Programming example
long value = DapiSpecialCommand(handle,
DAPI_SPECIAL_CMD_TIMEOUT,
DAPI_SPECIAL_TIMEOUT_DO_VALUE_MASK_RD_CLR32, 0, 0);
printf("%0x\n", value);
//The value that was passed to the CLR command is read out and displayed.

DELIB API Reference | Seite 291


7.8.1.11. DapiSpecialTimeoutDoValueLoadDefault
Description
Resets the SET and CLR values to the default value.
(SET value = 0, CLR value = FFFFFFFF)

Definition
DapiSpecialCommand(handle, DAPI_SPECIAL_CMD_TIMEOUT, cmd, 0, 0);

Parameter
cmd = DAPI_SPECIAL_TIMEOUT_DO_VALUE_LOAD_DEFAULT

Programming example
DapiSpecialCommand(handle, DAPI_SPECIAL_CMD_TIMEOUT,
DAPI_SPECIAL_TIMEOUT_DO_VALUE_LOAD_DEFAULT, 0, 0);
//SET and CRL values are set to the default value.

DELIB API Reference | Seite 292


7.9. Test functions
7.9.1. DapiPing
Description
This command checks the connection to an open module.

Definition
ULONG DapiPing(ULONG handle, ULONG value);

Parameter
handle=This is the handle of an opened module.
value=Passed test value, in the value range of 0-255 (8-bit), to the module.

Return value
Here the test value passed with "value" must return

DELIB API Reference | Seite 293


7.10. Register write commands
7.10.1. DapiWriteByte
Description
This command performs a direct register write command to the module.

Definition
void DapiWriteByte(ULONG handle, ULONG adress, ULONG value);

Parameter
handle=This is the handle of an open module
address=Address to be accessed
value=Gives the data value that will be written (8 bits)

Return value
None

Comment
This should only be used by experienced programmers. This way all available
registers can be accessed directly.

DELIB API Reference | Seite 294


7.10.2. DapiWriteWord
Description
This command performs a direct register write command to the module.

Definition
void DapiWriteWord(ULONG handle, ULONG adress, ULONG value);

Parameter
handle=This is the handle of an open module
address=Address to be accessed
value=Gives the data value that will be written (16 bit)

Return value
None

Comment
This should only be used by experienced programmers. This way all available
registers can be accessed directly.

DELIB API Reference | Seite 295


7.10.3. DapiWriteLong
Description
This command performs a direct register write command to the module.

Definition
void DapiWriteLong(ULONG handle, ULONG adress, ULONG value);

Parameter
handle=This is the handle of an open module
address=Address to be accessed
value=Gives the data value that will be written (32 bit)

Return value
None

Comment
This should only be used by experienced programmers. This way all available
registers can be accessed directly.

DELIB API Reference | Seite 296


7.10.4. DapiWriteLongLong
Description
This command performs a direct register write command to the module.

Definition
void DapiWriteLongLong(ULONG handle, ULONG adress, ULONGLONG value);

Parameter
handle=This is the handle of an open module
address=Address to be accessed
value=Gives the data value that will be written (64 bit)

Return value
None

Comment
This should only be used by experienced programmers. This way all available
registers can be accessed directly.

DELIB API Reference | Seite 297


7.11. Register read commands
7.11.1. DapiReadByte
Description
This command performs a direct register read command on the module.

Definition
ULONG DapiReadByte(ULONG handle, ULONG adress);

Parameter
handle=This is the handle of an open module
address=address to be accessed

Return value
Content of the register to be read (8 bit)

Comment
This should only be used by experienced programmers. This way all available
registers can be accessed directly.

DELIB API Reference | Seite 298


7.11.2. DapiReadWord
Description
This command performs a direct register read command on the module.

Definition
ULONG DapiReadWord(ULONG handle, ULONG adress);

Parameter
handle=This is the handle of an open module
address=address to be accessed

Return value
Content of the register to be read (16 bit)

Comment
This should only be used by experienced programmers. This way all available
registers can be accessed directly.

DELIB API Reference | Seite 299


7.11.3. DapiReadLong
Description
This command performs a direct register read command on the module.

Definition
ULONG DapiReadLong(ULONG handle, ULONG adress);

Parameter
handle=This is the handle of an open module
address=address to be accessed

Return value
Contents of the register to be read (32 bit)

Comment
This should only be used by experienced programmers. This way all available
registers can be accessed directly.
Program example

char v0, v1, v2, v3;


uint ver;
float fw_ver;

ver = (uint)DapiReadLong(handle, 0xfff4);

v3 = (char)((ver >> 24) & 0xff);


v2 = (char)((ver >> 16) & 0xff);
v1 = (char)((ver >> 8) & 0xff);
v0 = (char)((ver >> 0) & 0xff);

fw_ver = (((float)v0) - '0') * 10 + (((float)v1) - '0')


+ (((float)v2) - '0') / 10 + (((float)v3) - '0') / 100;
// Here the firmware version of the module is read out.

DELIB API Reference | Seite 300


7.11.4. DapiReadLongLong
Description
This command performs a direct register read command on the module.

Definition
ULONGLONG DapiReadLongLong(ULONG handle, ULONG adress);

Parameter
handle=This is the handle of an open module
address=address to be accessed

Return value
Contents of the register to be read (64 bit)

Comment
This should only be used by experienced programmers. This way all available
registers can be accessed directly.

DELIB API Reference | Seite 301


7.12. Programming example
// *******************************************************************
// *******************************************************************
//
// (c) DEDITEC GmbH, 2009
//
// web: http://www.deditec.de
//
// mail: [email protected]
//
// dtapi_prog_beispiel_input_output.cpp
//
// *******************************************************************
// *******************************************************************
//
// Include the following libraries when linking: delib.lib
// Please do this in the project settings (Project/Settings/Linker(Object-
Library modules) ... configure last entry
#include <windows.h>
#include <stdio.h>
#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 öffnen
handle = DapiOpenModule(USB_Interface8,0);
printf("USB_Interface8 handle = %x\n", handle);
if (handle==0)
{
// USB Modul wurde nicht gefunden
printf("Modul konnte nicht geöffnet werden\n");
printf("TASTE für weiter\n");
getch();
return;
}
// Zum Testen - ein Ping senden
// ----------------------------------------------------
printf("PING\n");
anz=10;
for(i=0;i!=anz;++i)
{
data=DapiPing(handle, i);
if(i==data)
{
// OK
printf(".");
}
else
{
// No answer

DELIB API Reference | Seite 302


printf("E");
}
}
printf("\n");

// ----------------------------------------------------
// Einen Wert auf die Ausgänge schreiben
data = 255;
DapiWriteByte(handle, 0, data);
printf("Schreibe auf Adresse=0 daten=0x%x\n", data);
// ----------------------------------------------------
// Einen Wert auf die Ausgänge schreiben
data = 255;
DapiWriteByte(handle, 1, data);
printf("Schreibe auf Adresse=0 daten=0x%x\n", data);
// ----------------------------------------------------
// Einen Wert auf die Ausgänge schreiben
data = 255;
DapiWriteByte(handle, 2, data);
printf("Schreibe auf Adresse=2 daten=0x%x\n", data);
// ----------------------------------------------------
// Einen Wert von den Eingängen lesen
data = (unsigned long) DapiReadByte(handle, 0);
printf("Gelesene Daten = 0x%x\n", data);
// ----------------------------------------------------
// Einen A/D Wert lesen
chan=11; // read chan. 11
data = 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 schliessen
DapiCloseModule(handle);
printf("TASTE für weiter\n");
getch();
return ;
}

DELIB API Reference | Seite 303


7.13. Delib overview table

Commands Available for


DAPI_SPECIAL_CMD_SET_DIR_DX_1 USB-MINI-TTL8

DAPI_SPECIAL_CMD_SET_DIR_DX_8 USB-MINI-TTL8
USB-TTL32
USB-TTL64
ETH-TTL64
DAPI_SPECIAL_CMD_GET_DIR_DX_1 is not supported

DAPI_SPECIAL_CMD_GET_DIR_DX_8 is not supported

Commands Available for Does not work


with

DAPI_SPECIAL_CMD_TIMEOUT ETH-TTL64 USB-Mini-Stick


DAPI_SPECIAL_TIMEOUT_DO_VALUE_ ETH-RELAIS8
MASK_WR_SET32 USB-RELAIS8
DAPI_SPECIAL_TIMEOUT_DO_VALUE_ RO-SERIE
MASK_RD_SET32 BS-SERIE
DAPI_SPECIAL_TIMEOUT_DO_VALUE_ NET-SERIE
MASK_WR_CLR32 USB-TTL-64
DAPI_SPECIAL_TIMEOUT_DO_VALUE_
MASK_RD_CLR32
DAPI_SPECIAL_TIMEOUT_DO_VALUE_
LOAD_DEFAULT

DAPI_SPECIAL_TIMEOUT_SET_VALUE_
SEC All modules
DAPI_SPECIAL_TIMEOUT_ACTIVATE
DAPI_SPECIAL_TIMEOUT_DEACTIVATE

DELIB API Reference | Seite 304


Commands Available for Does not work
with

DAPI_SPECIAL_TIMEOUT_GET_STATUS

DELIB API Reference | Seite 305


Commands Starter Starter RO BS NET Other
USB* ETH** Serie Serie Serie

DAPI_SPECIAL_COUNTER_ x
LATCH_ALL
DAPI_SPECIAL_COUNTER_ x
LATCH_ALL_WITH_RESET
DapiDOSet1_WithTimer x
DAPI_SPECIAL_CMD_SW_FIFO x
DAPI_SPECIAL_SW_FIFO_INIT_
AND_CLEAR
...
DAPI_SPECIAL_SW_FIFO_
IO_DEACTIVATE
DAPI_SPECIAL_CMD_AD x
DAPI_SPECIAL_RO_AD_
FIFO_ACTIVATE
...
DAPI_SPECIAL_RO_AD_
FIFO_INIT

*: USB-OPTOIN8, USB-Mini-Stick, USB-TTL-64


**: ETH-TTL64, ETH-OPTOIN8, ETH-RELAIS8

DELIB API Reference | Seite 306


Commands Starter Starter RO BS NET Other
USB* ETH** Serie Serie Serie

DAPI_SPECIAL_DI_FF_FILTER 5-255 1-255 1-255 1-255 1-255


DAPI_SPECIAL_DI_FF_FILTER_
VALUE_SET
DAPI_SPECIAL_DI_FF_FILTER_
VALUE_GET
DAPI_SPECIAL_DI_FILTER x 0, 0, 0, 0,
DAPI_SPECIAL_DI_FILTER_ 1-254 1-254 1-254 1-254
VALUE_SET
DAPI_SPECIAL_DI_FILTER_
VALUE_GET
DAPI_SPECIAL_CMD_GET_ x x x x
INTERNAL_STATISTIC
*: USB-OPTOIN8, USB-Mini-Stick, USB-TTL-64
**: ETH-TTL64, ETH-OPTOIN8, ETH-RELAIS8

Commands Available for


DAPI_SPECIAL_CMDEXT_CAN_WR_RUNTIME NET-CPU-PRO,
_VALUE BS-WEU,
DAPI_SPECIAL_CMDEXT_CAN_RD_RUNTIME_ RO-ETH-LC
VALUE

DELIB API Reference | Seite 307


Appendix

VIII

Appendix | Seite 308


8. Appendix
8.1. Contact / Support
If you have any questions about the product or need assistance with
commissioning, you can reach us at the following numbers:

Support Software
Tel. +49 (0) 22 32 / 50 40 8 – 20

Support Hardware
Tel. +49 (0) 22 32 / 50 40 8 – 30

Support via E-mail


[email protected]

8.2. Environment and disposal


You can return the defective or obsolete product to us at the end of its service
life. As a manufacturer and distributor of electronic assemblies, we will take
care of the proper disposal for you in accordance with the applicable legal
regulations. For this purpose, it is best to use our return form on the homepage:

Return form

Appendix | Seite 309


8.3. Revisions
Rev 1.00 Development of the first edition

Appendix | Seite 310


8.4. Copyrights and trademarks
Linux is a registered trademark of Linus Torvalds.

USB is a registered trademark of USB Implementers Forum Inc.

LabVIEW is a registered trademark of National Instruments.

Intel is a registered trademark of Intel Corporation.

AMD is a registered trademark of Advanced Micro Devices, Inc.

ProfiLab is a registered trademark of ABACOM Ingenieurbüro GbR.

ispVM System is a registered trademark of Lattice Semiconductor Corporation.

Windows, Visual-C/C++, -C#, -Basic, -Basic.NET and Visual-Studio are registered


trademarks of Microsoft Corporation.

Delphi is a registered trademark of Borland Software Corporation.

Java is a registered trademark of Oracle Corporation.

Appendix | Seite 311

You might also like