Manual e Canbox Serie
Manual e Canbox Serie
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
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
Index | Seite 2
INDEX
4.5.1. Relais 32
4.5.1.1. Technical data 32
4.5.2. MOSFET/PWM 36
4.5.2.1. Technical data 36
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.5.2. ProfiLab 52
Index | Seite 3
INDEX
6. ICT-Tool 116
6.1. General descriptions 117
Index | Seite 4
INDEX
Index | Seite 5
INDEX
Index | Seite 6
INDEX
Index | Seite 7
INDEX
Index | Seite 8
INDEX
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!
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
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:
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.
Pin Description
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.
Commissioning | Seite 24
Hardw are description
IV
Electrical data:
Power supply 24V version: +7V..+24V DC
Power supply 48V version: +10V..+48V DC
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
* 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)
11 CAN-HIGH
22 CAN-LOW
1. Bootvorgang
Der Bootvorgang startet direkt nach dem Einschalten der
Spannungsversorgung.
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.
1 NO1 7 NO2
2 COM1 8 COM2
3 NC1 9 NC2
4 NO3 10 NO4
5 COM3 11 COM4
6 NC3 12 NC4
1 NO5 7 NO6
2 COM5 8 COM6
3 NC5 9 NC6
4 NO7 10 NO8
5 COM7 11 COM8
6 NC7 12 NC8
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
!!! 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.
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.
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
In the chapter DELIB API Referenz you will find all functions of our driver library
explained and provided with application examples.
These protocols can be used without our DELIB driver library on devices with
corresponding interface. The way over our protocols are operating system
independent.
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
di1 0, 1, 2, ...
di8
- hex nounit
di16 0, 8, 16, ...
di32
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
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
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.
delib_cli DO1 3 0
switches off the 4th digital relay
delib_cli DO16 0 0
switches off the digital relays 1 to 16
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
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)
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
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
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.
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
These are entered in the project settings of the compiler in the following.
Visual-C/C++ Start and open in the menu "Project Properties.
This example is intended to show how such functions can be used in LabVIEW.
The voltage ranges for the function are already predefined in the DELIB driver
library.
Here the hexadecimal value, which you can take from the delib.h file, was
passed as parameter for the mode
Example in C:
handle = DapiOpenModule(RO_ETH, 0); // opens a RO-ETH module with module
Example in Labview:
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.
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.
The DELIB driver library enables a uniform response of DEDITEC hardware, with
special consideration of the following aspects:
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
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.
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.
·C
· C++
· C#
· Delphi
· VisualBasic
· VB.NET
· MS-Office
· LabVIEW
· Java
The DELIB Sample Sources have been successfully installed. Press Close to
finish the installation.
Now the Windows Explorer opens with an overview of all products for which a
sample program is available.
You can now open the source code of the sample program (in this case .cpp
file) with any text editor.
Select your destination folder and then click the "Unzip" button.
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".
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".
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 DELIB CLI command for Linux is located in the folder /deditec-cli/ after
unpacking the zip archive "delib-linux-cli".
Note:
The individual parameters are separated only by a space.
Upper and lower case are not considered here.
di1 0, 1, 2, ...
di8
0, 8, - hex nounit
di16
16, ...
di32
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
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.
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"
IMPORTANT!! You need admin rights to run it. Therefore use the command with
"sudo".
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 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
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
VI
2. Calls up the information window (see below). There you will find all I/O-
specific information
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
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
In this example, a WEU-RELAIS-8 from our Startet series with 8 digital outputs
was connected via Ethernet.
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.
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
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.
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).
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
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).
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
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.
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.
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.
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
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.
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
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.
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
Factory settings
DHCP off
IP-Adresse 192.168.1.1
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.
WLAN active
Indicates whether the module is connected via WLAN.
Router name
Shows which router name is used to connect via WLAN.
Router password
Displays the router password used.
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
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.
Factory settings
Password DefaultPWD
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.
Server
Here you can set the NTP server to be used.
Port
Here you can set the NTP port to be used.
Factory settings
Server 0.de.pool.ntp.org
Port 123
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.
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.
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.
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.
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.
Factory settings
Note:
The channel name may be a maximum of 16 characters long.
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.
CAN is active
(only displayed if the module supports this function)
Use EXT ID
Displays the extended ID of the interface module used
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.
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.
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.
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.
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.
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.
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
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
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.
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.
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.
"Set DO output"
Switches a digital output on or off.
On/Off
Switches the respective output relay on or off.
Readback
Displays the current status of the respective relay (on or off).
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.
On/Off
Switches the respective output relay on or off.
Readback
Displays the current status of the respective relay (on or off).
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.
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
Value
Reads out the value on the respective A/D channel.
Mode readback
Reads the currently used A/D mode from the module.
Filter readback
Reads the currently used A/D filter from the 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.
Value
Indicates the current temperature.
Status
Displays the current status of the temperature sensor.
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
Start / Stop
Starts or ends the graphical output
Reset
Deletes the current issue
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.
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.
Watchdog enable
Activates the watchdog
Watchdog disable
Deactivates the watchdog
Watchdog retrigger
Resets the watchdog stick status
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.
Total count
Shows how many commands have been executed.
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.
A/D filterlevel
Indicates which A/D filter level is to be used for this test
Total count
Shows how many commands have been executed.
Max. deviation
Displays the highest deviation within a deviation range.
Test evaluation
The lowest, highest and average time required is determined here. The access
time per second is also determined.
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.
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
Value
Displays the voltage connected to the channel.
Offset
Displays the last deviation when measuring the voltage.
Frequency_rb
Indicates the current frequency with which the deviation is measured.
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
TODO
How the FIFO should be read/written
Module type
Indicates whether it is an interface/submodule.
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.
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
2. All important information, error and status messages that occurred during the
flash process are entered here.
Language
Specifies the language in which the ICT-Tool should be displayed.
Currently, only German and English can be selected.
VII
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
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
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
UC_CAN 44
BS_USB2 45
CAN_BOX 46
$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.
$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_INCLUDE% à c:\Programs\DEDITEC\DELIB\include"
Definition
ULONG DapiOpenModule(ULONG moduleID, ULONG nr);
Parameter
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;
}
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)
Definition
ULONG DapiSpecialCommand(ULONG handle,
DAPI_SPECIAL_CMD_GET_MODULE_CONFIG, par, 0, 0);
Parameter
handle=Dies ist der handle eines offenen Moduls
Return value
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
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
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;
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;
}
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;
}
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;
}
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;
}
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;
}
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
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
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();
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
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.
Programming example
DapiDOSet1_WithTimer(handle, 2, 1, 1000);
//Setting channel 2 for 1000msec to 1
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.
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);
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);
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:
ADDA_MODE_UNIPOL_10V 0V .. 10V
ADDA_MODE_UNIPOL_5V 0V .. 5V
ADDA_MODE_UNIPOL_2V5 0V .. 2,5V
Currents:
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
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
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.
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).
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
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.
Definition
void DapiSpecialCommand(handle, DAPI_SPECIAL_CMD_AD, cmd, par1, par2);
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
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
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.
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;
}
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;
}
Baudrate Value
1 MBit/s 0x00
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.
useExtID Value
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.
OFF 0x00
RX-Event 0x02
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.
1 0x01
2 0x02
3 0x03
4 0x04
.. 9 .. 0x09
* 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.
useExtID Value
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.
TX-Mode Value
Custom1 0x20
Custom2 0x21
Custom3 0x22
Programming example
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.
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.
UseExtID Value
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.
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.
RX-Mode Value
Custom1 0x1e
Custom2 0x1f
Custom3 0x20
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.
"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.
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
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.
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.
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.
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.
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.
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)
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.
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.
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.
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.
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.
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.
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
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.
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.
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.
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.
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.
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.
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
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.
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
// ----------------------------------------------------
// 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 ;
}
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_TIMEOUT_SET_VALUE_
SEC All modules
DAPI_SPECIAL_TIMEOUT_ACTIVATE
DAPI_SPECIAL_TIMEOUT_DEACTIVATE
DAPI_SPECIAL_TIMEOUT_GET_STATUS
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
VIII
Support Software
Tel. +49 (0) 22 32 / 50 40 8 – 20
Support Hardware
Tel. +49 (0) 22 32 / 50 40 8 – 30
Return form