ÿþþ ÿ R O - C A N - I N T E R F A C E ...
ÿþþ ÿ R O - C A N - I N T E R F A C E ...
ÿþþ ÿ R O - C A N - I N T E R F A C E ...
You also want an ePaper? Increase the reach of your titles
YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.
RO-CAN-INTERFACE<br />
Hardware-Description<br />
2012<br />
Juli
INDEX<br />
1. Introduction 7<br />
1.1. General remarks 7<br />
1.2. Customer satisfaction 7<br />
1.3. Customer response 7<br />
2. Hardware description 9<br />
2.1. Overview screen 9<br />
2.2. Technical data 10<br />
2.3. Plug-in connector of the module 11<br />
2.3.1. Power supply<br />
11<br />
2.3.2. CAN interface<br />
11<br />
2.4. Control LEDs 12<br />
2.4.1. Definition of LEDs<br />
3. Configuring the module 14<br />
3.1. DIP-switches 14<br />
3.2. The “special mode” 15<br />
3.3. Software mode 16<br />
3.4. DIP-switch mode 18<br />
3.4.1. Setting up the transfer rate<br />
3.4.2. Setting up the CAN module address<br />
4. Firmware update 22<br />
4.1. DEDITEC Flasher 22<br />
5. CAN-Configuration Utility 26<br />
5.1. Configuration 27<br />
5.1.1. Basic configuration<br />
12<br />
18<br />
19<br />
27<br />
Index | Seite 2
INDEX<br />
5.1.1.1. Select Config-Port (1)<br />
5.1.1.2. Test communication with module (2)<br />
5.1.2. Select the configuration<br />
5.1.2.1. Create new configuration (1)<br />
5.1.2.2. Load current configuration (2)<br />
5.1.3. Value range and CAN-Baudrate<br />
5.1.3.1. Set the CAN-Baudrate (1)<br />
5.1.3.2. Set the A/D value range (2)<br />
5.1.3.3. Set the D/A value range (3)<br />
5.1.3.4. Set timeout (4)<br />
5.1.4. DEDITEC address mode<br />
5.1.4.1. Set the address mode (1)<br />
5.1.4.2. Set the module address (2)<br />
5.1.4.3. Set the response module address (3)<br />
5.1.5. Auto Tx mode<br />
34<br />
5.1.6. Auto Rx mode<br />
35<br />
5.1.7. Save and exit<br />
36<br />
5.2. Structure of the CAN packets 37<br />
5.2.1. Digital inputs<br />
5.2.1.1. Structure of an 8-byte CAN packet<br />
5.2.2. Digital outputs<br />
5.2.2.1. Structure of an 8-byte CAN packet<br />
5.2.3. Digital input counter (16-bits)<br />
5.2.3.1. Structure of an 8-byte CAN packet<br />
5.2.4. Digital input counter (48-bits)<br />
5.2.4.1. Structure of an 8-byte CAN packet<br />
5.2.5. A/D inputs<br />
5.2.5.1. Structure of an 8-byte CAN packet<br />
5.2.5.2. Examples for setting the value range<br />
5.2.5.2.1. Setting voltage range ±10V<br />
5.2.5.2.2. Setting voltage range 0-5V<br />
5.2.5.2.3. Setting current range 0-20mA<br />
5.2.6. D/A outputs<br />
5.2.6.1. Structure of an 8-byte CAN packet<br />
5.2.6.2. Examples for setting the value range<br />
5.2.6.2.1. Setting voltage range ±10V<br />
5.2.6.2.2. Setting voltage range 0-5V<br />
5.2.6.2.3. Setting current range 0-20mA<br />
5.2.7. Temperature inputs<br />
27<br />
28<br />
29<br />
29<br />
29<br />
30<br />
30<br />
30<br />
31<br />
31<br />
32<br />
32<br />
32<br />
33<br />
37<br />
37<br />
38<br />
38<br />
39<br />
39<br />
40<br />
40<br />
41<br />
41<br />
41<br />
41<br />
42<br />
42<br />
43<br />
43<br />
43<br />
43<br />
44<br />
44<br />
45<br />
Index | Seite 3
INDEX<br />
5.2.7.1. Structure of an 8-byte CAN packet<br />
5.2.8. Stepper<br />
5.2.8.1. Structure of an 8-byte CAN packet<br />
5.2.8.2. Command list<br />
5.2.8.3. Values for par 1 for command<br />
SET_MOTORCHARACTERISTIC<br />
5.2.8.4. Values for par 1 for command GO_REFSWITCH<br />
5.2.8.5. Example<br />
5.3. Control LEDs 49<br />
6. Software 51<br />
6.1. Using our products 51<br />
6.1.1. Access via graphical applications<br />
51<br />
6.1.2. Access via the DELIB driver library<br />
51<br />
6.1.3. Access via protocol<br />
51<br />
6.1.4. Access via provided test programs<br />
52<br />
6.2. DELIB driver library 53<br />
6.2.1. Overview<br />
6.2.1.1. Program under diverse operating systems<br />
6.2.1.2. Program with diverse programming languages<br />
6.2.1.3. Program independent of the interface<br />
6.2.1.4. SDK-Kit for Programmer<br />
6.2.2. Supported operating systems<br />
55<br />
6.2.3. Supported programming languages<br />
55<br />
6.2.4. Installation DELIB driver library<br />
56<br />
6.2.5. DELIB Configuration Utility<br />
60<br />
6.3. Integration of the DELIB 61<br />
6.3.1. Integration of the delib.h in Visual-C/C++<br />
61<br />
6.3.2. Integration of the delib.cs in Visual-C#<br />
64<br />
6.3.3. Integration of the delib.cs in Visual-C# unter Windows 64bit 65<br />
6.3.4. Integration of the delib.pas in Delphi<br />
69<br />
6.3.5. Integration of the delib.bas in Visual Basic<br />
70<br />
6.3.6. Integration of the delib.vb in VB.NET<br />
71<br />
6.3.7. Integration of the delib.bas in MS-Office (VBA) 72<br />
6.3.8. Integration of the delib.dll in LabVIEW<br />
74<br />
6.3.8.1. Integration of the delib.dll in LabVIEW<br />
74<br />
6.3.8.2. Usage of the VIs in LabVIEW<br />
45<br />
46<br />
46<br />
46<br />
47<br />
48<br />
48<br />
53<br />
53<br />
54<br />
54<br />
54<br />
83<br />
Index | Seite 4
INDEX<br />
6.4. Test programs 85<br />
6.4.1. Digital Input-Output Demo<br />
85<br />
6.4.2. Analog Input-Output Demo<br />
86<br />
6.4.3. Stepper Demo<br />
87<br />
6.4.4. Watchdog Demo<br />
88<br />
6.4.5. Temperature Read Demo<br />
89<br />
6.5. DELIB CLI (command-line interface) 90<br />
6.5.1. Customisation for USB-Modules (only Linux)<br />
6.5.2. Customisation for RO-ETH-Modules (only Linux)<br />
6.5.3. DELIB CLI samples<br />
7. Appendix 99<br />
7.1. Revisions 99<br />
7.2. Copyrights and trademarks 100<br />
92<br />
93<br />
94<br />
Index | Seite 5
Introduction<br />
I<br />
Introduction |Seite 6
1. Introduction<br />
1.1. General remarks<br />
First of all, we would like to congratulate you to the purchase of a high quality<br />
DEDITEC product.<br />
Our products are being developed by our engineers according to quality<br />
requirements of high standard. Already during design and development we take<br />
care that our products have -besides quality- a long availability and an optimal<br />
flexibility.<br />
Modular design<br />
The modular design of our products reduces the time and the cost of development.<br />
Therefor we can offer you high quality products at a competitive price.<br />
Availability<br />
Because of the modular design of our products, we have to redesign only a module<br />
instead of the whole product, in case a specific component is no longer available.<br />
1.2. Customer satisfaction<br />
Our philosophy: a content customer will come again. Therefor customer<br />
satisfaction is in first place for us.<br />
If by any chance, you are not content with the performance of our product, please<br />
contact us by phone or mail immediately.<br />
We take care of the problem.<br />
1.3. Customer response<br />
Our best products are co-developments together with our customers. Therefor we<br />
are thankful for comments and suggestions.<br />
Introduction |Seite 7
Hardware description<br />
II<br />
Hardware description |Seite 8
2. Hardware description<br />
2.1. Overview screen<br />
The figure shows the control module with CAN-interface (left side) combined with<br />
an input/output module (right side).<br />
The figure shows the control module with CAN-interface (left side) combined with a<br />
flexible connector input/output module (right side).<br />
Hardware description |Seite 9
2.2. Technical data<br />
Single power supply +7V..+24V DC<br />
7 control LEDs<br />
CAN 2.0A (11 Bit addressing)<br />
CAN 2.0B (29 Bit addressing)<br />
Transmission range up to 10km (at 10Kbit/s)<br />
Easy to configure over DIP switches<br />
Galvanically isolated interface using optocouplers<br />
9 pol. D-SUB socket<br />
Timeout feature providing ability to disconnect outputs for safety reasons<br />
Comfortable connector system with ejection mechanism<br />
Expandable in 16 gradations<br />
Can be combined without any problem to other modules of the RO series<br />
Hardware description |Seite 10
2.3. Plug-in connector of the module<br />
2.3.1. Power supply<br />
The input-power-supply-range lies between +7V and +24V DC. Power supply can<br />
be realized with a standard AC/DC adaptor with 1A output current. A suitable plugin<br />
connector is included.<br />
2.3.2. CAN interface<br />
The connection to the CAN bus is realized through a 9 pol D-SUB connector. It is<br />
galvanically isolated through optocouplers. The CAN module is configured over the<br />
PC’s RS-232 interface using the the included adaptor plug.<br />
Pin<br />
1 RS-232 config<br />
3 RS-232 config<br />
2 CAN low<br />
7 CAN high<br />
5 GND<br />
Hardware description |Seite 11
2.4. Control LEDs<br />
The CAN module has a series of control LEDs. They are used for easy visual<br />
indication of various state functions.<br />
While switching-on the module in DIP-switch mode oder software mode, the<br />
module should signalize the following sequence:<br />
all five LEDs flashing briefly<br />
right LED (I/O access) flashing briefly<br />
In ”special mode”, the following signal sequence should be seen:<br />
all five LEDs flashing briefly<br />
right LED (I/O access) flashing briefly<br />
all five LEDs flashing briefly<br />
2.4.1. Definition of LEDs<br />
LED Description<br />
3,3V Internal 3,3V power supply<br />
5V Internal 5V power supply<br />
Interface Active communication- over the CAN bus<br />
Activity<br />
ERROR Error during CAN-transfer (for details see document ”CAN<br />
protocol”)<br />
Inputs: Change State change between 2 read-out cylces detected<br />
Outputs: Auto-Due<br />
to timeout, all outputs are switched-off for safety reasons<br />
Off<br />
I/O Access CPU-access on the inputs and outputs of the connected<br />
modules<br />
Hardware description |Seite 12
Configuring the module<br />
III<br />
Configuring the module |Seite 13
3. Configuring the module<br />
In order to integrate a module into an existing bus system, it is necessary to first<br />
assign a free module address and the appropriate bit rate. The ”special mode”<br />
may be alternatively used to quickly operate the system.<br />
3.1. DIP-switches<br />
Some of the settings are easily configurable using DIP-switches. Configurable are<br />
the ”special mode”, the activation of the extended IDs, the data transfer range or<br />
the module’s address.<br />
DIP-switch A8 DIP-switch A7 Description<br />
ON ON ”special mode” -> Blinking squency during<br />
start-up (5 LEDs, 1 right LED, 5 LEDs),<br />
100KHz, CAN-ID=0x100, Response-<br />
Module-Addr=1, keine 29 Bit Adressen<br />
ON OFF Only for SERVICE-purpose: application<br />
won’t start. Forced into bootloader<br />
OFF ON Software mode: configuration by software<br />
OFF OFF DIP-switch mode: configuration by DIP-<br />
Switches, Response-Module-Addr=1, CAN<br />
2.0A<br />
DIP-switch Description<br />
A6 to A4 *) Setting up transfer rate<br />
A3 to A1 *) Setting up CAN address<br />
B8 to B1 *) Setting up CAN address<br />
*) if A8 and A7 = OFF<br />
Configuring the module |Seite 14
3.2. The “special mode”<br />
The ”special mode” is to quickly and easily set the device to the default values. This<br />
is helpfull for a quick and easy setup and facilitates an error analysis or an initial<br />
operation.<br />
This mode is active, if switching the DIP-switches A7 and A8 to ”ON”. The<br />
remaining DIP-switches are disabled. The module will work with the following<br />
settings:<br />
11 bit-addressing<br />
100 kbit/s bitrate<br />
CAN-address = 0x100<br />
Response-Modul-Addr = 1 (responses are sent to this address)<br />
Configuring the module |Seite 15
3.3. Software mode<br />
This module can configured in “software mode” only with the small CAN/SER<br />
program adpater, which is included in delivery. Configuration will be done by the<br />
serial interface of your pc.<br />
For using the software mode, the dip switches A7 and A8 must be set “on”. Dip<br />
switch changes will be taken over, only by restart of the module.<br />
Connect the module with a DSUB-9 cable to the RS-232 interface of your pc with<br />
the CAN/SER adapter and connect it with the CAN-module.<br />
After installing the DELIB driver library, you can find under Start ->Programs -><br />
DEDITEC ->DELIB, the DELIB Configuration Utility.<br />
Configuring the module |Seite 16
Approach:<br />
1. Choose the RO-CAN module<br />
2. Choose COM port, that is connected to the module<br />
3. Test commuikation with RO-CAN module<br />
4. This button shows the config of the module<br />
5. Here you can save your configuration to the module<br />
6. This button loads the config of the module<br />
Configuring the module |Seite 17
3.4. DIP-switch mode<br />
In this mode, the module is entirely set up by DIP-switch. This mode is active, if<br />
DIP-switch A7=OFF and A8=OFF. The address range is 11 bit large (CAN 2.0A).<br />
The module-address is set using the DIP-switches (DIP A3..A1 und B8..B1). The<br />
Response-Modul-Addr = 1 (responses are sent to this address).<br />
3.4.1. Setting up the transfer rate<br />
The bit rate is dependent on the CAN bus data transfer range. 3 DIP-switches are<br />
used to set the bit rate. Other bit rates can be implemented on customer request.<br />
Bitrate 1Mbit 500K 250K 125K 100K 50K 20K 10K<br />
DIP-switch A6 On On On On Off Off Off Off<br />
DIP-switch A5 On On Off Off On On Off Off<br />
DIP-switch A4 On Off On Off On Off On Off<br />
Configuring the module |Seite 18
3.4.2. Setting up the CAN module address<br />
Any connected device to the CAN network needs a fix address in order to be<br />
directly accessed. With the 11 DIP-switches, up to 2047 different addresses are<br />
selectable. Further 18 addressing bits may be supplemented by software. To<br />
unlock this option, DIP-switch 7A must be set to ON.<br />
Baud rate Bit Value ON Value OFF<br />
DIP-switch A3 Bit 10 1024 0<br />
DIP-switch A2 Bit 9 512 0<br />
DIP-switch A1 Bit 8 256 0<br />
DIP-switch B8 Bit 7 128 0<br />
DIP-switch B7 Bit 6 64 0<br />
DIP-switch B6 Bit 5 32 0<br />
DIP-switch B5 Bit 4 16 0<br />
DIP-switch B4 Bit 3 8 0<br />
DIP-switch B3 Bit 2 4 0<br />
DIP-switch B2 Bit 1 2 0<br />
DIP-switch B1 Bit 0 1 0<br />
Configuring the module |Seite 19
Examples:<br />
Baud rate Address 0 Address 117 Address 588<br />
DIP-switch A3 Off Off Off<br />
DIP-switch A2 Off Off On<br />
DIP-switch A1 Off Off Off<br />
DIP-switch B8 Off Off Off<br />
DIP-switch B7 Off On On<br />
DIP-switch B6 Off On Off<br />
DIP-switch B5 Off On Off<br />
DIP-switch B4 Off Off On<br />
DIP-switch B3 Off On On<br />
DIP-switch B2 Off Off Off<br />
DIP-switch B1 Off On Off<br />
Configuring the module |Seite 20
Firmware update<br />
IV<br />
Firmware update |Seite 21
4. Firmware update<br />
4.1. DEDITEC Flasher<br />
You can find the latest firmware version for your DEDITEC product always at the<br />
download section of our homepage.<br />
( -> http://www.deditec.de/en/module/downloads/firmware-updates.html )<br />
Approach after download<br />
Unzip the ZIP archive<br />
Start the program deditec-flasher.exe<br />
The following application will be opened:<br />
You can find a detailed description of the available commands on the following<br />
page.<br />
Firmware update |Seite 22
1. Select the Interface of the module of the RO-Series<br />
Command (Key) Interface<br />
U USB-Interface<br />
S Serial Interface (RS-232 / RS-485)<br />
C CAN-Interface<br />
E Ethernet-Interface<br />
V USB2-Interface<br />
Note:<br />
1) The current selected interface will be displayed in the last line (Selected Device<br />
= USB)<br />
2) Press key Q to flash "non-RO-Series-products" (USB-Mini-Sticks, USB-Logi-<br />
500, ..)<br />
3) In order to flash products of the RO-CAN-Series, you have to connect the<br />
module with your PC via the CAN/SER adapter.<br />
2. Additional options<br />
Command (Key) Description<br />
D Flasher runs in DEBUG mode<br />
Therefore, additional information will be displays<br />
P Reads the current firmware of connected DEDITEC<br />
products<br />
3. Select the module which you want to flash (RO-Series only)<br />
Command (Key) Description<br />
M Flash the RO-Interface module<br />
A Flash all AD16, AD16-DA4, DA4 or AD16_ISO sub<br />
modules<br />
B Flash all DA2_ISO sub modules<br />
G Flash all STEPPER2 sub modules<br />
H Flash all O8-R8 or M16 sub modules<br />
I Flash all PT100 sub modules<br />
J Flash all CNT8 or CNT/IGR sub modules<br />
Z Scan the module for available sub modules<br />
Firmware update |Seite 23
After successful update procedure, the message FLASH-OK! appears.<br />
Firmware update |Seite 24
CAN-Configuration Utility<br />
V<br />
CAN-Configuration Utility |Seite 25
5. CAN-Configuration Utility<br />
Start "CAN Configuration Utility" as follows:<br />
Start Programme DEDITEC DELIB CAN<br />
The "CAN Configuration Utility" is used to configure DEDITEC CAN modules.<br />
Additionally, it enables the control of the automatic reception mode (Auto-Rx) and<br />
the automatic transmit mode (Auto-Tx). The Auto-Rx-mode allows to configure up<br />
to 4 different data packets, which can be received from other CAN addresses<br />
automatically. However, the Auto-Tx-mode allows to send automatically also up to<br />
4 different data packets to other CAN addresses.<br />
CAN-Configuration Utility |Seite 26
5.1. Configuration<br />
5.1.1. Basic configuration<br />
To start the "CAN Configuration Utility", the CAN module has to be in the software<br />
mode (-> Software mode).<br />
After starting program, the following window appears:<br />
5.1.1.1. Select Config-Port (1)<br />
Select via the drop-down list Select Config-Port, the COM port, to which the<br />
module is connected.<br />
CAN-Configuration Utility |Seite 27
5.1.1.2. Test communication with module (2)<br />
You can test the communication with the module via the button Test<br />
Communication with RO-CAN Module.<br />
Notice:<br />
If the communication with the module is not possible, the following errors could be<br />
responsible for:<br />
1) CAN / SERIAL adapter is not plugged<br />
2) Wrong COM port selected<br />
3) Module is not turned on<br />
CAN-Configuration Utility |Seite 28
5.1.2. Select the configuration<br />
5.1.2.1. Create new configuration (1)<br />
With the button New Configuration, you create a complete new (empty)<br />
configuration.<br />
5.1.2.2. Load current configuration (2)<br />
You can load the current configuration of the module via the button Load Config<br />
from Module.<br />
Notice:<br />
Please note that a new or edited configuration will take effect only after transferring<br />
to the module.<br />
CAN-Configuration Utility |Seite 29
5.1.3. Value range and CAN-Baudrate<br />
5.1.3.1. Set the CAN-Baudrate (1)<br />
You can set the CAN-Baudrate vie the drop-down list Baudrate. The baudrate<br />
indicates the transfer speed of the module.<br />
5.1.3.2. Set the A/D value range (2)<br />
You can set the value range of the A/D Converter via the drop-down list A/D -<br />
Range. The value range indicates the range, in which digital signals will be<br />
converted analogously (e.g. in the range 0-5V). If there is no A/D converter<br />
connected, this setting will be ignored.<br />
CAN-Configuration Utility |Seite 30
5.1.3.3. Set the D/A value range (3)<br />
You can set the value range of the D/A Converter via the drop-down list D/A -<br />
Range. The value range indicates the range, in which analogous signals (e.g. in<br />
the range 0-10V) will be converted digital. If there is no D/A converter connected,<br />
this setting will be ignored.<br />
5.1.3.4. Set timeout (4)<br />
You can set the timeout time via the drop-down list Timeout for outputs. The<br />
timeout protection provides the ability to disable the outputs of the module<br />
automatically, if no more messages were received by the module, in this defined<br />
timeframe. If no timeout is desired, please select the setting not active.<br />
CAN-Configuration Utility |Seite 31
5.1.4. DEDITEC address mode<br />
The following settings apply only to the DEDITEC address mode:<br />
5.1.4.1. Set the address mode (1)<br />
You can set the address mode via the drop-down list Adress Mode. With this<br />
setting, the DEDITEC address Mode is used.<br />
5.1.4.2. Set the module address (2)<br />
The text line Module-Adress [hex] allows to set the address of the module. The<br />
module will be addressed by this address. Please note, that the module address<br />
must be hexadecimal.<br />
CAN-Configuration Utility |Seite 32
5.1.4.3. Set the response module address (3)<br />
The text line Response-Module-Adress [hex] allows to set an address, to which<br />
the module returns a confirmation, once the module has received a packet. Please<br />
note, that the module address must be hexadecimal.<br />
CAN-Configuration Utility |Seite 33
5.1.5. Auto Tx mode<br />
The automatic transmit mode (Auto-Tx-mode) allows to send automatically up to 4<br />
different data packets to other CAN addresses.<br />
Approach:<br />
1. Set the packet number (a total of 4 different packets available).<br />
2. Activate the TX packet.<br />
3. Set the Time-Interval, in which the module will transmit packets automatically.<br />
4. Set the address range (11 bits or 29 bits).<br />
5. Set the module address to which the packet should be sent.<br />
6. Set the data (e.g. channels of a module), which should be sent.<br />
7. Next.<br />
CAN-Configuration Utility |Seite 34
5.1.6. Auto Rx mode<br />
The automatic reception mode (Auto-Rx-mode) allows to receive automatically up<br />
to 4 different data packets from other CAN addresses.<br />
Approach:<br />
1. Set the packet number (a total of 4 different packets available).<br />
2. Activate the RX packet.<br />
3. Set the address range (11 bits or 29 bits).<br />
4. Set the address at which the packet should be received.<br />
5. Set the module (or channels of a module) to which the data packets should be<br />
given.<br />
6. Next.<br />
CAN-Configuration Utility |Seite 35
5.1.7. Save and exit<br />
Approach:<br />
1. Save and transfer the current configuration to the module.<br />
2. Show a summary of the current configuration of the module. Please note, that<br />
this option is only available, if the module is in the software mode (-> Software<br />
mode).<br />
3. Exit program.<br />
CAN-Configuration Utility |Seite 36
5.2. Structure of the CAN packets<br />
5.2.1. Digital inputs<br />
5.2.1.1. Structure of an 8-byte CAN packet<br />
CAN-Data-Byte Content<br />
1 DI channel 1-8 (Bit 0-7)<br />
2 DI channel 9-16 (Bit 0-7)<br />
3 DI channel 17-24 (Bit 0-7)<br />
4 DI channel 25-32 (Bit 0-7)<br />
5 DI channel 33-40 (Bit 0-7)<br />
6 DI channel 41-48 (Bit 0-7)<br />
7 DI channel 49-56 (Bit 0-7)<br />
8 DI channel 57-64 (Bit 0-7)<br />
This example shows the structure of an auto-Tx-packet with the settings for DI<br />
channel 1-64 (-> Auto Tx Mode).<br />
CAN-Configuration Utility |Seite 37
5.2.2. Digital outputs<br />
5.2.2.1. Structure of an 8-byte CAN packet<br />
CAN-Data-Byte Content<br />
1 DO channel 1-8 (Bit 0-7)<br />
2 DO channel 9-16 (Bit 0-7)<br />
3 DO channel 17-24 (Bit 0-7)<br />
4 DO channel 25-32 (Bit 0-7)<br />
5 DO channel 33-40 (Bit 0-7)<br />
6 DO channel 41-48 (Bit 0-7)<br />
7 DO channel 49-56 (Bit 0-7)<br />
8 DO channel 57-64 (Bit 0-7)<br />
This example shows the structure of an auto-Rx-packet with the settings for DO<br />
channel 1-64 (-> Auto Rx Mode).<br />
CAN-Configuration Utility |Seite 38
5.2.3. Digital input counter (16-bits)<br />
5.2.3.1. Structure of an 8-byte CAN packet<br />
CAN-Data-Byte Content<br />
1 DI counter 1 (Bit 0-7)<br />
2 DI counter 1 (Bit 8-15)<br />
3 DI counter 2 (Bit 0-7)<br />
4 DI counter 2 (Bit 8-15)<br />
5 DI counter 3 (Bit 0-7)<br />
6 DI counter 3 (Bit 8-15)<br />
7 DI counter 4 (Bit 0-7)<br />
8 DI counter 4 (Bit 8-15)<br />
This example shows the structure of an auto-Tx-packet with the settings for DI<br />
counter 1-4 (-> Auto Tx Mode).<br />
CAN-Configuration Utility |Seite 39
5.2.4. Digital input counter (48-bits)<br />
5.2.4.1. Structure of an 8-byte CAN packet<br />
CAN-Data-Byte Content<br />
1 CNT8 counter 1 (Bit 0-7)<br />
2 CNT8 counter 1 (Bit 8-15)<br />
3 CNT8 counter 1 (Bit 16-23)<br />
4 CNT8 counter 1 (Bit 24-31)<br />
5 CNT8 counter 2 (Bit 0-7)<br />
6 CNT8 counter 2 (Bit 8-15)<br />
7 CNT8 counter 2 (Bit 16-23)<br />
8 CNT8 counter 2 (Bit 24-31)<br />
This example shows the structure of an auto-Tx-packet with the settings for CNT8<br />
counter 1-2 (-> Auto Tx Mode).<br />
Notice:<br />
Please note, that only the first 32-bit of an 48-bit input counter can be sent in one<br />
CAN packet<br />
CAN-Configuration Utility |Seite 40
5.2.5. A/D inputs<br />
5.2.5.1. Structure of an 8-byte CAN packet<br />
CAN-Data-Byte Content<br />
1 A/D channel 5 (Bit 0-7)<br />
2 A/D channel 5 (Bit 8-15)<br />
3 A/D channel 6 (Bit 0-7)<br />
4 A/D channel 6 (Bit 8-15)<br />
5 A/D channel 7 (Bit 0-7)<br />
6 A/D channel 7 (Bit 8-15)<br />
7 A/D channel 8 (Bit 0-7)<br />
8 A/D channel 8 (Bit 8-15)<br />
This example shows the structure of an auto-Tx-packet with the settings for AD<br />
channel 5-8 (-> Auto Tx Mode).<br />
5.2.5.2. Examples for setting the value range<br />
The value range of an A/D converter indicates the range, in which analogue signals<br />
(eg in the range 0-5V) were converted digitally. The configuration of the value<br />
range can be set in the CAN Configuration Utility (-> Set the A/D value range).<br />
Notice:<br />
The hexadecimal value FFFF always characterizes the upper limit of a value range,<br />
value 0000 the lower limit.<br />
5.2.5.2.1. Setting voltage range ±10V<br />
Value (hex) Voltage<br />
FFFF +10V<br />
8000 0V<br />
0000 -10V<br />
CAN-Configuration Utility |Seite 41
5.2.5.2.2. Setting voltage range 0-5V<br />
Value (hex) Voltage<br />
FFFF +5V<br />
8000 +2,5V<br />
0000 0 V<br />
5.2.5.2.3. Setting current range 0-20mA<br />
Value (hex) Current<br />
FFFF 20 mA<br />
8000 10 mA<br />
0000 0 mA<br />
CAN-Configuration Utility |Seite 42
5.2.6. D/A outputs<br />
5.2.6.1. Structure of an 8-byte CAN packet<br />
CAN-Data-Byte Content<br />
1 D/A channel 1 (Bit 0-7)<br />
2 D/A channel 1 (Bit 8-15)<br />
3 D/A channel 2 (Bit 0-7)<br />
4 D/A channel 2 (Bit 8-15)<br />
5 D/A channel 3 (Bit 0-7)<br />
6 D/A channel 3 (Bit 8-15)<br />
7 D/A channel 4 (Bit 0-7)<br />
8 D/A channel 4 (Bit 8-15)<br />
This example shows the structure of an auto-Rx-packet with the settings for DA<br />
channel 1-4 (-> Auto Rx Mode).<br />
5.2.6.2. Examples for setting the value range<br />
The value range of an D/A converter indicates the range, in which digital signals<br />
were converted analogously (eg in the range 0-5V). The configuration of the value<br />
range can be set in the CAN Configuration Utility (-> Set the D/A value range).<br />
Notice:<br />
The hexadecimal value FFFF always characterizes the upper limit of a value range,<br />
value 0000 the lower limit.<br />
5.2.6.2.1. Setting voltage range ±10V<br />
Value (hex) Voltage<br />
FFFF +10V<br />
8000 0V<br />
0000 -10V<br />
CAN-Configuration Utility |Seite 43
5.2.6.2.2. Setting voltage range 0-5V<br />
Value (hex) Voltage<br />
FFFF +5V<br />
8000 +2,5V<br />
0000 0 V<br />
5.2.6.2.3. Setting current range 0-20mA<br />
Value (hex) Current<br />
FFFF 20 mA<br />
8000 10 mA<br />
0000 0 mA<br />
Notice:<br />
The output of an current range is only available for modules, which support that<br />
mode.<br />
CAN-Configuration Utility |Seite 44
5.2.7. Temperature inputs<br />
5.2.7.1. Structure of an 8-byte CAN packet<br />
CAN-Data-Byte Content<br />
1 PT100 channel 1 (Bit 0-7)<br />
2 PT100 channel 1 (Bit 8-15)<br />
3 PT100 channel 1 (Bit 16-23)<br />
4 PT100 channel 1 (Bit 24-31)<br />
5 PT100 channel 2 (Bit 0-7)<br />
6 PT100 channel 2 (Bit 8-15)<br />
7 PT100 channel 2 (Bit 16-23)<br />
8 PT100 channel 2 (Bit 24-31)<br />
This example shows the structure of an auto-Tx-packet with the settings for PT100<br />
channel 1+2 (-> Auto Tx Mode).<br />
CAN-Configuration Utility |Seite 45
5.2.8. Stepper<br />
5.2.8.1. Structure of an 8-byte CAN packet<br />
CAN-Data-Byte Content<br />
1 COMMAND<br />
2 PAR1 (Bit 0-7)<br />
3 PAR1 (Bit 8-15)<br />
4 PAR1 (Bit 16-23)<br />
5 PAR1 (Bit 24-31)<br />
6 PAR2 (Bit 0-7)<br />
7 PAR2 (Bit 8-15)<br />
8 PAR3 (Bit 0-7)<br />
5.2.8.2. Command list<br />
Commands with DAPI_STEPPER_CMD_ Value<br />
(hex)<br />
Description<br />
SET_MOTORCHARACTERISTIC 1 (hex) Set the motor characteristic<br />
GET_MOTORCHARACTERISTIC 2 (hex) Get the motor characteristic<br />
SET_POSITION 3 (hex) Set the motor position<br />
GO_POSITION 4 (hex) Go to position<br />
GET_POSITION 5 (hex) Get the motor position<br />
SET_FREQUENCY 6 (hex) Set the nominal motor frequency<br />
SET_FREQUENCY_DIRECTLY 7 (hex) Set the motor frequency<br />
GET_FREQUENCY 8 (hex) Get the motor frequency<br />
FULLSTOP 9 (hex) Immediate stopping the motor<br />
STOP 10 (hex) Stopping the motor (with deceleration slope)<br />
GO_REFSWITCH 11 (hex) Go to a reference position<br />
DISABLE 14 (hex) Enable/Disable the motor<br />
MOTORCHARACTERISTIC_LOAD_DEFAULT 15 (hex) Set the motor characteristic to default<br />
MOTORCHARACTERISTIC_EEPROM_SAVE 16 (hex) Save the motor characteristic to EEPROM<br />
MOTORCHARACTERISTIC_EEPROM_LOAD 17 (hex) Load the motor characteristic out of EEPROM<br />
GET_CPU_TEMP 18 (hex) Get the temperature of the CPU<br />
GET_MOTOR_SUPPLY_VOLTAGE 19 (hex) Get the supply voltage of the CPU<br />
GO_POSITION_RELATIVE 20 (hex) Go to a relative position<br />
CAN-Configuration Utility |Seite 46
5.2.8.3. Values for par 1 for command SET_MOTORCHARACTERISTIC<br />
Parameter<br />
(DAPI_STEPPER_MOTORCHAR_PAR_ ...)<br />
Value Description<br />
(dec)<br />
STEPMODE 1 Stepmode (Full-, 1/2-, 1/4-, 1/8-, 1/16-step)<br />
GOFREQUENCY 2 Speed [Full-step / s] - related to full-step<br />
STARTFREQUENCY 3 Startfrequency [Full-step / s]<br />
STOPFREQUENCY 4 Stopfrequency [Full-step / s]<br />
MAXFREQUENCY 5 Maximum frequency [Full-step / s]<br />
ACCELERATIONSLOPE 6 Acceleration slope [Full-step / ms]<br />
DECELERATIONSLOPE 7 Deceleration slope [Full-step / 10ms]<br />
PHASECURRENT 8 Phase current [mA]<br />
HOLDPHASECURRENT 9 Phase current for motor hold [mA]<br />
HOLDTIME 10 Time in that the hold goes to motorstop [ms]<br />
STATUSLEDMODE 11 Mode of the Status-LED<br />
INVERT_ENDSW1 12 Invert endswitch1<br />
INVERT_ENDSW2 13 Invert endswitch2<br />
INVERT_REFSW1 14 Invert referenceswitch1<br />
INVERT_REFSW2 15 Invert referenceswitch2<br />
INVERT_DIRECTION 16 Invert all direction details<br />
ENDSWITCH_STOPMODE 17 Setting of the stop behaviour (0=Fullstop /<br />
1=Stop)<br />
GOREFERENCEFREQUENCY_TOENDSWITCH 18 Frequency before endswitch [Full-step / s]<br />
GOREFERENCEFREQUENCY_AFTERENDSWITC<br />
H<br />
19 Frequency after endswitch [Full-step / s]<br />
GOREFERENCEFREQUENCY_TOOFFSET 20 Frequency to optional offset [Full-step / s]<br />
CAN-Configuration Utility |Seite 47
5.2.8.4. Values for par 1 for command GO_REFSWITCH<br />
Parameter<br />
(DAPI_STEPPER_GO_REFSWITCH_PAR_<br />
...)<br />
Value<br />
(dec)<br />
Description<br />
REF1 1 Go to refswitch 1<br />
REF2 2 Go to refswitch 2<br />
REF_LEFT 4 Go to the left edge of the refswitch<br />
REF_RIGHT 8 Go to the right edge of the refswitch<br />
REF_GO_POSITIVE 16 Start motor to the right<br />
REF_GO_NEGATIVE 32 Start motor to the left<br />
SET_POS_0 64 Set motor position to 0<br />
5.2.8.5. Example<br />
The command<br />
DapiStepperCommand(handle, 1, DAPI_STEPPER_CMD_GO_POSITION, 3200, 0, 0, 0);<br />
will be sent in an 8-byte CAN-packet. The packet has the following structure:<br />
CAN-Byte Type Value Byte<br />
1 COMMAND 4 04<br />
2 PAR1 (Bit 0-7)<br />
80<br />
3<br />
4<br />
PAR1 (Bit 8-15)<br />
PAR1 (Bit 16-23)<br />
3200<br />
0C<br />
00<br />
5 PAR1 (Bit 24-31) 00<br />
6<br />
7<br />
PAR2 (Bit 0-7)<br />
PAR2 (Bit 8-15)<br />
0<br />
00<br />
00<br />
8 PAR3 (Bit 0-7) 0 00<br />
CAN-Configuration Utility |Seite 48
5.3. Control LEDs<br />
The following examples show the functionality of the LEDs<br />
Example 1<br />
Once a second, a test counter will be sent automatically .<br />
-> The "CAN-ACTIVITY" LED blinks once a second.<br />
Example 2<br />
Once a second, an A/D value will be sent automatically<br />
-> The "CAN-ACTIVITY" LED blinks once a second.<br />
-> The "I/O-ACCESS" LED blinks every time, whenever accessing the A/D<br />
converter.<br />
Example 3<br />
Nothing is sent automatically. The module is set to the RX address 100hex (goes<br />
to the D/A converter).<br />
-> The "CAN-ACTIVITY" LED blinks whenever data go to the D / A converter.<br />
-> The "I/O-ACCESS" LED blinks every time, whenever accessing the D/A<br />
converter.<br />
CAN-Configuration Utility |Seite 49
Software<br />
VI<br />
Software |Seite 50
6. Software<br />
6.1. Using our products<br />
6.1.1. Access via graphical applications<br />
We provide driverinterfaces e.g. for LabVIEW and ProfiLab. The DELIB driver<br />
library is the basis, which can be directly activated by ProfiLAB.<br />
For LabVIEW, we provide a simple driver connection with examples!<br />
6.1.2. Access via the DELIB driver library<br />
In the appendix, you can find the complete function reference for the integration of<br />
our API-functions in your software. In addition we provide examples for the<br />
following programming languages:<br />
C<br />
C++<br />
C#<br />
Delphi<br />
VisualBasic<br />
VB.NET<br />
MS-Office<br />
6.1.3. Access via protocol<br />
The protocol for the activation of our products is open source. So you are able to<br />
use our products on systems without Windows or Linux.<br />
Software |Seite 51
6.1.4. Access via provided test programs<br />
We provide simple handling test programs for the most important functions of our<br />
products. These will be installed automatically by the installation of the DELIB<br />
driver library.<br />
So you can test directly e.g. relays or you can check the voltage of an A/D<br />
converter.<br />
Software |Seite 52
6.2. DELIB driver library<br />
6.2.1. Overview<br />
The following figure explains the structure of the DELIB driver library<br />
The DELIB driver library allows an uniform response of DEDITEC hardware with<br />
particular consideration of the following viewpoints:<br />
Independent of operating system<br />
Independent of programming language<br />
Independent of the product<br />
6.2.1.1. Program under diverse operating systems<br />
The DELIB driver library allows an uniform response of our products on diverse<br />
operating systems.<br />
We has made sure, that all of our products can be responded by a few commands.<br />
Whatever which operating system you use. - Therefore the DELIB cares!<br />
Software |Seite 53
6.2.1.2. Program with diverse programming languages<br />
We provide uniform commands to create own applications. This will be solved by<br />
the DELIB driver library.<br />
You choose the programming language!<br />
It can be simply developed applications under C++, C, Visual Basic, Delphi or<br />
LabVIEW®.<br />
6.2.1.3. Program independent of the interface<br />
Write your application independent of the interface !<br />
Program an application for an USB product of us. - Also, it will work with an<br />
ethernet or RS-232 product of us !<br />
6.2.1.4. SDK-Kit for Programmer<br />
Integrate the DELIB in your application. On demand you receive an installation<br />
script for free, which allows you, to integrate the DELIB installation in your<br />
application.<br />
Software |Seite 54
6.2.2. Supported operating systems<br />
Our products support the following operating systems:<br />
Windows 7<br />
Windows Vista<br />
Windows XP<br />
Windows 2000<br />
Linux<br />
6.2.3. Supported programming languages<br />
Our products are responsive via the following programming languages:<br />
C<br />
C++<br />
C#<br />
Delphi<br />
VisualBasic<br />
VB.NET<br />
MS-Office<br />
Software |Seite 55
6.2.4. Installation DELIB driver library<br />
Start screen of the DELIB installer<br />
Insert the DEDITEC driver CD into the drive and start „delib_install.exe“. The<br />
DELIB driver library is also available on http://www.deditec.en/delib<br />
Software |Seite 56
Click on „Install“.<br />
Software |Seite 57
The drivers will be installed.<br />
Software |Seite 58
The DELIB driver library is now installed. Press „Close“ to finish the installation.<br />
You can configure your module with the „DELIB Configuration Utility“ (see next<br />
chapter). This is only necessary, if more than one module is present.<br />
Software |Seite 59
6.2.5. DELIB Configuration Utility<br />
Start the “DELIB Configuration Utility” as follows:<br />
Start Programs DEDITEC DELIB DELIB Configuration Utility.<br />
The „DELIB Configuration Utility“ is a program to configure and subdivide<br />
identical USB-modules in the system. This is only necessary if more than one<br />
module is present.<br />
Software |Seite 60
6.3. Integration of the DELIB<br />
6.3.1. Integration of the delib.h in Visual-C/C++<br />
Description of the DELIB integration in Visual-C/C++<br />
The DELIB Installation defines environment variables to facilitate links to the<br />
DELIB-include and DELIB-lib directory.<br />
DELIB_LIB = C:\Programs\DEDITEC\DELIB\lib<br />
DELIB_INCLUDE = C:\Programs\DEDITEC\DELIB\include<br />
Start Visual-C/C++ and open via menu "Projekt -> Einstellungen"<br />
Software |Seite 61
DELIB.H entry in the Visual-C/C++ Project configurations<br />
Under the tab "C/C++" choose the "Kategorie" Präprozessor and enter on<br />
"Zusätzliche Include Verzeichnisse" "$(DELIB_INCLUDE)".<br />
Software |Seite 62
DELIB.LIB entry in the Visual-C/C++ Project configurations<br />
Under the tab "Linker" extend the existing line in "Zusätzliche Include<br />
Verzeichnisse" with the ending "$(DELIB_LIB)\delib.lib"<br />
Software |Seite 63
6.3.2. Integration of the delib.cs in Visual-C#<br />
Description of the DELIB integration in Visual-C#<br />
You can find the needed files for Visual-C# in the directory C:<br />
\Programme\DEDITEC\DELIB\Include\delib.cs. Start Visual-C# and open via<br />
menu "Projekt -> Vorhandes Element hinzufügen" in the directory C:<br />
\Programme\DEDITEC\DELIB\Include\ the file "delib.cs" to import.<br />
Add the following reference in your program:<br />
using DeLib;<br />
Software |Seite 64
6.3.3. Integration of the delib.cs in Visual-C# unter Windows 64bit<br />
Program sample for the DELIB driver library under Windows 64 Bit<br />
In the following sections there is a description how to compile the project as "x86"<br />
Show all settings<br />
Open the options via menue "Extras -> Optionen"<br />
Check “Alle Einstellungen anzeigen"<br />
Software |Seite 65
Check under "Projekte und Projektmappen" "Erweiterte Buildkonfigurationen<br />
anzeigen".<br />
Software |Seite 66
The Configuration Manager<br />
Open the configuration manager via "Any CPU -> Konfigurations-Manager...".<br />
In the configuration manager select under der column "Plattform" "Any CPU -><br />
Neu...".<br />
Under "Neue Plattform" select "x86".<br />
Software |Seite 67
Start debugging<br />
You can start the debugging as normal via the "Start-Button". Note that the toolbar<br />
combobox for Platform Configuration now lists both "x86" and "AnyCPU" and has<br />
"x86" selected<br />
Software |Seite 68
6.3.4. Integration of the delib.pas in Delphi<br />
Description of the "delib.pas" integration in Delphi<br />
You can find the needed files for Delphi in the directory C:<br />
\Programme\DEDITEC\DELIB\include\delib.pas.<br />
Start Delphi and open via menu "Projekt -> dem Projekt hinzufügen" the file "delib.<br />
pas" to import.<br />
Software |Seite 69
6.3.5. Integration of the delib.bas in Visual Basic<br />
Description of the "delib.bas" integration in Visual Basic<br />
You can find the needed files for VB in the directory C:<br />
\Programme\DEDITEC\DELIB\include\delib.bas.<br />
Start Visual Basic and open via menu "Projekt -> Datei hinzufügen..." the file<br />
"delibi.bas" to import.<br />
Software |Seite 70
6.3.6. Integration of the delib.vb in VB.NET<br />
Description of the DELIB integration in VB.NET<br />
You can find the needed files for VB.NET in the directory C:<br />
\Programme\DEDITEC\DELIB\Include\delib.vb. Start VB.NET and open via menu<br />
"Projekt -> Vorhandes Element hinzufügen" in the directory C:<br />
\Programme\DEDITEC\DELIB\Include\ the file "delib.vb" to import.<br />
Software |Seite 71
6.3.7. Integration of the delib.bas in MS-Office (VBA)<br />
Description of the "delib.bas" integration in Visual Basic for Applications<br />
You can find the needed files for VBA in the directory C:<br />
\Programme\DEDITEC\DELIB\include\delib.bas.<br />
Start Microsoft Excel and open via menu "Extras -> Makro -> Visual Basic Editor".<br />
Software |Seite 72
Creation of UserForm<br />
Create a new UserForm via menu "Einfügen -> UserForm". In the top left-hand<br />
corner of the project manager right click on "UserForm -> Datei importieren". Open<br />
in the directory C:\Programme\DEDITEC\DELIB\include the file "delib.bas" to<br />
import.<br />
Software |Seite 73
6.3.8. Integration of the delib.dll in LabVIEW<br />
6.3.8.1. Integration of the delib.dll in LabVIEW<br />
The LabVIEW-Sampleprogram "Deditec_Modul_Control.vi" is not a EXE-File and<br />
you need to execute this file the LabVIEW development environment.<br />
Description of the delib.dll integration in LabVIEW Version 11<br />
- You can find the needed files for LabVIEW in the directorys<br />
"C:\Windows\System32\delib.dll" and "C:\Programme\DEDITEC\DELIB\include\ delib.h"<br />
- Start LabVIEW and open the menu "Tools -> Import -> DLL ..."<br />
Software |Seite 74
- Choose the option "create VIs for DLL" and press continue<br />
Software |Seite 75
- In the next window, choose the path to the delib.h and delib.dll and press continue<br />
Software |Seite 76
- Press continue again<br />
- The Header-File will now be analized. Afterwards press continue.<br />
Software |Seite 77
- Follow the instructions and configurate the name and the saving location for the<br />
VIs.<br />
Software |Seite 78
- In the new window choose "Easy error correction" in the drop-down menu and<br />
press continue.<br />
Software |Seite 79
- VIs which are working with 64-bit values must be edited. The display must be<br />
changed from "unsigned long" to "unsigned quad".<br />
- The following VIs must be edited:<br />
-> DapiCNT48CounterGet48 (function return)<br />
-> DapiDIGet64 (function return)<br />
-> DapiDOSet64 (data)<br />
-> DapiDOReadBack64 (function return)<br />
Software |Seite 80
- In addition for some VIs you need to change the elementype to "numeric".<br />
- The following VIs must be edited:<br />
-> DapiWriteLongLong (value)<br />
-> DapiReadLongLong (function return)<br />
- Afterwards press continue.<br />
Software |Seite 81
- You recive a summary of the executed steps.<br />
- Press continue<br />
- The VIs will now be created and are ready to use.<br />
Software |Seite 82
6.3.8.2. Usage of the VIs in LabVIEW<br />
Some functions of the DELIB-library are expecting a string as a parameter value.<br />
This example shows how to use such functions in LabVIEW.<br />
We will use the A/D converter function which is used to set the voltage range as an<br />
example.<br />
The definition of this function is:<br />
void DapiADSetMode(ULONG handle, ULONG ch, ULONG mode);<br />
The voltage ranges for this function are already defined in the DELIB-library.<br />
Example code in C/C++:<br />
DapiADSetMode(handle, 0, ADDA_MODE_UNIPOL_5V);<br />
This code can also be written like this:<br />
DapiADSetMode(handle, 0, 1);<br />
In the delib.h file can you read the hexadecimal values to determine the modes.<br />
The hex values must be convertet to decimal.<br />
After the installation of the DELIB-library, the delib.h file is located in the following<br />
directory: C:\Programs\Deditec\DELIB\Include\delib.h<br />
Software |Seite 83
The function could look like this in LabVIEW:<br />
The channel and mode are passed as unsigned long<br />
Software |Seite 84
6.4. Test programs<br />
6.4.1. Digital Input-Output Demo<br />
Start “Digital Input-Output Demo” as follows:<br />
Start Programme DEDITEC DELIB Digital Input-Output Demo.<br />
The screenshot shows a test of the RO-USB-O64-R64. The configuration of the<br />
module (64 inputs and 64 outputs) is shown on the upper left side.<br />
Software |Seite 85
6.4.2. Analog Input-Output Demo<br />
Start “Analog Input-Output Demo” as follows:<br />
Start Programme DEDITEC DELIB Analog Input-Output Demo.<br />
The screenshot shows a test of the RO-USB-AD16-DA2_ISO. The configuration of<br />
the module (16 A/D inputs and 2 D/A outputs) is shown on the upper left side.<br />
Software |Seite 86
6.4.3. Stepper Demo<br />
Start “Stepper Demo” as follows:<br />
Start Programme DEDITEC DELIB Stepper Demo.<br />
The screenshot shows a test of the RO-USB-STEPPER2. The configuration of the<br />
module (2 Stepper) is shown on the upper left side.<br />
Software |Seite 87
6.4.4. Watchdog Demo<br />
Start "Watchdog Demo" as follows:<br />
Start Programme DEDITEC DELIB Watchdog Demo<br />
This screenshot shows a test of the watchdog stick. The configuration of the<br />
module is shown on the upper left side.<br />
Software |Seite 88
6.4.5. Temperature Read Demo<br />
Start "Temperature Read Demo" as follows:<br />
Start Programme DEDITEC DELIB Temperature Read Demo<br />
The screenshot shows a test of the RO-USB-PT100-4. The configuration of the<br />
module (4 PT100 inputs) is shown on the upper left side.<br />
Software |Seite 89
6.5. DELIB CLI (command-line interface)<br />
In some programming languages (like PHP), you can't include DLLs, therefore is<br />
an extra console command, which you can directly call out of the program (with<br />
appropriate parameters). You can find this command after installation of the DELIB<br />
driverlibrary in the directory C:\Programme\DEDITEC\DELIB\Programs\Console.<br />
You can find the DELIB CLI Command for Windows after Installation of the DELIB<br />
driverlibrary in the directory C:\Programme\DEDITEC\DELIB\programs\cli\ .<br />
The DELIB CLI Command for Linux is located in the directory "/deditec-cli/, after<br />
unzipping the ZIP-Archiv "delib-linux-cli".<br />
Definition (Windows)<br />
delib_cli command channel [value | unit ["nounit"] ]<br />
Definition for USB-Module (Linux)<br />
sudo delib-cli-usb command channel [value | unit ["nounit"] ]<br />
Definition for RO-ETH-Module (Linux)<br />
delib-cli-eth command channel [value | unit ["nounit"] ]<br />
Note: The parameters are separated by spaces.<br />
These commands and parameters are not case sensitive.<br />
Parameter<br />
command channel value unit nounit<br />
di1 0, 1, 2, ...<br />
di8<br />
di16<br />
di24<br />
0, 8, 16, ...<br />
- hex nounit<br />
do1 0, 1, 2, ... 0/1 (1-bit command)<br />
do8<br />
do16<br />
do24<br />
0, 8, 16, ...<br />
8-bit value<br />
(Bit 0 for channel 1, Bit<br />
16-bit value<br />
1 for channel 2, ...)<br />
24-bit value<br />
- -<br />
ai 0, 1, 2, ... -<br />
integer or hexadecimal number<br />
hex, volt, mA nounit<br />
ao 0, 1, 2, ...<br />
(starting with 0x).<br />
For an integer a V for Volt, mA for<br />
milli Ampere can be attached.<br />
- -<br />
Software |Seite 90
Return-value<br />
Read state of the inputs (in combination with command = di, di8, di16, di32 and<br />
ai).<br />
Read state of the inputs as hexadecimal (in combination with command = di, di8,<br />
di16, di32 and ai and unit "hex")<br />
Voltage of the input (in combination with unit "volt" and command "ai")<br />
Current of the input (in combination with unit "mA" and command "ai")<br />
Software |Seite 91
6.5.1. Customisation for USB-Modules (only Linux)<br />
In order to access the right module under Linux via DELIB CLI, you have to set the<br />
module id at the command "DapiOpenModule". Therefore you can find in the<br />
directory "/deditec-cli/source" the file "delib_cli_open_module_usb.c" after<br />
unzipping the ZIP archive.<br />
By default, the program "delib-cli-usb" (see source code) tries to open a RO-USB<br />
module. If the module is not found, it will try to open an USB-Mini-Stick, and so on...<br />
Since this causes unnecessary error-messages, you can simply remark not<br />
needed entries.<br />
#include "../../delib-sources/delib/delib.h"<br />
ULONG handle;<br />
ULONG delib_cli_open_module()<br />
{<br />
handle = DapiOpenModule(RO_USB, 0);<br />
if(handle==0)<br />
{<br />
handle = DapiOpenModule(USB_MINI_STICK, 0);<br />
}<br />
if(handle==0)<br />
{<br />
handle = DapiOpenModule(USB_RELAIS_8, 0);<br />
}<br />
if(handle==0)<br />
{<br />
handle = DapiOpenModule(USB_OPTOIN_8_RELAIS_8, 0);<br />
}<br />
if(handle==0)<br />
{<br />
handle = DapiOpenModule(USB_OPTOIN_16_RELAIS_16, 0);<br />
}<br />
if(handle==0)<br />
{<br />
handle = DapiOpenModule(USB_OPTOIN_32_RELAIS_32, 0);<br />
}<br />
}<br />
return handle;<br />
Note:<br />
The project "delib-cli-usb" has to recompiled after each modification. Therefore,<br />
you can find in the directory "/deditec-cli/", the shell script "compile_delib_cli_usb.<br />
sh", with which you can compile the project under Linux.<br />
Software |Seite 92
6.5.2. Customisation for RO-ETH-Modules (only Linux)<br />
In order to access a RO-ETH module under Linux, you have to set IP address of the<br />
module. Therefore you can find in the directory "/deditec-cli/source" the file<br />
"delib_cli_open_module_eth.c" after unzipping the ZIP archive.<br />
You have to modify following entry:<br />
#include "../../delib-sources/delib/delib.h"<br />
extern char global_ip_addr[];<br />
ULONG handle;<br />
ULONG delib_cli_open_module()<br />
{<br />
sprintf(global_ip_addr, "192.168.1.11"); // Set the IP address of the RO-ETH<br />
module here<br />
}<br />
handle = DapiOpenModule(RO_ETH,0);<br />
return handle;<br />
Note:<br />
The project "delib-cli-eth" has to recompiled after each modification. Therefore,<br />
you can find in the directory "/deditec-cli/", the shell script "compile_delib_cli_eth.<br />
sh", with which you can compile the project under Linux.<br />
Software |Seite 93
6.5.3. DELIB CLI samples<br />
Digital Outputs<br />
Windows<br />
delib_cli DO1 17 1<br />
-> digital output 18 will be switched on<br />
delib_cli DO1 3 0<br />
-> digital output 4 will be switched on<br />
delib_cli DO8 0 255<br />
-> digital outputs 1-8 will be switched on<br />
delib_cli DO16 0 0<br />
-> digital outputs 1-16 will be switched off<br />
delib_cli DO16 16 65535<br />
-> digital outputs 17-32 will be switched on<br />
delib_cli DO32 0 4294967295<br />
-> digital outputs 1-32 will be switched on<br />
Linux<br />
sudo delib_cli _usb DO1 17 1<br />
-> digital output 18 of an USB-Module will be switched on<br />
delib_cli _eth DO1 3 0<br />
-> digital output 18 of a RO-ETH-Module will be switched off<br />
Software |Seite 94
Digitale Inputs<br />
Windows<br />
delib_cli DI1 3<br />
Example of a return value: 1<br />
-> reads the state of digital input 4<br />
delib_cli DI8 0 hex<br />
Example of a return value: 0xFF<br />
-> reads the state of digital input 4 as hexadecimal<br />
delib_cli DI16 0 hex<br />
Example of a return value: 0xFFFF<br />
-> reads the state of digital inputs 1-16 as hexadecimal<br />
delib_cli DI32 0 hex<br />
Example of a return value: 0xFFFFFFFF<br />
-> reads the state of digital inputs 1-32 as hexadecimal<br />
Alternatively you can append the argument "nounit"<br />
delib_cli DI8 0 hex nounit<br />
Example of a return value: FF<br />
-> reads the state of digital inputs 1-8 as hexadecimal<br />
Linux<br />
sudo delib_cli _usb DI1 3<br />
Example of a return value: 1<br />
-> reads the state of digital input 4 of an USB-Module<br />
delib_cli_eth DI8 0 hex<br />
Example of a return value: 0xFF<br />
-> reads the state of digital input 1-8 of a RO-ETH-Module as hexadecimal<br />
Software |Seite 95
Analog Outputs<br />
Windows<br />
delib_cli AO 7 4711<br />
->analog output 8 will be set to the decimal value 4711<br />
delib_cli AO 6 0x4711<br />
->analog output 7 will be set to the hexadecimal value 0x4711<br />
delib_cli AO 7 3.7V<br />
-> the voltage of analog output 8 will be set to 3,7 Volt<br />
(the comma "," and the dot "." can be used for decimal separation)<br />
delib_cli AO 7 13.3mA<br />
-> the current of analog output 8 will be set to 13,3 mA<br />
(the comma "," and the dot "." can be used for decimal separation)<br />
Linux<br />
sudo delib_cli_usb AO 7 4711<br />
-> analog output 8 of an USB-Module will be set to the decimal value 4711<br />
delib_cli_eth AO 6 0x4711<br />
-> analog output 7 of a RO-ETH-Module will be set to the hexadecimal value 0x4711<br />
Software |Seite 96
Analog Inputs<br />
Windows<br />
delib_cli AI 2<br />
Example of a return value: 1234<br />
-> reads the value of analog input 3 as decimal<br />
delib_cli AI 2 hex<br />
Example of a return value: 0x1FA<br />
-> reads the value of analog input 3 as hexadecimal<br />
delib_cli AI 2 V<br />
Example of a return value: 12.500000V<br />
-> reads the voltage of analog input 3 as point number<br />
delib_cli AI 2 mA<br />
Example of a return value: 20.551600mA<br />
-> reads the current of analog input 3 as point number<br />
Alternatively you can append the argument "nounit"<br />
delib_cli AI 3 hex nounit<br />
Example of a return value: 1FA<br />
-> reads the value of analog input 4 as hexadecimal<br />
delib_cli AI 3 V nounit<br />
Example of a return value: 12.500000<br />
-> reads the voltage of analog input 4 as point number<br />
delib_cli AI 3 mA nounit<br />
Example of a return value: 20.551600<br />
-> reads the current of analog input 4 as point number<br />
Linux<br />
sudo delib_cli_usb AI 2<br />
Example of a return value: 1234<br />
-> reads the value of analog input 3 of an USB-Module as decimal<br />
delib_cli_eth AI 2 hex<br />
Example of a return value: 0x1FA<br />
-> reads the value of analog input 3 of an RO-ETH-Module as hexadecimal<br />
Software |Seite 97
Appendix<br />
VII<br />
Appendix |Seite 98
7. Appendix<br />
7.1. Revisions<br />
Rev 1.00 First issue<br />
Rev 2.00 Design change<br />
Rev 2.01 Added Chapter CAN Configuration Utility<br />
Rev 2.02 Various supplements CAN Configuration Utility<br />
Rev 2.03 Added chapters "Firmware update" and "Integration of the<br />
DELIB"<br />
Appendix |Seite 99
7.2. Copyrights and trademarks<br />
Linux is registered trade-mark of Linus Torvalds.<br />
Windows CE is registered trade-mark of Microsoft Corporation.<br />
USB is registered trade-mark of USB Implementers Forum Inc.<br />
LabVIEW is registered trade-mark of National Instruments.<br />
Intel is registered trade-mark of Intel Corporation<br />
AMD is registered trade-mark of Advanced Micro Devices, Inc.<br />
Appendix |Seite 100