Heilig & Schwab USB Counter 026 User manual

User Manual
USB Counter
Heilig & Schwab GmbH & Co. KG
Haystraße 24
55566 Bad Sobernheim
GERMANY
T: +49 (0) 67 51 / 93 12-0
F: +49 (0) 67 51 / 93 12-15
www.heilig-schwab.de

USB-Counter 026 / USB-Counter 048
Neither the whole nor any part of this documentation may be reproduced, passed on
to third parties, stored in a database system or translated into another language
without the written permission of Heilig & Schwab GmbH & Co. KG.
© Copyright 2007 - 2013 Heilig & Schwab GmbH & Co. KG. All rights reserved.
7th Edition: Bad Sobernheim, 2013-04-19
The information contained in this document is subject to change without prior notice.
In doing so, Heilig & Schwab GmbH & Co. KG do not enter into any obligation.
Heilig & Schwab GmbH & Co. KG disclaim all warranties, any legal responsibility or
any liability for consequential damages arising from or in connection with the content
or use of this manual.
Furthermore, Heilig & Schwab GmbH & Co. KG hereby disclaim all warranties, any
legal responsibility or any liability for consequential damages arising from the incor-
rect use of the hardware and/or software.
The layout or design of the hardware can be changed without prior notice. In doing
so, Heilig & Schwab GmbH & Co. KG do not enter into any obligation.
All other trademarks and product designations used in this manual are the property of
the respective companies and manufacturers.
Heilig & Schwab GmbH & Co. KG waive all property rights with regard to the named
trademarks and product designations that do not belong to them.
©Heilig & Schwab GmbH & Co. KG Page 2

USB-Counter 026 / USB-Counter 048
Table of contents
1 IMPORTANT NOTICE ____________________________________________________ 4
1.1 COMPATIBILITY STATEMENT _____________________________________________________ 4
Manufacturer and product name _________________________________________________ 4
EMC Specifications ___________________________________________________________ 4
1.2 PURPOSE___________________________________________________________________ 5
TTL or voltage signal (~ 1 VSS) __________________________________________________ 5
ACU-RITE TTL signal _________________________________________________________ 5
Unipolar TTL signal ___________________________________________________________ 5
Current Signal (~ 11 µASS) _____________________________________________________ 5
1.3 DELIVERY SCHEDULE AND SYSTEM REQUIREMENTS ____________________________________ 6
Delivery schedule ____________________________________________________________ 6
System requirements__________________________________________________________ 6
2 INSTALLATION _________________________________________________________ 7
2.1 INSTALLING THE DRIVER ________________________________________________________ 7
2.2 CONNECTING THE USB COUNTER_________________________________________________ 8
2.3 LINKING THE DLL ____________________________________________________________ 8
3 CONFIGURATION _______________________________________________________ 9
3.1 THE DLL “HS_UC.DLL” LIBRARY FUNCTIONS _______________________________________ 9
Initialising the USB Counter____________________________________________________ 10
Reading out versions_________________________________________________________ 11
Reading out the counter value__________________________________________________ 12
Reading out the offset counter value _____________________________________________ 13
Resetting reference __________________________________________________________ 14
Setting the counter value multiplier ______________________________________________ 15
Configuring distance coding ___________________________________________________ 16
Setting reference mode _______________________________________________________ 17
Closing the USB Counter program ______________________________________________ 18
Resetting the USB port _______________________________________________________ 19
Reading out the serial number _________________________________________________ 20
Setting the reference direction__________________________________________________ 21
4 COUNTER STATUS_____________________________________________________ 22
4.1 LED DISPLAY_______________________________________________________________ 22
USB Counter 026 ___________________________________________________________ 22
USB Counter 026-2 __________________________________________________________ 22
USB Counter 026-3 __________________________________________________________ 22
USB Counter 048 ___________________________________________________________ 22
5 TECHNICAL DATA______________________________________________________ 23
5.1 USB 2.0 __________________________________________________________________ 23
USB-B socket ______________________________________________________________ 23
5.2 SIGNAL INPUT ______________________________________________________________ 24
TTL input __________________________________________________________________ 24
Voltage input (~ 1 VPP)________________________________________________________ 25
ACU-RITE TTL input _________________________________________________________ 26
Unipolar TTL input___________________________________________________________ 27
Current input (~ 11 µAPP)______________________________________________________ 28
5.3 MECHANICAL AND PHYSICAL SPECIFICATIONS _______________________________________ 29
6 GUARANTEE TERMS ___________________________________________________ 30
©Heilig & Schwab GmbH & Co. KG Page 3

USB-Counter 026 / USB-Counter 048
1 Important Notice
1.1 Compatibility Statement
Manufacturer and product name
Manufacturer: Heilig & Schwab GmbH & Co. KG
Haystraße24
55566 Bad Sobernheim
Germany
Product: 1-axis USB Counter
Model: USB-Counter 026 / 026-2 / 026-3 / 048
EMC Specifications
The USB counter meets the standards below:
Interference emission Interference immunity
EN 55011:2003 Group 1, Class A EN 61000-4-2:2001
EN 55022:2003 Class A EN 61000-4-3:2003
EN 61000-4-4:2005
EN 61000-4-6:2001
EN 61000-4-8:2001
These threshold values give sufficient protection against dangerous electromagnetic
radiation for the environment. This applies as long as the product has been fitted and
used in accordance with the instructions. It is also necessary for all cables to be
shielded and connected properly. The peripheral equipment must also be shielded
and earthed.
Using this equipment with uncertified personal computers or in-
correctly shielded cables can lead to electromagnetic faults.
All changes or modifications that are not expressly approved by
the manufacturer will lead to the operating licence being null
and void.
©Heilig & Schwab GmbH & Co. KG Page 4

USB-Counter 026 / USB-Counter 048
1.2 Purpose
The USB Counter is used to connect incremental rotary encoders, linear encoders
and scanning probes directly to a computer's USB port.
TTL or voltage signal (~ 1 VSS)
The USB-counter 026 analyzes a TTL signal or a
voltage signal.
ACU-RITE TTL signal
The USB-counter 026-2 analyzes an ACU-RITE
TTL signal.
Unipolar TTL signal
The USB-counter 026-3 analyzes a unipolar TTL
signal.
Current Signal (~ 11 µASS)
The USB-counter 048 analyzes a current signal.
©Heilig & Schwab GmbH & Co. KG Page 5

USB-Counter 026 / USB-Counter 048
1.3 Delivery schedule and system requirements
Delivery schedule
The following is included in the package:
Item Amount Name Notes
1 1 USB-Counter 026 USB Counter
1.1 1 USB-Counter 026-2 optional for item 1
1.2 1 USB-Counter 026-3 optional for item 1
2 1 USB-Counter 048 optional for item 1
3 1 USB cable, A/B, 1.0 m optional
3.1 1 USB cable, A/B, 3.0 m Optional for item 3
4 1 Data carrier with
•User Manual
•Driver und DLL for Windows operating
systems
One will be supplied with the
basic orders but can be re-
ordered at any time if neces-
sary.
Please check the contents of the package directly after delivery.
Please contact us immediately if the contents as described above are not correct.
Tel.: +49 (0) 67 51 / 93 12-30
System requirements
You will need the following system requirements on your computer and your software
to run the USB Counter:
•Windows XP/Vista or Windows 7 operating system
•USB port 2.0
©Heilig & Schwab GmbH & Co. KG Page 6

USB-Counter 026 / USB-Counter 048
2 Installation
It is also assumed that before installing the USB Counter you will have read this user
manual and observed the relevant safety and operating instructions.
The USB Counter can quickly be integrated into your application using the driver
software for the various Windows operating systems that is included in the package.
These drivers will allow you to read out the counter values easily and access the
card’s various parameters and operating modes.
2.1 Installing the driver
Insert CD. After inserting the data carrier the driver will be installed automatically. Fol-
low the instructions to complete setup.
Do not connect the USB Counter until software prompt.
If the installation program does not start automatically, execute the file "Setup.exe".
In order to access the USB Counter driver the DLL “HS_UC.DLL“ with library func-
tions is made available.
©Heilig & Schwab GmbH & Co. KG Page 7

USB-Counter 026 / USB-Counter 048
2.2 Connecting the USB Counter
The USB Counter is connected to a free USB port on a PC or notebook using the
USB A-B cable. The cable can be connected while the PC or notebook is running
(hot plugging).
USB A-B cable
2.3 Linking the DLL
The DLL is linked by means of an interface module which contains the necessary
declarations to access the library functions.
This interface module is available on the data carrier in the package in Visual C++
and Borland Delphi.
©Heilig & Schwab GmbH & Co. KG Page 8

USB-Counter 026 / USB-Counter 048
3 Configuration
3.1 The DLL “HS_UC.DLL” library functions
DLL function call Meaning
HS_UC_Init Loads the driver and checks whether the USB Counter
is available. Initialises the USB Counter.
Defines den counter type (TTL / ~1 VPP / ~11 µAPP).
HS_UC_GetVersion Reads out DLL versions and firmware.
HS_UC_GetCounterVal Reads out the counter value and status of the USB
Counter.
HS_UC_GetCounter Reads out the counter value and status of the USB
Counter. The counter value is included with the refer-
ence value and the multiplier.
HS_UC_ResetRef Resets the USB Counter reference.
HS_UC_SetMultiplier Sets the multiplier.
HS_UC_SetDistCode Configures the parameters for distance-coded rulers.
HS_UC_SetRefMode Sets the reference mode of the USB Counter.
HS_UC_Close Closes the USB Counter program.
HS_UC_ResetUSBPort Resets the USB port.
HS_UC_GetSerialnumber Reads out the serial number of the USB Counter.
HS_UC_SetRefDir Sets the reference direction of the USB Counter.
©Heilig & Schwab GmbH & Co. KG Page 9

USB-Counter 026 / USB-Counter 048
Initialising the USB Counter
Function name: HS_UC_Init
Syntax: long HS_UC_Init (long CounterNo,
long Type);
Description: Loads the driver and checks whether the USB Counter is available.
Initialises the USB Counter and sets the reference parameters to the
default setting.
Defines the counter type (TTL / ~1 VPP / ~ 11 µAPP).
Parameter value: CounterNo Device number (1…15)
Type Defines the signal input.
01h: 11 µAPP
02h: 1 VPP
03h: TTL
Return value: 0OK
-1 Error
©Heilig & Schwab GmbH & Co. KG Page 10

USB-Counter 026 / USB-Counter 048
Reading out versions
Function name: HS_UC_GetVersion
Syntax: long HS_UC_GetVersion (long CounterNo,
char* DllVersion,
char* FirmwareVersion);
Description: Reads out DLL versions and firmware.
Parameter value: CounterNo Device number (1…15)
DllVersion Pointer to the string where the DLL version is
entered.
The strings should have at least 80 charac-
ters.
FirmwareVersion Pointer to the string where the firmware ver-
sion is entered.
Return value: 0OK
-1 Error
©Heilig & Schwab GmbH & Co. KG Page 11

USB-Counter 026 / USB-Counter 048
Reading out the counter value
Function name: HS_UC_GetCounterVal
Syntax: long HS_UC_GetCounterVal (long CounterNo,
long *CountVal,
long *CountStat);
Description: Reads out the counter value and status of the USB Counter.
Parameter value: CounterNo Device number (1…15)
CountVal Pointer to the counter value variable.
CountStat Pointer to the counter status variable.
01h: Error
02h: Reference point detected
Return value: 0OK
-1 Error
©Heilig & Schwab GmbH & Co. KG Page 12

USB-Counter 026 / USB-Counter 048
Reading out the offset counter value
Function name: HS_UC_GetCounter
Syntax: long HS_UC_GetCounter (long CounterNo,
long *Count,
long *Status);
Description: Reads out the counter value and status of the USB Counter.
The counter value is included with the reference value and the multi-
plier.
Parameter value: CounterNo Device number (1…15)
Count Pointer to the counter value variable.
Status Pointer to the counter status variable.
01h: Error
02h: Reference point already detected
Return value: 0OK
-1 Error
©Heilig & Schwab GmbH & Co. KG Page 13

USB-Counter 026 / USB-Counter 048
Resetting reference
Function name: HS_UC_ResetRef
Syntax: long HS_UC_ResetRef (long CounterNo);
Description: Resets the USB Counter reference.
The reference point must be passed once again.
Parameter value: CounterNo Device number (1…15)
Return value: 0OK
-1 Error
©Heilig & Schwab GmbH & Co. KG Page 14

USB-Counter 026 / USB-Counter 048
Setting the counter value multiplier
Function name: HS_UC_SetMultiplier
Syntax: long HS_UC_SetMultiplier (long CounterNo,
long Multiplier);
Description: Sets the multiplier.
Note: The counter direction can be reversed easily using the multiplier.
The multiplier must then be set to -1.
Parameter value: CounterNo Device number (1…15)
Multiplier Multiplier
Return value: 0OK
-1 Error
©Heilig & Schwab GmbH & Co. KG Page 15

USB-Counter 026 / USB-Counter 048
Configuring distance coding
Function name: HS_UC_SetDistCode
Syntax: long HS_UC_SetCistCode (long CounterNo,
long Distance,
long Pitch,
long Interpolation
long Offset,
long Direction);
Description: Configures the parameters for distance-coded rulers.
Parameter value: CounterNo Device number (1…15)
Distance Basic reference mark spacing in mm
(Default = 20 mm)
Pitch Signal period in µm (Default = 20 µm)
Interpolation Signal period division (Default = 256)
Offset Ruler origin in mm (Default = 0 mm)
Direction Basic ruler counting direction
00h: positive (Default), e.g. Acu-Rite
01h: negative, e.g. Heidenhain
Return value: 0OK
-1 Error
Note: Function call order that must be observed:
HS_UC_Init(...)
HS_UC_SetDistCode(...)
HS_UC_SetRefMode(...)
When using default values "HS_UC_SetDistCode(...)" need not be
carried out.
©Heilig & Schwab GmbH & Co. KG Page 16

USB-Counter 026 / USB-Counter 048
Setting reference mode
Function name: HS_UC_SetRefMode
Syntax: long HS_UC_SetMode (long CounterNo,
long RefMode);
Description: Sets the reference and latch mode of the USB Counter.
Parameter value: CounterNo Device number (1…15)
RefMode Reference mode
00h: No reference detection (Default)
01h: Single reference detection
02h: Cyclical reference detection
03h: Distance-coded reference
Return value: 0OK
-1 Error
Function explana-
tions
To use the application it is necessary to explain the functionality of the
reference analysis.
Reference analysis
•With cyclical (repeated) reference analysis the counter value is
set to 0 again when the reference point is passed. This is often
used with rotary encoders where the angle is automatically stan-
dardised to 0 - 360°.
•The single reference analysis only sets the counter to 0 the first
time the reference mark is passed. Any further reference signals
will be ignored. As long as no reference signal is set in this mode
the counter has no defined value.
•With distance-coded reference analysis the reference will be
detected and analysed after a short distance travelled. In this
case, further reference signals will be ignored. As long as no ref-
erence signal is set in this mode the counter has no defined value.
©Heilig & Schwab GmbH & Co. KG Page 17

USB-Counter 026 / USB-Counter 048
Closing the USB Counter program
Function name: HS_UC_Close
Syntax: long HS_UC_Close (long CounterNo);
Description: Closes the USB Counter program.
Parameter value: CounterNo Device number (1…15)
Return value: 0OK
-1 Error
©Heilig & Schwab GmbH & Co. KG Page 18

USB-Counter 026 / USB-Counter 048
Resetting the USB port
Function name:HS_UC_ResetUSBPort
Syntax: long HS_UC_ResetUSBPort (long CounterNo)
Description: Resets the USB port.
The effect is the same as disconnecting then reconnecting the device
from USB.
After this, the USB Counter has to be initialised.
Parameter value: CounterNo Device number (1…15)
Return value: 0 OK
-1 Error
©Heilig & Schwab GmbH & Co. KG Page 19

USB-Counter 026 / USB-Counter 048
Reading out the serial number
Function name: HS_UC_GetSerialnumber
Syntax: long HS_UC_GetSerialnumber (long CounterNo,
char* Serialnumber);
Description: Reads out the serial number.
Parameter value: CounterNo Device number (1…15)
Serialnumber Pointer to the string where the serial number
is entered.
Return value: 0OK
-1 Error
©Heilig & Schwab GmbH & Co. KG Page 20
This manual suits for next models
3
Table of contents