Phytec pciGrabber4x4, VD-012, VD-012-X1, VD-012-X2 Hardware Manual

A product of a PHYTEC Technology Holding company
Grabber-4x4
Hardware-Manual
Edition January 2009
pciGrabber-4x4
PHYTEC Messtechnik GmbH 2008 L-720e_0
In this manual are descriptions for copyrighted products that are not explicitly indicated as such. The absence of the trademark () and copyright () symbols
does not imply that a product is not protected. Additionally, registered patents and trademarks are similarly not expressly indicated in this manual.
The information in this document has been carefully checked and is believed to be entirely reliable. However, PHYTEC Messtechnik GmbH assumes no responsibility for any inaccuracies. PHYTEC Messtechnik GmbH neither gives any guarantee nor accepts any liability whatsoever for consequential damages resulting from the use of this manual or its associated product. PHYTEC Messtechnik GmbH reserves the right to alter the information contained herein without prior notification and accepts no responsibility for any damages which might result.
Additionally, PHYTEC Messtechnik GmbH offers no guarantee nor accepts any liability for damages arising from the improper usage or improper installation of the hardware or software. PHYTEC Messtechnik GmbH further reserves the right to alter the layout and/or design of the hardware without prior notification and accepts no liability for doing so.
Copyright 2009 PHYTEC Messtechnik GmbH, D-55129 Mainz. Rights - including those of translation, reprint, broadcast, photomechanical or similar reproduction and storage or processing in computer systems, in whole or in part - are reserved. No reproduction may occur without the express written consent from PHYTEC Messtechnik GmbH.
EUROPE NORTH AMERICA
Address: PHYTEC Technologie Holding AG
Robert-Koch-Str. 39 D-55129 Mainz GERMANY
PHYTEC America LLC 203 Parfitt Way SW, Suite G100 Bainbridge Island, WA 98110 USA
Ordering Information:
+49 (800) 0749832
order@phytec.de
1 (800) 278-9913
sales@phytec.com
Technical Support:
+49 (6131) 9221-31
support@phytec.de
1 (800) 278-9913
support@phytec.com
Fax: +49 (6131) 9221-33 1 (206) 780-9135
Web Site: http://www.phytec.de http://www.phytec.com
1rd Edition January 2009
Contents
PHYTEC Messtechnik GmbH 2008 L-720e_0
1
Introduction.........................................................................................1
2
Delivery Contents/ Technical Data....................................................4
2.1 Accessories...................................................................................5
2.2 Technical Data VD-012(-X1)(-X2)..............................................6
2.3 Field of Applications and Safety Regulations............................10
2.4 Addresses and Resources ...........................................................11
2.5 Socket Pinout..............................................................................13
2.5.1 Composite Inputs ..........................................................15
2.5.2 S-Video Connection ......................................................16
2.6 I2C Interface ...............................................................................17
2.7 Jumper on pin header row X900 ................................................17
2.8 Notes on CE-Conformance and Immunity against Interference 18
2.9 Option Port .................................................................................19
3
Installation of the Grabber Card.....................................................20
3.1 Installing the Grabber Card ........................................................20
3.2 Installing the Driver ...................................................................22
3.2.1 Additional Drivers (optional)........................................24
3.3 Installing the Demo Program .....................................................25
4
Connecting Video Sources................................................................ 26
4.1 Possible Video Connections.......................................................28
4.1.1 The S-Video Cable........................................................30
4.1.2 The Composite Cable....................................................30
4.2 Extension Card VZ-012 .............................................................31
4.3 Overview about all video inputs.................................................34
5
Start-Up of the Grabber with Demo Programs .............................37
5.1 The parallel image processing....................................................45
5.2 Demo Program Description........................................................48
5.3 Image Control.............................................................................54
5.4 Additional Functions Under Image ............................................55
5.5 Crosshair function (Overlay)......................................................56
5.6 Special Functions .......................................................................56
5.7 Storing Images, Ending the Program .........................................64
5.8 Getting Started with Linux.........................................................64
6
Driver Software.................................................................................66
6.1 Technical Basics.........................................................................67
6.1.1 Block Diagram of the pciGrabber-4x4..........................67
6.1.2 The Videosignal and Digitization .................................70
6.1.3 Transfer and storage of color ........................................72
6.1.4 Data storage by DMA and RISC-Program ...................74
6.2 Driver for Microsoft Windows...................................................78
6.2.1 Requirements.................................................................79
pciGrabber-4x4
PHYTEC Messtechnik GmbH 2008 L-720e_0
6.2.2 Application of the Device Driver for Windows NT4.0 80
6.2.3 Application of the Device Driver for Windows 2000 /
XP / VISTA................................................................... 84
6.2.4 Application of the DLL................................................. 85
6.2.5 Application of the Windows XP/VISTATM Windows
NT4.0TM / Windows 2000TM DLLs............................... 86
6.2.6 Programming under Delphi .......................................... 87
6.2.7 Description of the DLL in Existing Functions..............89
7
Trouble-Shooting ............................................................................143
Index ......................................................................................................... 148
Contents
PHYTEC Messtechnik GmbH 2008 L-720e_0
Index of Figures
Figure 1: Accessory Cables .......................................................................5
Figure 2: Connectors of the pciGrabber-4x4 (VD-012)..........................13
Figure 3: Connectors of the pciGrabber-4x4 (VD-012-X1).................... 14
Figure 4: Connectors of the pciGrabber-4x4 (VD-012-X2).................... 14
Figure 5: Pin Formation of the Option Port............................................. 19
Figure 6: Inserting the Card into the PCI Express Slot ........................... 21
Figure 7: PHYTEC Install Menu............................................................. 25
Figure 8: Overview of the pciGrabber-4x4 Connectors (VD-012) ......... 26
Figure 9: Overview of the pciGrabber-4x4 Connectors (VD-012-X1)...27 Figure 10: Overview of the pciGrabber-4x4 Connectors (VD-012-X2)...27 Figure 11: Video Connector Cables - (Description and PHYTEC Order
Number) ...................................................................................28
Figure 12: Connectors for the pciGrabber-4x4..........................................29
Figure 13: Extension Card VZ-012 with ribbon cable ..............................31
Figure 14: How to connect the extension cards......................................... 32
Figure 15: Jumper settings for three VZ-012 for VD-012 und VD-012-X133
Figure 16: Jumper settings for VZ-012 for VD-012-X2 ........................... 33
Figure 17: Video inputs VD-012 ............................................................... 34
Figure 18: Video inputs VD-012-X1......................................................... 35
Figure 19: Video inputs VD-012-X2......................................................... 35
Figure 20: Overview of the Demo Program ..............................................37
Figure 21: Basic Settings Menu.................................................................38
Figure 22: Menu Option: Image ................................................................ 40
Figure 23: Configuring the Image Parameters .......................................... 41
Figure 24: Live Image from the Video Source.......................................... 43
Figure 25: Overloaded PCI bus .................................................................47
Figure 26: „Image Setting“ Menu ............................................................. 48
Figure 27: Creating a Full Image: Two Fields, Each with 7 rows ............51
pciGrabber-4x4
PHYTEC Messtechnik GmbH 2008 L-720e_0
Figure 28: Comb Effect That Occurs with Quick Moving Objects .......... 52
Figure 29: The Image Control Window .................................................... 54
Figure 30: Histogram................................................................................. 56
Figure 31: Color Meter.............................................................................. 58
Figure 32: Arithmetics Menu .................................................................... 60
Figure 33: Selecting the Normalization Factor ......................................... 61
Figure 34: Number of Images ................................................................... 61
Figure 35: Option Port Menü .................................................................... 62
Figure 36: Option Port Menü (Jumper)..................................................... 63
Figure 37: Block diagram VD-012............................................................ 67
Figure 38: Block diagram VD-012( part 2)............................................... 68
Figure 39: InterlacedIimage (Example with 9 Lines) ............................... 70
Figure 40: Fields and Frames .................................................................... 71
Figure 41: Moving Objects Cause Comb Effects...................................... 71
Figure 42: Pixel- and Control Data Flow (Overview)............................... 76
Figure 43: Directory for Window’s Driver ............................................... 78
Figure 44: Windows NT Registration Editor ............................................ 81
Figure 45: Entering a Device Driver ......................................................... 81
Figure 46: Configuring the Driver............................................................. 82
Figure 47: Scaling and Cropping............................................................. 112
Figure 48: Example of Scaling: Only the ppl Value is Different............ 113
Figure 49: Color Format of the pciGrabber-4x4 ..................................... 120
Figure 50: Return Values of ‚Data_Present‘ ........................................... 126
Figure 51: Timing Diagram of the Return Parameter of ‚Data_Present()126
Contents
PHYTEC Messtechnik GmbH 2008 L-720e_0
Index of Tables
Table 1: Pin Assignments of the Model VD-012...................................15
Table 2: Pin Assignments of the Model VD-012-X1............................. 16
Table 3: Pin Assignments of the Model VD-012-X2............................. 16
Table 4
Connecting the I²C Interface to the Combi Socket..................17
Table 5: Pin Assignment for the Option Port X300............................... 19
Table 6: Numbers of possible extension cards....................................... 32
Table 7
Example data volumes PAL 25fps........................................... 46
Table 8
Example data volumes NTSC 30fps ........................................ 46
Table 9: Required Memory Space of One Pixel for the Different Modi121
pciGrabber-4x4
PHYTEC Messtechnik GmbH 2008 L-720e_0
Part 1 Installation and Start-Up
PHYTEC Messtechnik GmbH 2008 L-720e_0
1
1 Introduction
Thanks for buying a pciGrabber-4x4 of the PHYTEC Messtechnik GmbH. This manual explains on the one hand how to install the PC­Card and on the other hand some information to the driver-software.
At the moment exists some kinds of pciGrabber4x4 models. To these belong three kinds, that are described in this manual. The first one is the model VD-012, the second VD-012-X1 and the third one is VD­012-X2. In the following overview is a summery of the two types and their models that are described in this manual.
TYPE Article-No.: No. of Decoders Bus-System
pciGrabber-4x4 VD-012 4 x1 PCI Express pciGrabber-4x4 VD-012-X1 4 x1 PCI Express pciGrabber-4x4 VD-012-X2 2 x1 PCI Express
pciGrabber-4x4
2
PHYTEC Messtechnik GmbH 2008 L-720e_0
Delivery Contents / Technical Data
PHYTEC Messtechnik GmbH 2008 L-720e_0
3
Start-Up
Part 1
Installation and Start-Up
pciGrabber-4x4
4
PHYTEC Messtechnik GmbH 2008 L-720e_0
2 Delivery Contents/ Technical Data
The pciGrabber-4x4 includes the following upon delivery:
A PCI Express-card
Installation CD with
o Demo software (Windows XP, NT4.0, 2000 and Windows
VISTA)
o Driver software for Windows XP, NT4.0, 2000 and Windows
VISTA
o Labview driver for photo processing applications using
Labview (National Instruments, IMAQ – packet is required)
the pciGrabber-4x4 manual
Delivery Contents / Technical Data
PHYTEC Messtechnik GmbH 2008 L-720e_0
5
Start-Up
2.1 Accessories
The following pciGrabber-4x4 accessories may be ordered from PHYTEC:
S-Video connector cable for connection of a color camera with a
4-pin Mini-DIN plug (S-Video output). Length, aprox. 2 m – Order number: WK051
BNC connector cable for connection of a camera with a BNC-plug.
Order number: WK058 (2m) or WK039 (10m)
Replacement fuse 1.6 AT TR5 for camera power supply
(receptacle F2) – Order number KF012
Replacement fuse 500 mAT TR5 for camera power supply
(receptacle F1) – Order number KF014
Figure 1: Accessory Cables
pciGrabber-4x4
6
PHYTEC Messtechnik GmbH 2008 L-720e_0
2.2 Technical Data VD-012(-X1)(-X2)
Physical Dimensions: 125 x 90 x 20 mm plus face plate and slot 120 x 90 x 20 mm without panel edge
Data Bus: x1 PCI Express bus (PCI Express Base Spec. Rev. 1.0a compliant)
Power Supply: +3.3V V (250 mA idle, 300 mA digitizing)
(taken from the PCI Express bus)
Numbers of Decoders: Model VD-012: four Decoder
Model VD-012-X1 four Decoder
Model VD-012-X2 two Decoder
Inputs: Model VD-012: 4 composite video inputs, 75 , 1 V
ss
1
optional 12 composite video inputs 75 Ω, 1 V
ss
Model VD-012-X1:
4 S-Video input 75 (0.7 V
ss
/ 0.3 Vss)
optional 12 composite video inputs 75 Ω, 1 V
ss
Model VD-012-X2:
2 composite video inputs, 75 , 1 V
ss
1
)
2 S-Video input 75 (0.7 V
ss
/ 0.3 Vss)
optional 4 composite video inputs 75 Ω, 1 V
ss
Video Format: PAL (B,G,H,I), HTSC (M) or corresponding CCIR monochrome format
1
: If an S-Video input is not being used, then an extra composite input is available foer the user
Delivery Contents / Technical Data
PHYTEC Messtechnik GmbH 2008 L-720e_0
7
Start-Up
Synchronization: Composite sync. or sync to Y-signal external synchronization is not possible
Data Format: 16 Mio. colors RGB32, RGB24, YcrCb 4:2:2,
YcrCb 4:1:1 64,000 colors RGB16 32,000 colors RGB15 256 gray shades Y8 gray scale
Image Resolution: maximum 720 x 576 pixels (PAL)
or 640 x 480 pixels (NTSC) Resolution is freely scalable in X and Y directions up to 14:1
Image Transfer Rate: Half frame 20 ms (Odd or even field)
Full frame 40 ms (Odd or even field) Image transfer to the main memory in real time (Bus master transfer)
Used Resources: 4 kByte main memory (register field) per decoder
4 kByte main memory (register field)
PCI Express-to-PCI-Bridge
Image control: Gamma correction (selectable)
Brightness (+/- 50 %) Contrast (0 % ... 235 %) Color saturation (U: 0...201 %, V: 0...283 %) Hue (+/- 90°, only with NTSC)
Image Storage: 630 Byte FIFO on-board, Real time storage in the PC main memory Even-/odd field memory separated or Common full frame memory (selectable)
pciGrabber-4x4
8
PHYTEC Messtechnik GmbH 2008 L-720e_0
Ports: 8-bit parallel I/O, TTL signal (multi-purpose)
Parameter Symbol Min Max
Input High Voltage VIH 2,0 V 5 V Input Low Voltage VIL -0,5 V 0,8 V Output High Voltage VOH 2,4 V ­Output Low Voltage VOL - 0,4 V Input Low Current IIL - -70 uA Input High Current IIH - 70 uA
1 I2C interface (Master)
Parameter Symbol Min Max
Transmission rate 1
f
I2C
99,2 kHz 396,8 kHz
Input High Voltage VIH 3,5 V 5 V Input Low Voltage VIL -0,5 V 1,5 V Hysteresis V
hys
0,2 V Input High Current IIH - 10 uA Input Low Current IIL - -10 uA Output Low Voltage VOL - 0,4 V
1
: Both of the frequencies can be de-lactivated with software
Delivery Contents / Technical Data
PHYTEC Messtechnik GmbH 2008 L-720e_0
9
Start-Up
Connectors: Model VD-012 4 x BNC socket: composite video input
Pin header row 2x12: 12 composite inputs (not on the face plate) Pin header row 2x6: GPIO port, 8 x TTL I/O (not on the face plate) I2C interface Pin header row 2 x 4: 4 Jumper (not on the face plate)
Model VD-012-X1 4 x Mini-DIN socket: S-Video input
Pin header row 2x12: 12 composite inputs (not on the face plate) Pin header row 2x6: GPIO port, 8 x TTL I/O (not on the face plate) I2C interface Pin header row 2 x 4: 4 Jumper (not on the face plate)
Model VD-012 2 x BNC socket: composite video input
2 x Mini-DIN socket: S-Video input
Pin header row 2x12: 12 composite inputs (not on the face plate) Pin header row 2x6: GPIO port, 8 x TTL I/O (not on the face plate) I2C interface Pin header row 2 x 4: 4 Jumper (not on the face plate)
pciGrabber-4x4
10
PHYTEC Messtechnik GmbH 2008 L-720e_0
2.3 Field of Applications and Safety Regulations
Please pay attention to the specified operation directives of the pciGrabber-4x4. Before starting operation please read carefully the manual.
The pciGrabber-4x4 is designed for the digitization of video
signals from standard TV-cameras. Signals from composite-video cameras can be processed, which comply with CCIR B, G, H, I and the sub standard CCIR B, G, H, I/PAL. In addition signals compliant to CCIR M/NTSC can be applied. Also separate luma and chroma signals from cameras, which correspond to the S-video standard are applicable.
-
The digitization is achieved in real time. The image data are trans­ferred via the PCI-bus of the PC. The transfer rate corresponds to the access time specified for the PCI master slot.
-
The effective transfer rate must be re-oufficient to handle the volume of the image data, otherwise information might be lost.
The pciGrabber-4x4 is determined for the utilization with a
standard PC, which might be an office computer with an usual housing. The Grabber must have a reliable connection with the housing and the ground (PE).
-
The board is designed to operate in dry and dustless environment. For applications in industrial environment you have to consider to take additional protective arrangements especially against radio interference and safety hazards.
The application of the Grabber board in safety areas, for aviation
and space and for nuclear or military purposes requires our examinations and our agreement.
For industrial applications all rules for prevention of accidents and
the rules of the employer’s liability insurance association for electrical facilities are to observe.
Delivery Contents / Technical Data
PHYTEC Messtechnik GmbH 2008 L-720e_0
11
Start-Up
Before starting the operation of the Grabber board, it must be
ensured, that the device is appropriate for the application and the specific location. In case of doubt, you should ask experts or the manufacturer.
The product has to be protected from hard shocks and vibrations.
Eventually the device has to be padded or cushioned, but the ventilation may not be obstructed.
In need of repair only a specialist should be asked, who uses the
original spare parts. For the installation of the Grabber, use only tested and approved cables. Only radio shielded cables should be utilized.
2.4
Addresses
and Resources
The pciGrabber-4x4 occupies a region of 4 kBytes in the main memory of the PC for the local registers per decoder. The addressing region is automatically specified by the BIOS and no hardware wiring (jumper setting) is required.
Several pciGrabber-4x4 can be installed in one system. The boards are configured automatically by the BIOS for different addresses.
It is not possible to determine which board is configured to which address. The base address of each board can be obtained by the PCI-BIOS. For the pciGrabber-4x4 the driver software determines the address via the BIOS and defines a device number. The driver also can determine the number of boards within the system and is able to control each board by its particular device number.
It is not possible to determine which board will be specified by which device number. This will be done only by the PCI-BIOS and the architecture of the PC-motherboard. Usually the addresses are allocated in sequence of the numbering of the PCI-slots. This might deviate for different manufacturers. To solve that problem you can use the Pin header row X900. With them you can set Jumper to give every Grabber an explicit address.
pciGrabber-4x4
12
PHYTEC Messtechnik GmbH 2008 L-720e_0
The pciGrabber-4x4 will activate an interrupt in case of certain events or a distinct operational status.
The Grabber is only a single function device so only the interrupt line /INTA of the PCI-bus can be used. To this PCI-bus-interrupt an interrupt of the PC is allocated via the BIOS, so that the program can react to this event. The source of the interrupt can be determined from the interrupt status register of the Grabber.
Several boards can trigger the same interrupt /INTA, it must be determined which board caused the interrupt.
Delivery Contents / Technical Data
PHYTEC Messtechnik GmbH 2008 L-720e_0
13
Start-Up
2.5 Socket Pinout
Note:
The following description of the Grabber’s connectors is intended only as a technical reference.
Figure 2: Connectors of the pciGrabber-4x4 (VD-012)
pciGrabber-4x4
14
PHYTEC Messtechnik GmbH 2008 L-720e_0
Figure 3: Connectors of the pciGrabber-4x4 (VD-012-X1)
Figure 4: Connectors of the pciGrabber-4x4 (VD-012-X2)
Delivery Contents / Technical Data
PHYTEC Messtechnik GmbH 2008 L-720e_0
15
Start-Up
2.5.1 Composite Inputs
All composite video sources with an output level of 1 Vss and an
impedance of 75 can be used. For more information on video
standards, please refer to section 2.2.
Version VD-012
Four composite inputs available to the Grabber are located on the four BNC sockets (Socket , , and ). On the Pin header row X800 are up to 12 additional inputs available. These inputs can be used with the extension Cards VZ-012 (see chapter 4.2).
Version VD-012-X1
On the Pin header row X800 are up to 12 additional inputs available. These inputs can be used with the extension Card VZ-012 (see chapter
4.2).
Version VD-012-X2
Two composite inputs available to the Grabber are located on the two BNC sockets (Socket and ). On the Pin header row X800 are up to 4 additional inputs available. These inputs can be used with the extension Card VZ-012 (see chapter 4.2).
The input assignment for the channel numbers is as follows:
pciGrabber-4x4 (VD-012)
BNC
BNC
BNC
BNC
Composite Input 1 Decoder 1
Composite Input 1 Decoder 2
Composite Input 1 Decoder 3
Composite Input 1 Decoder 4
Table 1: Pin Assignments of the Model VD-012
pciGrabber-4x4 (VD-012-X1)
MINI-DIN
MINI-DIN
MINI-DIN
MINI-DIN
Composite Input 1 Decoder 1
Composite Input 1 Decoder 2
S-Vide Input 1 Decoder 3
S-Video Input 1 Decoder 4
pciGrabber-4x4
16
PHYTEC Messtechnik GmbH 2008 L-720e_0
Table 2: Pin Assignments of the Model VD-012-X1
pciGrabber-4x4 (VD-012-X2)
BNC
BNC
MINI-DIN
MINI-DIN
Composite Input 1 Decoder 1
Composite Input 1 Decoder 2
S-Video Input 1 Decoder 1
S-Video Input 1 Decoder 2
Table 3: Pin Assignments of the Model VD-012-X2
PHYTEC offers connecting cables to connect the application via BNC plugs and MINI-DIN plugs (see chapter 2.1).
2.5.2 S-Video Connection
The advantage of this design is the separate conduct of brightness and color signal. This prevents disturbing Moiré effects for fine image structures and improves the resolution of the color image.
S-Video sources can be connected to the variants VD-012-X1 and VD-012-X2. The pin Assignments can be taken from Table 2 and Table 3.
The sockets are switched to the corresponding S-Video norms
(refer to Figure 3 and Figure 4). The connection of the camera is possible using an S-Video cable.
Delivery Contents / Technical Data
PHYTEC Messtechnik GmbH 2008 L-720e_0
17
Start-Up
2.6 I2C Interface
External devices can be polled or controlled via the I²C interface. In order for this to occur, the external devices must have an I²C interface operating in Slave mode. The I²C interface is available at the internal pin header row X300 of the Option Port. It is possible to connect multiple I²C devices to the bus, but these devices must be distinguished by their device addresses. Table 5 depicts the pin assignments for the pin header row X300.
X300
Pin Function
10 I²C Bus: SCL 12 I²C Bus: SDA 15 Ground
Table 4 Connecting the I²C Interface to the Combi Socket
Note:
The maximum cable length is restricted, due to the fact that the I²C interface is driven by TTL signals. For a connected device, depending on the configured transmission rate, the maximum cable length is aprox. 1 - 2 m. Use cables with sufficient shielding when connecting this device.
Information for adapting the I²C interface into user software can be found in section 6.2.7, under the functions group „Transmitting Data via the I²C Interface“.
2.7 Jumper on pin header row X900
If more then one Framegrabber of the same variant are in one system it is not possible to discern them. Indeed they get different addresses but it is not possible to know which belong to whom. To solve that problem you have Jumper on the pin header row X900. You can use them to give every Framegrabber in one system a different address. So it is possible to discern them.
pciGrabber-4x4
18
PHYTEC Messtechnik GmbH 2008 L-720e_0
2.8 Notes on CE-Conformance and Immunity against
Interference
Upon delivery, the pciGrabber-4x4 meets all CE-requirements for household, office, manufacturing and industry. User modifications of the Grabber without permission of the manufacturer will result in the cancellation of the CE-certificate.
CE-conforming use of the Grabber is only maintained by utilizing CE-certified cables. These cables can be separately purchased from PHYTEC as accessories for the pciGrabber-4x4 (see chapter 2.1). If other cables are installed the user must ensure CE-conformity. If the S-Video cable WK-051 is used a ferrite of the type # 742 716 32 from Firm Würth, Kupferzell, Germany is required
If the user plans to connect the pciGrabber-4x4 with other cables, it is recommended that these cables are fitted with an anti-interference clamp or comparable interference suppression devices. The clamp should be placed about 5 cm from the Grabber and, the cable should be looped twice through the clamp. For video cables a ferrite type # 742.711.4 from Firm Würth, Kupferzell, Germany is suitable. The cable shielding has to be connected to the connector shell to obtain an optimum of shielding. The pciGrabber-4x4 was tested for a standard PC environment. If the device should be used in a different environment, it has to be exam­ined if additional radio shielding is necessary.
Caution:
Please pay attention, that significant interference peaks (ESD) to the video signal or video ground might damage the input of the pciGrabber-4x4. In areas with high interference level, for example in industrial areas and using long feed lines, additional precautions have to be taken to suppress interference. Long video cables, or mounting the components for image processing into plants and machines, can cause the exposition to balancing currents, which have to be eliminated from the
Delivery Contents / Technical Data
PHYTEC Messtechnik GmbH 2008 L-720e_0
19
Start-Up
input of the pciGrabber-4x4 by appropriate arrangements. PHYTEC does not assume any liability for damages that occur due to incorrect connections of the signal source.
2.9 Option Port
The option port provides 8 digital I/O-lines and one I²C-interface to the user. The signals are routed to a connector with 6 x 2 pins. The connector is denoted as X300, pin 1 is located in the lower left. Figure 5 shows the assignment of the pins.
Note: The current drawn out of pin X300-1 (+5V) may not exceed 100 mA.
Figure 5: Pin Formation of the Option Port
Option Port, X300 Erweiterungsanschluss (Option Port, X300)
Pin Funktion
Pin Funktion
1 +5V out 8 I/O 6 2 I/O0 9 I/O 7 3 I/O1 10 I²C SCL 4 I/O2 11 I²C SDA 5 I/O3 12 GND 6 I/O4 7 I/O5
Table 5: Pin Assignment for the Option Port X300
pciGrabber-4x4
20
PHYTEC Messtechnik GmbH 2008 L-720e_0
3 Installation of the Grabber Card
The Grabber card converts analog signals from the camera and presents these signals in a digital form to the computer and software.
If you are not familiar with insertable cards, please take the time to familiarize yourself with the instructions and equipment. The following tasks are not difficult, but must be done with caution.
3.1 Installing the Grabber Card
Caution:
The computer must be disconnected from the power supply. Please ensure that the device does not have any power supplied to it.
Remove the housing of the PC (normally screwed).
Select a free PCI Express slot
(The free slots are normally the short white parallel slots on the motherboard).
Please refer to the computer’s mother board‘s User’s Manual to obtain more information.
Remove the slot cover from the PC housing. The slot cover is
located in front of the selected slot (unscrew or break off).
As shown in Figure 6, insert the pciGrabber-4x4 into the slot with
the connectors facing outwards. The card should be inserted securely.
Do not force the card into the slot. Forcing the card into the slot
can damage the mother board, as well as the card.
Ensure that the Grabber card is inserted into the right PCI Express
slot Line up the golden contact strips with the PCI Express slot’s receptacle. Some resistance will be encountered as the contact strips spreads apart the contact springs.
Delivery Contents / Technical Data
PHYTEC Messtechnik GmbH 2008 L-720e_0
21
Start-Up
Figure 6: Inserting the Card into the PCI Express Slot
After inserting the card, please ensure that the Grabber card fits
snugly into the receptacle and that there is no interference from neighboring contacts.
Caution: For stability reasons, and to ensure a secure Ground connection to the computer’s housing, screw the card to the housing (see Figure 6)
Close the computer’s housing.
Next, the driver and the card’s demo software must be installed.
Installing the driver’s demo software differs depending on the operating system. The various installation procedures for installing the demo software is described in the next section 5.
pciGrabber-4x4
22
PHYTEC Messtechnik GmbH 2008 L-720e_0
3.2 Installing the Driver
Connect the computer to the power supply and turn the computer
on. During start-up the computer’s BIOS should automatically recognize the card.
Two possibilities exist now:
1. Either the operating system recognizes the card and searches for
the driver or
2. the operating system does not automatically recognize the card
(i.e. Windows‘ NT) and the user must manually install the driver.
Depending on the type of operating system installed on the computer, installation occurs as follows:
Windows 2000/XP/VISTA
TM
:
After the computer has recognized the card, the user is offered the option to install the driver. Select the „Search for the best driver for the device“ option from the Hardware Assistant window,, and then confirm by selecting OK. In the next window that will appear, select State a Position. Now place the PHYTEC Vision Utilities CD into the CD-ROM drive. Select Search, and in the window that will appear, select the CD-ROM drive. Change the path to pciGrab4\driver\win2K_98. Confirm by selecting OK. A list appears naming the drivers found on the CD. Select PHYTEC PCI-Grabber from the list. The CD will automatically install the driver onto the computer. Now the driver has been successfully installed. Please refer now to section 3. Then refer to section 5 to find information on how to install the demo software.
Delivery Contents / Technical Data
PHYTEC Messtechnik GmbH 2008 L-720e_0
23
Start-Up
Windows‘ NT4.0
TM
(with SercivePack 6):
WindowsNT does not automatically recognize the card, therefore the driver must be installed manually. Place the PHYTEC Vision Utilities CD into the CD-ROM drive. From the main directory of the CD, select the program Start.exe, which is located under Windows‘ NT. In the window that will appear, select the PCI-Grabber, and then select Install drivers and WindowsNT4.0. After following the directions from the installation program, the necessary drivers will automatically be installed. In the window that will appear, confirm a Restart of the computer. Now the computer should function normally after start-up of the operating system. The driver has now been successfully installed. Please refer now to section 3. Then refer to section 5 to find information on how to install the demo software.
pciGrabber-4x4
24
PHYTEC Messtechnik GmbH 2008 L-720e_0
3.2.1 Additional Drivers (optional)
It is possible to install additional drivers from the CD-ROM, although these drivers are not necessary for the functioning of the card described in this manual.
The Twain driver is a standard driver intended for use with graphic, photo, and scanner programs. The Twain driver reads images and works with the programs to process these images. The driver enables the Grabber and camera to function as a scanner device.
For additional information on the Twain driver, please refer to the User’s Manual on the graphic program that is being used.
If installation of that driver is desired:
Place the PHYTEC Vision Utilities CD into the CD-ROM drive and start the file start.exe. This file can be found in the main directory of the CD.
In the window that will appear, select pciGrabber. An installation window will appear next containing the following two entries:
Install Twain
Delivery Contents / Technical Data
PHYTEC Messtechnik GmbH 2008 L-720e_0
25
Start-Up
3.3 Installing the Demo Program
With a connected camera, the demo program allows the user to test the card, modify image parameters, and execute simple image operations.
To install the program:
Place the PHYTEC Vision Utilities CD into the CD-ROM drive.
The CD-ROM drive must be selected and the program start.exe
(found in the CD’s main directory) must be started.
Select the PCI bus grabber from the install menu that will appear
(see Figure 7).
Click on Install Windows demo software.
Figure 7: PHYTEC Install Menu
Follow the installation instructions and the demo program will be
automatically installed on the computer.
pciGrabber-4x4
26
PHYTEC Messtechnik GmbH 2008 L-720e_0
4 Connecting Video Sources
It is possible to connect one or more video sources to the pciGrabber-4x4 (see Figure 8, Figure 9 and Figure 10). These sources can either be video cameras, video recorders or any other video source [with appropriate outputs (composite or S-Video)].
Depending on the Grabber model, up to four composite (VD-012) or up to four S-Video sources (VD-012-X1) can be connected to the Grabber. At the VD-012-X2 can be connected up to two composite and up to two S-Video sources.
Changing channels occurs via software, or via the included demo program. Per decoder it is possible to digitize one Channel. The variant VD-012 and VD-012-X1 works with four decoders and the variant VD-012-X2 works with two decoders.
Figure 8: Overview of the pciGrabber-4x4 Connectors (VD-012)
Delivery Contents / Technical Data
PHYTEC Messtechnik GmbH 2008 L-720e_0
27
Start-Up
Figure 9: Overview of the pciGrabber-4x4 Connectors (VD-012-X1)
Figure 10: Overview of the pciGrabber-4x4 Connectors (VD-012-X2)
pciGrabber-4x4
28
PHYTEC Messtechnik GmbH 2008 L-720e_0
The composite inputs are located on the BNC sockets.
An S-Video signal can be applied to the Mini DIN sockets.
Necessary cables can be ordered from PHYTEC. Please refer to section 2.1,“Accessories“.
At the pin header row X800 are additional composite inputs (see chapter 4.2.
Precise information for the pin assignments of the sockets can be found in the section entitled Technical Data.
4.1 Possible Video Connections
Various video source connections for the Grabber are briefly described in this section.
All of the pictured cables can be ordered from PHYTEC. The illustration of the cables includes a brief cable description and the PHYTEC order number (see the figure below).
Figure 11: Video Connector Cables - (Description and PHYTEC Order
Number)
For more information on compatibility, please refer to the video source User’s Manual/Data Sheets.
Connection possibilities vary according to the Grabber model.
The following images categorize the various Grabber models.
Delivery Contents / Technical Data
PHYTEC Messtechnik GmbH 2008 L-720e_0
29
Start-Up
Figure 12: Connectors for the pciGrabber-4x4
The following section briefly describes the above depicted cables.
pciGrabber-4x4
30
PHYTEC Messtechnik GmbH 2008 L-720e_0
4.1.1 The S-Video Cable
The S-Video cable is connected to the Grabber using the round mini DIN socket. The video source to be connected (i.e. camera with S-Video output) should have a similar socket.
4.1.2 The Composite Cable
It is possible to connect the composite outputs (BNC plug) with a video source using a BNC plug.
Note:
If the composite sources contain a cinch socket, then a cinch/BNC
adapter (75 ) must be used.
In order to display an image, the correct channel must be selected in the user’s software and in the demo program. It is possible for the included software to automatically recognize which channel is supplied with a signal (see section 5).
Delivery Contents / Technical Data
PHYTEC Messtechnik GmbH 2008 L-720e_0
31
Start-Up
4.2 Extension Card VZ-012
An Extension Card for the pciGrabber-4x4 is available. With this Cards it is possible to use all the additional Video inputs on pin header row X800. In Figure 13 you can see the Card.
Figure 13: Extension Card VZ-012 with ribbon cable
Dimensions: 55 x 90 x 20 mm plus face plate and slot
The extension card have to connect with the framegrabber. The ribbon cable is connected to the pin header row X800 of the framegrabber. At the extension card can be select between X104a and X104b. It is
pciGrabber-4x4
32
PHYTEC Messtechnik GmbH 2008 L-720e_0
possible to operate several extension card parallel but it is important to set the right Jumper.
Every extension card offer four composite video inputs which are available on BNC sockets. The card can be placed into a standard PC.
In Table 6 is shown how many extension card can be used at the pciGrabber-4x4 variants.
extension card 1 extension card 2 extension card 3
VD-012 VD-012-X1 VD-012-X2
Table 6: Numbers of possible extension cards
Figure 14: How to connect the extension cards
The extension card can be connected how in Figure 14. The first card is connected to the framegrabber and with the second extension card. The second is connected to the third card.
The right settings of the extension cards must be set with jumper. The settings are in Figure 15 and Figure 16 shown.
Delivery Contents / Technical Data
PHYTEC Messtechnik GmbH 2008 L-720e_0
33
Start-Up
Figure 15: Jumper settings for three VZ-012 for VD-012 und VD-012-X1
Figure 16: Jumper settings for VZ-012 for VD-012-X2
pciGrabber-4x4
34
PHYTEC Messtechnik GmbH 2008 L-720e_0
4.3 Overview about all video inputs
This chapter will give you an complete overview about all the video inputs inclusive the extension video inputs from the extension cards VZ-012. The jumper settings of the extension cards must be strictly adhered to the jumper settings in chapter 4.2.
Figure 17: Video inputs VD-012
Delivery Contents / Technical Data
PHYTEC Messtechnik GmbH 2008 L-720e_0
35
Start-Up
Figure 18: Video inputs VD-012-X1
Figure 19: Video inputs VD-012-X2
pciGrabber-4x4
36
PHYTEC Messtechnik GmbH 2008 L-720e_0
Delivery Contents / Technical Data
PHYTEC Messtechnik GmbH 2008 L-720e_0
37
Start-Up
5 Start-Up of the Grabber with Demo Programs
In order to continue with this section, the demo program and the Grabber driver must be correctly installed (see section 3).
The demo program can be found under START / Programs / Phytec / pciGrabber4plus / Grab4PCI. After this program has been started, an empty program window will appear with menu options (see Figure 20).
Figure 20: Overview of the Demo Program
Next, a moving live image from the camera should be displayed Please ensure that a video camera, or another source is connected to the Grabber and that an image signal is being transmitted.
pciGrabber-4x4
38
PHYTEC Messtechnik GmbH 2008 L-720e_0
Basic parameters pertaining to the Grabber and arithmetic operations can be found in the Options pull-down menu.
Basic Settings contains the following menu:
Figure 21: Basic Settings Menu
To select the decoder at the pciGrabber-4x4 the user must define which decoder the demo program is directed towards. Select the appropriate number in the Grabber selection field.
In the area Grabber Type is shown which Typ of Grabber and Decoder is installed.
The pciGrabber-4x4 appears as:
VD-012 Decoder 1 VD-012 Decoder 2 VD-012 Decoder 3 VD-012 Decoder 4
or
VD-012-X1 Decoder 1 VD-012-X1 Decoder 2 VD-012-X1 Decoder 3
Delivery Contents / Technical Data
PHYTEC Messtechnik GmbH 2008 L-720e_0
39
Start-Up
VD-012-X1 Decoder 4
or
VD-012-X2 Decoder 1 VD-012-X2 Decoder 2
Note:
At the moment exists several PC-Framegrabber from PHYTEC. to this belong: pciGrabber-4plus pciGrabber-4 express These typs are displayed as: pciGrabber-4plus VD-009, VD-009-RS6, VD-009-X1 or VD-009-X1-RS6 pciGrabber-4 express VD-011 or VD-011-RS6 When using an older PHYTEC Grabber model, the model is denoted as „VD-007 or compatible“. In this case, the exact type of card cannot be recognized and model VD-007 is automatically configured. To avoid this problem, select the installed Grabber from the list and configure it manually (i.e. VD-007 or VD-007-X1).
Color System configures the color system to be used with the Grabber.
PAL is mainly used in Europe and NTSC is used in the USA. Grabber Type displays the recognized Grabber model. While operating with live images, these parameters cannot be changed.
Addition Settings and Type Casting Settings are described with Add Live Images and Arithmetics later on in this manual. All of these entries can be found under the menu option Features.
pciGrabber-4x4
40
PHYTEC Messtechnik GmbH 2008 L-720e_0
Click on the Image button and the following pull-down menu will appear (see below).
Figure 22: Menu Option: Image
In order to configure the parameters of the image to be grabbed, select the Image Settings command from the pull-down menu (see Figure 23).
Delivery Contents / Technical Data
PHYTEC Messtechnik GmbH 2008 L-720e_0
41
Start-Up
Figure 23: Configuring the Image Parameters
Detailed descriptions of each parameter will be given further on in this manual. In order to test the Grabber, the live image should be displayed on the monitor. To display the image on the monitor, the following requirements must be met.
It is important to select the proper video input for the Grabber. In the Channel selection field, fill in the type of video source (composite/ S-VHS) and the input channel that is being used.
The input channels can either be manually entered, or automatically searched for. In order to use the automatic search, click on the Search channel button. The first channel with an active video source that is found is used.
pciGrabber-4x4
42
PHYTEC Messtechnik GmbH 2008 L-720e_0
Depending on whether decoder is chosen under Basic Settings you must connect the camera to corresponding socket to get an picture.
VD-012 Decoder 1 -> Channel 1 at socket VD-012 Decoder 2 -> Channel 1 at socket VD-012 Decoder 3 -> Channel 1 at socket VD-012 Decoder 4 -> Channel 1 at socket
or
VD-012-X1 Decoder 1 -> MINIDIN at socket VD-012-X1 Decoder 2 -> MINIDIN at socket VD-012-X1 Decoder 3 -> MINIDIN at socket VD-012-X1 Decoder 4 -> MINIDIN at socket
or
VD-012-X2 Decoder 1 -> Channel 1at socket
-> MINIDIN at socket  VD-012-X2 Decoder 2 -> Channel 1 at socket 
-> MINIDIN at socket
In the Color Mode field, the user can choose to display the image in color, or in monochrome.
The remaining entries under Image selection can retain their pre-configured values. Exit the menu by clicking OK.
Now select the Live Image command from the Image pull-down menu. A live image from the selected video source will now be displayed in a new window (see Figure 24)
Delivery Contents / Technical Data
PHYTEC Messtechnik GmbH 2008 L-720e_0
43
Start-Up
Figure 24: Live Image from the Video Source
pciGrabber-4x4
44
PHYTEC Messtechnik GmbH 2008 L-720e_0
If a blue screen appears, examine all connections to ensure that they are secure. Also ensure that the camera is receiving power.
If the connections are secure and a power supply is available, then perhaps an incorrect channel or Grabber was selected.
Additional error source are described in the appendix.
Note:
When operating multiple Grabbers in a computer, the user must select a primary Grabber. Designating a Grabber can be done under
Options.
The Frame Rate display xx (xx= Number) can be found on the lower bar of the main window. The value represents the number of images that are generated per second in the live window. The value is dependant on the size of the image, and the capacity of the computer, because the digitized image must be transmitted from the computer’s RAM to the graphic card to eventually show up on the screen.
Note:
Despite the processor’s capacity, the Grabber always stores image data in real time in the main memory (RAM) of the PC.
Further processing of the data is dependant on the CPU of the PC.
The status bar further contains a counter that displays the total number of live images captured (Frames Captured).
When the counter has reached 255, it automatically begins a new sequence starting with 0.
The status bar can also be used to indicate whether the Grabber is active or not.
Delivery Contents / Technical Data
PHYTEC Messtechnik GmbH 2008 L-720e_0
45
Start-Up
5.1 The parallel image processing
The demo program does not supported the parallel image processing, but it is possibility to open the program several times. If you use a pciGrabber-4x4 variant with four decoder you can start the demo program four times. First the settings in the menu Basic Settings must be set. It is important to allocate every demo program one decoder. If two programs have the same decoder it is possible that they work incorrect. After that you must select the channel under Image Settings. Finally the Live Image can be started.
The following should be noted! The pciGrabber-4x4 uses a PCI Express-to-PCI-Bridge. This means that all video decoder operates together on a PCI bus. The PCI bus works only on the grabber card. Through the bridge the PCI bus is linked to the PCI Express bus. The PCI Express bus works with 1250 MHz and is able to transmit about 250 MB/s. The PCI bus works with 33 MHz. So it is possible to transmit 132 MB/s. So the PCI bus limits the data volume. At a digitizing of one decoder the data volume represents 44 MB/s.
The calculation of the maximum data volume per one decoder
results (PAL):
Image size (max): 768 x 576 Numbers of bytes per pixel(RGB32): 4 Numbers of pictures pro second: 25 Numbers of decoders: 1
s
MByte
decoders
s
pictures
pixel
byte
size =
equation 1
s
MByte
s
Byte 2368.44
1
254576768 =
Are four decoders used simultaneously, increasing the volume of data by a factor of four to 176.9 MB/s
s
MByte
s
Byte 9.1764
1
254576768 =
pciGrabber-4x4
46
PHYTEC Messtechnik GmbH 2008 L-720e_0
To get a clear transfer of the data volume the maximum data rate of the PCI bus must not be exceeded. In addition, a safety distance of ~15% to the 132 MB/s must be adhered to. So the maximum data without overloading the PCI bus is 112 MB/s
Numbers of
decoders
RGB32
768 x 576
RGB32
640 x 480
RGB32
620 x 450
RGB16
768 x 576
Y8 Gray
768 x 576
1
44,2 MB/s 30,7 MB/s 27,9 MB/s 22,1 MB/s 11,1 MB/s
2
88,5 MB/s 61,4 MB/s 55,8 MB/s 44,2 MB/s 22,1 MB/s
3
132,7 MB/s 92,2 MB/s 83,7 MB/s 66,4 MB/s 33,2 MB/s
4
176,9 MB/s 122,9 MB/s 111,6 MB/s 88,5 MB/s 44,2 MB/s
Table 7 Example data volumes PAL 25fps
Numbers of
decoders
RGB32
720 x 480
RGB32
640 x 480
RGB32
580 x 400
RGB16
720 x 480
Y8 Gray
720 x 480
1
41,5 MB/s 36,9 MB/s 27,8 MB/s 20,7 MB/s 10,4 MB/s
2
82,9 MB/s 73,7 MB/s 55,7 MB/s 41,5 MB/s 20,7 MB/s
3
124,4 MB/s 110,6 MB/s 83,5 MB/s 62,2 MB/s 31,1 MB/s
4
165,9 MB/s 147,5 MB/s 111,4 MB/s 82,9 MB/s 41,5 MB/s
Table 8 Example data volumes NTSC 30fps
If the 112 MB/s are not exceeded an unproblematic data transfer is possible. To see as in Table 7 and Table 8 it exists many possibilities to reduce the volume of the data.
1. Reduce the resolutio
2. Reduce the colour depth
3. Reduce the display regeneration rate
With the help of equation 1 can compute the data volume and decide which settings for the suitable application suits.
Delivery Contents / Technical Data
PHYTEC Messtechnik GmbH 2008 L-720e_0
47
Start-Up
Figure 25: Overloaded PCI bus
Figure 25 shows an effect which can appear with too high data rate. It is good to see that the whole picture becomes streaky. The stripes arise from the fact that some picture data in absence of the capacity of the PCI bus can not be written fast enough in the main memory. The data which cannot be transmitted get lost, because the video decoder cannot cache them. Only the “old data” are available for certain ranges of the pictures. In these ranges the “old picture data” are displayed and so the picture becomes streaky.
pciGrabber-4x4
48
PHYTEC Messtechnik GmbH 2008 L-720e_0
5.2 Demo Program Description
This section describes in greater detail the program, as well as the menus of the included demo program.
The Image Settings menu (see Figure 26) contains parameters that influence image generation and depiction:
Figure 26: „Image Setting“ Menu
The parameters can be configured before a live image is displayed, although parameters cannot be configured while live images are displayed.
The section entitled Channel Selection, offers parameters for video source types and channel selection.
Delivery Contents / Technical Data
PHYTEC Messtechnik GmbH 2008 L-720e_0
49
Start-Up
Click on either the Composite or the S-VHS button to select the appropriate signal type.
Composite Sources
Composite refers to the BNC sockets (VD-011). From the Channel menu, select the appropriate input channel for the connected camera. Note that the right decoder is selected. Clicking on Search Channel allows the grabber to search for an active input channel. The program configures the first channel with a video signal. This function can only searches on one decoder. To check the whole card every decoder must select separately select under Basic Settings. By using the extension boards VZ-012 16 video inputs are available.
S-Video Source
S-Video (or „S-VHS“) – Sources become designated with MINIDIN. The image source is connected to the round mini DIN socket.
The user can choose to display an image in color (when using a color video source) or monochrome by using the color and monochrome buttons.
“Image Selection“, found in the lower section of the window, can be used to configure the size and resolution of the image.
The Image Resolution parameter is used to configure the image’s resolution (= „quality“)
The parameters divide into x-direction for the pixel number and in y-direction for the row number. Both values can be changed separately using the free defined button.
Please note, that the image will be displayed distorted (stretched or shrunk) if the 4:3 ratio is not adhered to. (This width to height ratio arises due to television standards).
pciGrabber-4x4
50
PHYTEC Messtechnik GmbH 2008 L-720e_0
The TV Format button prevents image distortion by automatically adhering to the 4:3 ratio (width/height relationship). For example, if given the number of pixels, the number of rows is automatically calculated with the 4:3 ratio.
The Window Size button can be used to extract a section of the image, and display this section instead if tge whole picture on the monitor.
This section can be smaller than the viewing field of a camera. If the entire digitized field is to be displayed, then checkmark the Image=Window box.
The Window Size does not distort the image geometry because it is not a scaled section, rather then a cut out section.
Note:
Please note that scaling and cutting section processing is run in real time in the Grabber. The Grabber stores the image as it is displayed on the monitor. This is very beneficial because the CPU is not needed for this function.
A brief explanation of similar television technology will lead to a better understanding of the buttons field1, field2, full frame, and field
aligned.
A television image (normal video signal) is made up of two interlaced images, so called half frames (fields) (see Figure 27). These half frames (fields) are consecutively generated in a similar fashion and then displayed on a screen (i.e. television).
The interlacing of the images reduces the flickering that can occur with TV images.
Delivery Contents / Technical Data
PHYTEC Messtechnik GmbH 2008 L-720e_0
51
Start-Up
Figure 27: Creating a Full Image: Two Fields, Each with 7 rows
According to the PAL-norm, each signal contains 625 rows. The rows are divided into field frames: the first field (odd, field1 with rows 1-
625) and a second field (even, field2 with rows 2-624). An image section is fully recognizable by one of its half fields. The image’s vertical resolution is reduced by half, since the image is only represented by 228 rows. (excluding the invisible rows that precede and succeed the image as well as test and data rows.) A total of approximately 576 from 625 rows remain visible
Digitizing a field is time efficient; compare 20 ms for a field image to 40 ms for both fields (full frame).
If the same field (i.e. the first) needs to be digitized repeatedly, there is a pause of 20 ms between the processes.
Digitizing a full frame can create a distorted image if the object moves too quickly. The object is in a different location in the first field than it is in the second, creating a comb effect. The image may appear as shown in Figure 28.
pciGrabber-4x4
52
PHYTEC Messtechnik GmbH 2008 L-720e_0
Figure 28: Comb Effect That Occurs with Quick Moving Objects
The parameter described above can be changed in the demo program.
With vertical resolutions smaller than 288 rows, it is easier to digitize a field. The field1 (first, odd half frame) and field2 (second, even half frame) buttons can be used to manipulate the digitization of half frames.
If the number of rows is larger than 288, then both fields must be digitized. To digitize both fields, click on full frame. If a number larger than 288 is entered into Image Resolution, then the full frame is automatically selected.
The field aligned button doubles the number of displayed half frames per second. This eliminates the 20 ms pause between the digitization of half frames.
Optically frames, the image contents shifts a half line up and down, when consecutively displaying both half frames.
This occurs because the two half frames cannot be interlaced to form a full frame. When configuring field aligned, the Grabber automatically moves the second half frame one half row, so that the second half frame can properly interlace with the first half frame, creating a full frame.
This does not allow the jump effect to occur. This configuration for field aligned is also helpful when the user wishes to consecutively digitize images with a maximum of 288 rows, at a rapid pace (1 field in aprox. 20 ms). If the horizontal resolution is smaller than 360 Pixel the checkmark came Lowpass should be set.
Delivery Contents / Technical Data
PHYTEC Messtechnik GmbH 2008 L-720e_0
53
Start-Up
This Lowpass will smoothen the in size reduced image. The Lowpass will automatically be activated if the resolution is smaller matically be activated if the resolution is smaller then 360 Pixel and otherwise deactivated.
Window Position can be used to determine the position of the image window contained in the above mentioned image section. The values represent the position of the upper left-hand corner. In order to center the image in the TV screen, check mark the box next to center.
The parameter moves around cut out the section in the an entire image. Therefore, can the cut out section only be moved around if it is smaller than the entire image.
pciGrabber-4x4
54
PHYTEC Messtechnik GmbH 2008 L-720e_0
5.3 Image Control
During the displaying of a live image the image control window can be opened by selecting Image-Live_Image Control. The dialog box shown in Figure 29 will appear. With the help of slider controls the values of brightness, contrast, color, saturation and hue are adjusted. The values are immediately applied to the Grabber, so that the corresponding effects can be registered in the live image.
Figure 29: The Image Control Window
For the adjustment of the color saturation two controls are available: saturation U and saturation V. This allows separate manipulation of the saturation in the red- and blueviolet region. With the control box U=V both controls can be united. In this way you are able to change the color saturation without manipulating the color tone.
Delivery Contents / Technical Data
PHYTEC Messtechnik GmbH 2008 L-720e_0
55
Start-Up
The hue control makes only sense for the NTSC-system. This control serves for the correction of the color tone, in case a phase shift has occurred during transmission. Those interference’s can only be present in NTSC-systems. The PAL-system corrects color tone failures automatically, so that the hue control has no effect.
Note:
Modification of the hue (i.e. white balance) can equally be done on NTSC and PAL systems by moving the saturation sliders separately (in general it is better to midify the white balance at the camera or video source if possible).
5.4 Additional Functions Under Image
Using the Single Image entry, a snapshot is taken and displayed on
the screen. In this mode, the Grabber only performs one digitization.
The parameter Image Settings defines the image.
Using the parameter Live Image, a live image can be displayed on
the monitor. Image settings also defines the image in this mode.
Snapshots can be taken during live operation using the Snapshot
option.
The current image will be displayed in a new window. Multiple
snapshots can be made.
Snapshot-Windows that appear on the screen are automatically
numbered.
Using the pre-configured parameters in Image Settings, Open
Image on Start enables a live image from the video source to be
displayed on the monitor after every program start.
Adding the demo program to the auto start group enables the
computer, after start-up, without intervention from the user, to display a live image, with the pre-configured parameters, on the monitor.
pciGrabber-4x4
56
PHYTEC Messtechnik GmbH 2008 L-720e_0
5.5 Crosshair function (Overlay)
Several types of crosshairs can be overlayed in the live image. This can be useful to a center a objet in the middle of the image. The parameters for this function can be found under the menu option Effects All of the cross hairs, or a combination of them , can be overlayed in the image.
5.6 Special Functions
The demo program offers several special functions to manipulate and analyze image contents.
Display Histograms
Histogram enables a histogram to be calculated from a static image, i.e. an image obtained using the Snapshot.
A histogram provides the distribution of the grey- or color values of an image.
The relative Frequency of the corresponding intensity values are represented by brightness, as well as the intensity (see Figure 30).
Figure 30: Histogram
Delivery Contents / Technical Data
PHYTEC Messtechnik GmbH 2008 L-720e_0
57
Start-Up
The X-axis includes the values between 0 and 255. Using the check boxes in the histogram window, the curves of grey values, or the separate color values, can be turned on/off.
Caution:
A histogram can only be created from a static image, and not from a live image. To create a histogram for a live image, you must first create a static image using the snapshot function.
pciGrabber-4x4
58
PHYTEC Messtechnik GmbH 2008 L-720e_0
Analyzing Colors:
Selecting the Color Meter option opens the window shown in Figure 31.
Figure 31: Color Meter
The color meter option only functions in the live image display. The color meter displays various color models for the color values of pixels embedded in the center of the image.
A small crosshair that appears in live image indicates the center of the image.
The RGB model displays the color values for red, green and blue as pointers and number values on the intensity bar.
The YCrCb model displays color values as color bars and in a coordinate system.
Delivery Contents / Technical Data
PHYTEC Messtechnik GmbH 2008 L-720e_0
59
Start-Up
Thus, color fading and changing can be observed over an extended period of time.
The Reset button erases the existing coordinate graph and creates a new graph.
The HSI model displays the color values in a color circle. The length of the vector indicates the saturation level, and the direction of the vector indicates the hue. Brightness is displayed in a gauge at the bottom of the window.
Each value is also numbered.
Displaying Color Bars:
Select the Color Bars option in order to test the Grabber.
The color bars are generated from hardware and not the demo program. The number of bars displayed depends on size of the chosen image. All color bars are displayed with a horizontal resolution of aprox. 515 pixels.
Arithmetic Operations on Static Images:
The Arithmetics menu option provides some simple arithmetic operations on static images (see Figure 32).
For example, images can be added, subtracted, multiplied or divided pixel by pixel. In addition, a constant can be added to each pixel (brightness changes) or the constant can be multiplied with each pixel (contrast change).
pciGrabber-4x4
60
PHYTEC Messtechnik GmbH 2008 L-720e_0
Figure 32: Arithmetics Menu
Images to be manipulated can be selected from Source Image 1 and 2. The number behind Image# corresponds to the number of the image window.
Arithmetic operations can be selected from the Images entry. The user can also choose to perform an absolute calculation.
When performing an absolute calculation, negative values are not allowed. Eventually these negative values will display a meaningless and incorrect result.
Under the Constant option, a constant can be added to each pixel (changes brightness) or can be multiplied with each pixel (changes contrast).
All arithmetic operations are normalized. This is important if the result is expected to be outside of the displayed range of values. (Each color channel has a range from 0 to 255). On principle, values greater than 255 are set to 255, and pixels with values less than 0 are set to 0.
Delivery Contents / Technical Data
PHYTEC Messtechnik GmbH 2008 L-720e_0
61
Start-Up
This prevents, for example, the creation of white images caused by multiplying pixels.
The normalization factor can be selected from Options pull-down menu under Type Casting Settings (see Figure 33).
Figure 33: Selecting the Normalization Factor
The actual value is displayed in the bottom section of the Arithmetic menu.
Caution: Incorrect settings of the normalization factor will provide unsatisfactory results with arithmetic operations (i.e black or white images).
The Add Live Images option enables up to 1000 consecutive live
images to be compiled into a single image.
The desired number of images can be selected under Options /
Addition Settings (see Figure 34).
Figure 34: Number of Images
pciGrabber-4x4
62
PHYTEC Messtechnik GmbH 2008 L-720e_0
This feature can also be used to reduce noise levels when recording images or to reduce the resolution of moving objects, in comparison to the background.
After the addition process the resulting picture is normalized so that the original brightness is retained.
The length of the process depends on the number of images that were added and the capability of the computer.
The operation’s status is displayed as a percentage in the lower section of the window.
Caution:
In order to ensure that the brightness for added images has the same quality as single images, the parameters for the number of images change simultaneously with the normalization factor (type casting).
The normalization factor must eventually be re-configured when using additional Arithmetic functions.
Option Port Test:
The menu Features/Test Hardware contain the subitem Option Port.
Figure 35: Option Port Menü
Delivery Contents / Technical Data
PHYTEC Messtechnik GmbH 2008 L-720e_0
63
Start-Up
This Menu permit to control the I/Os on the Option Port (X300). It is possible to turn the I/Os on or off further it possible to set the I/Os as an input.
Jumper reading:
Der Menupunkt Features/Test Hardware beinhaltet den Unterpunkt Option Port.
Figure 36: Option Port Menü (Jumper)
In this menu it is possibly to read the states of the jumpers. If no jumpers are equipped on I/O 8 to 11, they are on high level. They are red marked. If jumpers are equipped the red selection goes out.
pciGrabber-4x4
64
PHYTEC Messtechnik GmbH 2008 L-720e_0
5.7 Storing Images, Ending the Program
The menu option File enables users to store live images (snap shots), static images and arithmetically processed images. The options Save or Save as allow the images to be saved with an index number given by the program, or with a name given by the user.
The images are saved in bmp format and can be viewed and processed with any graphic program.
The Close option consecutively closes static images as well as the live window.
Exit closes and leaves the program.
5.8 Getting Started with Linux
For the pciGrabber-4x4 can be used the BTTV-driver. This driver is already included in most Linux distributions. You can work without special driver. At the moment the driver must be still customised by hand. Please, read the FAQs under www. PHYTEC.de.
Hints:
The use of the PCI Express-to-PCI-Bridge can cause that the PCI
bus allocation for the devices not fit, because Linux update these not independently. The devices must be relocated. The graphics card can be configured with the SaX2 function automatically or by hand in Xorg.conf. If further information is needed please ask your Linux provider.
Programming Manual
PHYTEC Messtechnik GmbH 2008 L-720e_0
65
Programming Manual
Part 2
Programming Manual
pciGrabber-4x4
66
PHYTEC Messtechnik GmbH 2008 L-720e_0
6 Driver Software
This section gives you the information how you can access the pciGrabber-4x4 with your own program.
The driver library provides you with a collection of functions, which are able to configure the Grabber, which can inquire the status of the Grabber and start the digitization.
Software drivers for different operating systems are available.
In this manual drivers for
Windows XP/VISTA Windows NT 4.0 Windows 2000
are explained.
Note:
In order to obtain the newest information regarding the driver and the availability of additional drivers, please read readme.txt. (This file can be found on the installation CD.)
The next section describes the technical features of the Grabber and explains television norms in greater detail for a better understanding of the Grabber's functionality.
Programming Manual
PHYTEC Messtechnik GmbH 2008 L-720e_0
67
Programming Manual
6.1 Technical Basics
6.1.1 Block Diagram of the pciGrabber-4x4
Figure 37: Block diagram VD-012
Figure 37 shows the block diagram of the pciGrabber-4x4. The composite input signal is connected to a 9:1-video multiplexer, which is controlled via the PCI-Bus. The following A/D-converter digitizes this signal. All image sources can be used, which provide a color video signal corresponding to the CCIR- standard „PAL (B,D,G,H,I)“, „NTSC (M)“.
In Germany image sources generally provide PAL-signals. In this manual we assume that always PAL-signal sources are used.
pciGrabber-4x4
68
PHYTEC Messtechnik GmbH 2008 L-720e_0
Figure 38: Block diagram VD-012( part 2)
Via the S-VIDEO-input luma- and chroma-signal can be supplied separately (for example from a S-Video-camera or S-VHS-videore­corder). For the spectral component of the color a separate A/D-converter is used, which improves the quality of the image.
Also black/white videosources can be connected to the pciGrabber-4x4. The processing of grey scale pictures with 256 grey graduations is already provided in the Grabber and can be activated by software. Applying black/white sources, the sharpness of the image can be improved by deactivating the luma notch filter by software.
After the A/D-converters follow operational components, which decompose the data stream of the image into its components: After the chroma-demodulator the data are separated according to brightness. (Y) and color portion (Cr/Cb). Subsequently follows the digital correction of brightness, contrast, color saturation and the size and resolution of the image.
Programming Manual
PHYTEC Messtechnik GmbH 2008 L-720e_0
69
Programming Manual
The following video format converter produces the data formats, which are provided by the pciGrabber-4x4. Via a datamultiplexer the required format is selected and stored in the 630 Byte FIFO memory. The FIFO is an interface to the following PCI-bus interface, which is responsible for the data transfer through the PCI-bus.
The PCI Express-to-PCI-Bridge changes the PCI bus in an PCI Express bus.
The image data are transferred by DMA to the main memory of the PC. For each field a separate DMA-channel is used. The transfer can be organized in different ways. For this reason a pixel instruction list for each field is used, which is denoted RISC-Program, for the PCI-controller of the pciGrabber-4x4.
Via the PCI Express-controller the access to the local registers is managed. This allows the adjustment of the parameters of the Grabber and the acknowledgement of the actual status. This registers are also used to actuate the I/O- lines defined by the user, and to drive the I²C-interface integrated in the Grabber.
pciGrabber-4x4
70
PHYTEC Messtechnik GmbH 2008 L-720e_0
6.1.2 The Videosignal and Digitization
The standard videosignal, which is processed by the Grabber, contains 625 lines, which are divided into two fields (see Figure 39). The first field (odd field) contains lines 1 to 313, the second (even field) the lines 314 to 625. The fields are interlaced, in order to reduce flicker of the TV-picture. In special respect line 314 follows after line 1. Besides various retrace- and blanking lines, the videosignal contains lines for control and data purposes and lines for videotext information, which restricts the actual image size to two fields of 288 lines.
Figure 39: InterlacedIimage (Example with 9 Lines)
Each field is built up within 20msec. One field provides already the whole image, but the vertical resolution is reduced to the half. For many applications this might be sufficient, so that after 20 msec a digitized image is already available. In case of that the resolution in X-direction can also be reduced, we can obtain an image without distortion. However a reduction of the resolution in X-direction can not speed up the digitization process, since the time base is fixed.
If the full TV-resolution is required, time has to elapse until both fields are digitized (40 msec). Both fields follow one after another.
In order to make the interlacing of both fields possible, the last line of the odd (the first) field, is reduced to the half. Therefore the first line of the second field contains only the half line.
Programming Manual
PHYTEC Messtechnik GmbH 2008 L-720e_0
71
Programming Manual
Figure 40: Fields and Frames
For fast moving objects it might happen that the time between the digitization of the first and second field is so long that meanwhile the objects have moved some distance and both fields don’t match anymore, which will cause some remarkable blurring. For this reason quite often only one field is used with a reduced resolution.
Figure 41: Moving Objects Cause Comb Effects
pciGrabber-4x4
72
PHYTEC Messtechnik GmbH 2008 L-720e_0
6.1.3 Transfer and storage of color
Color and brightness are always separated for the transmission by the TV-systems. Transmitted are the brightness (luma signal, Y-signal) and the color differential signal (chroma signal). This signal defines the color of a pixel by the color tone and color saturation.
The TV-standards reduce the bandwidth of the color signal in comparison to the brightness signal. The color of a pixel is more ‘blurred’ than its brightness. This corresponds to a painter, who at first makes a sketch with a sharp pencil and then colors the areas with a broad brush.
The Y-bandwidth of the PAL (B,G,H,I) - system is 5 MHz, and the bandwidth of the chroma signal is 1.5 MHz.
The chroma signal is also denoted as U/V signal for PAL standard or Q/I-signal for the NTSC standard. V- and I-signal define the reddish colors, whereas the U- and Q-signal define the bluish-violet colors. Altogether we speak from the Cr/Cb signal (chroma red/ chroma blue).
With the triplet (Y,Cr,Cb) the brightness and color of a pixel are completely defined. These values are ready to be used without further evaluation for image processing in respect to color recognition or color control.
Frequently the definition of a pixel is preferred in the red, green and blue (R,G,B) notation. The transformation according to CCIR-recom­mendation for PAL is achieved with the following matrix:
=
1
75,237
56,116
45,191
0
698,0
371,1
732,1
338,0
0
1
1
1
V
U
Y
B
G
R
Programming Manual
PHYTEC Messtechnik GmbH 2008 L-720e_0
73
Programming Manual
The pciGrabber-4x4 is able to convert the images into the RGB-format and stores the RGB- color triplets in the memory. This format provides a good base for further processing.
Often the YCrCb-format is more suitable for storage or transfer of image data, since the data volume is less. Instead of three Byte only two Byte (one word) are required. The lower eight bits contain the brightness and the eight upper bits specify the color portion (Cr/Cb).
For each Y-value alternatingly only one color portion Cr or Cb is associated. So each pixel has only one part of color information either the red or blue portion. The missing information can be obtained from the neighboring pixel. The color is transferred and stored only at the half resolution of the brightness. Since the bandwidth of the color information is already reduced by the TV system, this procedure does not mean a real restriction. This data format is denoted asYCrCb4:2:2.
The first pixel of each line delivers Y1,Cr1/2, the second Y2,Cb1/2 etc.
For the correct recognition of the color information of an image, four subsequent fields are required to be digitized. Therefore it is not sufficient to connect the video source only for a short period or to connect the videosource only for the duration of the digitization of one field. In addition the recognition of a field might not work correctly at the beginning, in case another not synchronized signal from a camera is applied. In case of fast switching between two signal sources the digitized image might be incorrect and it is recommended to observe some time delay.
pciGrabber-4x4
74
PHYTEC Messtechnik GmbH 2008 L-720e_0
6.1.4 Data storage by DMA and RISC-Program
This section describes the transfer of the data to the main memory and the storage of the pixels to the addresses specified by the user.
As mentioned before, the transfer of the data is accomplished via two DMA-channels, one for the odd and one for the even field. During the time of digitization the DMA-controller of the pciGrabber-4x4 is con­trolling the PCI-Bus and is master. The data are transferred in real time along the PCI-bus to the main memory. This is possible because of the high transfer rate of the PCI-bus.
The picture data are sent in real-time over the PCI bus to the PCI Express-to-PCI-Bridge. From there the data are sent over the PCI Express bus and will transmit into the main memory. This is possible by the high transmission speed of the PCI and PCI Express bus.
Delays of the data transfer or for time intervals the PCI-bus is not available to the Grabber (that means some other devices become master), are bypassed by a FIFO-memory. This allows only a short time span to bypass the blocked bus, since otherwise an overflow might occur and portions of the image are lost. The bus is controlled by the parameter Maximum_Latency and Minimum_Grant of the PCI-board. If required, this parameters have to be adapted to the data transfer rate, to the system configuration and to the bus performance.
The pciGrabber-4x4 is very flexible concerning the storage of the data. The user can specify destination and format of the data within a certain scope. For this a mechanism is required to separate the continuous flow of data into partitions and direct the data to the required addresses.
This mechanism is accomplished by the pciGrabber-4x4 with the help of the pixel instruction list. This is a RISC-program, which drives the DMA-controller correspondingly.
This RISC-program has to be written by the user and must fulfill the required tasks and has to match the data and image format. So the
Programming Manual
PHYTEC Messtechnik GmbH 2008 L-720e_0
75
Programming Manual
program has to be specified according to each problem, which implies that the RISC-program is created during run time of the user program, since often the parameters (for example the size of the image) which control the RISC-program, are variable or not available prior to this time.
The software driver delivered with the pciGrabber-4x4, creates the ap­propriate RISC-program automatically with the adjustment of the im­age size. This process is transparent to the user program.
Nevertheless this feature should be in the conscious of the programmer using this driver software.
Figure 42 depicts this scheme. For image size and data format selection the user program applies the function set_image() of the driver. The driver starts two actions: first the image size is set in the VideoScaler by values in the local registers of the Grabber via the PCI-bus. This implies, that the pciGrabber-4x4 creates the correct image size and the data flow has the correct format and provides the appropriate synchrony signals. In the same way the DataFormatConverter is adjusted to the correct format. This implies that the flow of pixel data to the FIFO has the correct format (for example RGB).
The second action of the driver software is the creation of a data flow appropriate to the RISC-program, which is stored in the main memory of the PC. The DMA-controller of the pciGrabber-4x4 is notified of the starting address of this program. During digitization, the DMA-controller receives the RISC-commands in sequence by DMA from the main memory and executes those commands and stores the data according to those instructions.
pciGrabber-4x4
76
PHYTEC Messtechnik GmbH 2008 L-720e_0
Figure 42: Pixel- and Control Data Flow (Overview)
The flow of data via DMA-access is directed to the main memory to the address specified by the RISC-program. This address region is reserved by the user program (e.g. the definition of arrays).
The regions might be defined - as shown in Figure 42 - as two separate regions, one for the odd- and one for the even field, or only one region, which is provided for the whole frame of the pciGrabber-4x4. The different options are selected by a parameter in the set_image() function, which influences the creation of the RISC program via the driver.
Programming Manual
PHYTEC Messtechnik GmbH 2008 L-720e_0
77
Programming Manual
Since the user program defines the address regions it knows the position of the memory regions and might mark them by a pointer. In this way the access to the data can be accomplished without using the driver.
The driver provides information of the status, which indicates the end of the storage of the image in the memory, so that at this time all data are available.
This mechanism guarantees a fast access to the data. The process is real time regarding to the standard TV format. For the digitizing of a field it takes a time of 20 msec and the digitizing of a whole frame lasts 40msec. In some cases a time delay must be added to get the total time from the demand of the image to the end of the digitization process.
This additional time might arise from waiting for the appropriate field. For example, if an even field is demanded, but the camera has just started scanning an even field, so it is necessary to wait until this field and the next following odd field are finished. In the worst case a delay of 40msec (two fields) can be expected. Now the demanded field can be digitized, which will last another 20msec. During the following 20 msec nothing will happen in this memory region since the odd field will be received. The next 20msec a new even field is stored in the memory. It must be considered that the old information will be overwritten by the new information, otherwise the content might be interpreted incorrectly by the software especially for moving scenes.
Now we consider the case of digitizing a whole frame in one memory region. Here the same effect might occur but in some different fashion. After 20 msec digitization the information for an odd field is completely available and therefore all odd lines are defined, but the even lines are not defined. During the following 20 msec the data for the even field are received. Therefore there is no time, which is not used to transfer data to the memory except for the blanking interval. So there is always a point (X,Y) where old and new information are stored adjacently, so that a mismatch will show up.
pciGrabber-4x4
78
PHYTEC Messtechnik GmbH 2008 L-720e_0
6.2 Driver for Microsoft Windows
When executing the installation program for the Windows demo program, the files are downloaded and stored to the hard disk. The structure of the file directory is similar to Figure 43. The window on the left-hand side displays path names. These path names can be edited during installation in order to create user specific names for the system. The libraries and include files to be compiled are located in the labeled subdirectories.
Figure 43: Directory for Window’s Driver
Programming Manual
PHYTEC Messtechnik GmbH 2008 L-720e_0
79
Programming Manual
6.2.1 Requirements
Programs for the pciGrabber-4x4 can be created with the help of various development environments. These newly created applications will work with the Windows XP/VISTATM and the Windows NT4.0/2000 operating systems.
Caution:
The device driver and corresponding DLLs must be copied into the Windows main directory in order to implement the pciGrabber-4x4 in a Window's operating system. In addition, the system driver must be registered into the registry table.
Phytec’s installation program automatically copies the device driver and DLLs and registers the system driver. Therefore, all the requirements for operation are fulfilled. Creating corresponding installation routines is recommended when installing newly created applications onto other computers.
pciGrabber-4x4
80
PHYTEC Messtechnik GmbH 2008 L-720e_0
6.2.2 Application of the Device Driver for Windows NT4.0
Because the pciGrabber-4x4 accesses by DMA access to the memory, it is necessary that it concerns physically attached and continuously addressable memory. Because of that the physically memories which acts as an image storage must allocate. Moreover, the driver permits the access to the registers pciGrabber-4x4.
In order to implement Windows NT4.0 with user specific applications, use the included installation disk from Phytec.
These applications can be found on the installation CD, in the PCIGRAB4\DRIVER\WINNT40 directory. The files stored in this directory can be copied to a disk and run with user applications.
The user also has the option to create an installation program specific to user needs. When creating this program, please take note of the following points: The driver must enter the Windows NT4.0 system into the register. This can be done in the following manner:
The PCIGRABBER4.SYS file must be copied into the directory
labeled <Windows>\System32\drivers.
The driver is then entered into the Registry Table:
Use the REGEDIT program (located in the WindowsNT directory). Scroll down the directory tree
HKEY_LOCAL_MACHINE/System/CurrentControlSet and select Services (see Figure 44).
Programming Manual
PHYTEC Messtechnik GmbH 2008 L-720e_0
81
Programming Manual
Figure 44: Windows NT Registration Editor
Open the Services folder. Select the Edit/New/Key pull-down menu and a new key will be created. Name this new key „pciGrabber4“, as shown in Figure 45.
Figure 45: Entering a Device Driver
pciGrabber-4x4
82
PHYTEC Messtechnik GmbH 2008 L-720e_0
Now configure the new key group and mark the entry with „pciGrabber4" as shown in Figure 46.
Select the DWORD value command from the Edit/New pull-down menu. A new entry named „New Value #1“ will be created within the „pciGrabber“ key.
Change this name in „Start". Right click on the newly created entry and select Modify. In the dialog box that will appear, enter the number 2 into the Value field. Select the DWORD value command option from the Edit/New pull-down menu. Change the description in „Type“ and enter a value of 1.
Similar to the previous DWORD entry, select DWORD value from the Edit/New pull-down menu and enter a value of 1 for „ErrorControl“. The end result should look similar to Figure 46.
Figure 46: Configuring the Driver
Programming Manual
PHYTEC Messtechnik GmbH 2008 L-720e_0
83
Programming Manual
After restarting the computer, the driver is automatically loaded when starting Windows NT.
Caution:
The device driver must also be removed when uninstalling user programs. Erase the entry from the Registry Table and from the system directory. The driver reserves 1.2 MB for the pciGrabber-4x4 in the main memory. The memory space is not available for other applications.
Caution:
Pay careful attention when changing the registry entries. If an error occurs while making these changes, the configurations can be permanently damaged. This could render the Windows NT operating system inoperable. For simplicity, it is recommended that end users implement an install/uninstall program, since all of these tasks are automated.
pciGrabber-4x4
84
PHYTEC Messtechnik GmbH 2008 L-720e_0
6.2.3 Application of the Device Driver for Windows 2000 / XP /
VISTA
Similar to Windows NT4.0, the device driver allocates physical memory for storing images. The driver also allows access to the Grabber’s register.
Reserving memory space is only possible with a device driver under the Windows 2000 operating systems.
The driver also transforms linear memory addresses into physical memory addresses.
User programs do not have direct communication with the driver, instead access is provided by DLLs.
Phytec’s installation disk is recommended for operation of the Windows 2000/XP/VISTA driver with user specific applications.
These applications are located on the installation CD under the PCIGRAB4\DRIVER\WIN2k_98 directory. Files from this directory can be copied to a disk and applied to user applications.
Programming Manual
PHYTEC Messtechnik GmbH 2008 L-720e_0
85
Programming Manual
6.2.4 Application of the DLL
The DLL provides communication between user programs and the pciGrabber-4x4. The DLL configures the Grabber and controls digitization events. In addition, the DLL allows access to the data of digitized images stored in the main memory.
Caution:
The DLL is not linked to the user program, but invoked during runtime. Therefore, the DLL must be available in the Windows system directory during program runtime. In addition to GR4CDLL.DLL the following DLLs are necessary for operation:
M
SVCRT.DLL
CTL3D32.
DLL
MFC42.
DLL
Windows provides various API functions to dynamically link the DLL. Load Library(…) is used to load the DLL and a handle is subsequently returned for the DLL. The API function GetProcAddress(…) provides starting addresses for various DLL functions. In order to release DLLs at program end, call the function
FreeLibrary(...). For more information, please refer to the development environment’s User's Manual/Data Sheets or refer to the enclosed SDK source.
pciGrabber-4x4
86
PHYTEC Messtechnik GmbH 2008 L-720e_0
6.2.5 Application of the Windows XP/VISTATM Windows
NT4.0TM / Windows 2000TM DLLs
In order to use the DLL Gr4CDLL.DLL, the software developer must define a function pointer for each function that will be used in the application.
Example:
Function to be used: WORD Get_Error(void)
Definition of the function pointer:
WORD (PASCAL * lpfn_GetError)(void);
Use GetProcAddress(…) to obtain the relationship between the function pointer and the DLL.
Example:
lpfn_GetError = (WORD(PASCAL *)(void)) GetProcAddress(handle, „Get_Error“);
The function can now be called with:
WORD Errorstatus; ... Errorstatus = lpfn_GetError();
Caution:
Check the value of the function pointer (return value from GetProcAddress) to be sure that it = 0. A value of 0 ensures that the driver version installed on the user’s computer supports the functions and will return a valid handle.
Programming Manual
PHYTEC Messtechnik GmbH 2008 L-720e_0
87
Programming Manual
6.2.6 Programming under Delphi
In order to utilize the pciGrabber-4x4 with Borland Delphi for user applications, the driver-DLL with function export “GR4C
DLL.DLL“
should be employed.
To introduce the functions to the DLL in Delphi a corresponding Unit has to be defined. Please pay attention to the correct calling sequence, to guarantee the compatibility of the DLL. Define the functions with the type
stdcall
. In case of false declarations stack-overflows or ­underflows can occur, which will cause a violation against protected areas. In the following example a unit is defined:
unit grab4dll;
interface
{ The calling sequence 'stdcall' defines the sequence of the pa­rameter transfer to the stack and signals to Delphi that the called function frees the stack region, which was used for the pa­rameter }
function Grab4_Get_Error: word; stdcall; external 'gr4cdll.dll' name 'Get_Error';
function Grab4_Max_Device_Number: word;
stdcall; external 'gr4cdll.dll' name 'Max_Device_Number';
function Grab4_Data_Present(nDevNo: word): word; stdcall; external 'gr4cdll.dll' name 'Data_Present';
function Grab4_GetPictureBufferAddress(nDevNo: word; dwBitsSize: Cardinal): cardinal; stdcall; external 'gr4cdll.dll' name 'Data_Present';
procedure Grab4_Initialize(nDevNo: word); stdcall; external 'gr4cdll.dll' name 'Initialize';
procedure Grab4_Set_Channel(nDevNo, nChannel: word); stdcall; external 'gr4cdll.dll' name 'Set_Channel';
procedure Grab4_Start_Grabber(nDevNo: word); stdcall; external 'gr4cdll.dll' name 'Start_Grabber';
procedure Grab4_Stop_Grabber(nDevNo: word); stdcall; external 'gr4cdll.dll' name 'Stop_Grabber';
pciGrabber-4x4
88
PHYTEC Messtechnik GmbH 2008 L-720e_0
procedure Grab4_Set_Image(nDevNo: word; nOhpos, nOvpos, nOhsize, nOvsize, nOppl, nOlines, nOColformat :word; nEhpos, nEvpos, nEhsize, nEvsize, nEppl, nElines, nEColformat :word; nColsystem:word; nInterlaced:word; nSingleShot:word); stdcall; external 'gr4cdll.dll' name 'Set_Image';
const NTSC_M: word = 0; PAL_BDGHI: word = 1; SECAM: word = 2; PAL_M: word = 3; PAL_N: word = 4; AUTO: word = 5;
RGB32: word = 0; RGB24: word = 1; RGB16: word = 2; RGB15: word = 3; YUY2: word = 4; BtYUV: word = 5; Y8: word = 6; RGB8: word = 7;
implementation
{ DLL Functions }
end.
Programming Manual
PHYTEC Messtechnik GmbH 2008 L-720e_0
89
Programming Manual
6.2.7 Description of the DLL in Existing Functions
The user can control all of the events in the pciGrabber-4x4 using the functions of the DLL. The DLL can also read the actual status, as well as configured values. These functions are described in more detail further on in this manual.
The functions have been divided into five groups for easier discussion. The group number is shown in a black circle.
The functions are classified as follows:
Routines for Initialization / Calling up Hardware
This group includes routines that must be called one time prior to using the Grabber, to ensure that the Grabber functions properly. Also included are two functions that give information about the installed hardware and its capabilities.
Routines that configure the Grabber configures for the grabbing
process:
Functions from this group configure the Grabber to the connected image source (camera). These functions also determine the appearance of the grabbed picture as an end result in memory (image size, color format, etc) The user should determine whether each function is needed, and which parameters are necessary. These functions may be called-up several times during the processing of a program (i.e. when the input channel should be switched or if the image size should be changed).
Routines for Executing and Controlling the Grabbing Process
This function starts the image digitization, monitors the Grabbing process and ends digitization.
Routines for Configuring Image Parameters
Functions from this group enable configuration of parameters, such as brightness, contrast, saturation, etc. These functions are not necessary, but can be called at any time to adapt the final image to user needs.
pciGrabber-4x4
90
PHYTEC Messtechnik GmbH 2008 L-720e_0
Routines for Controlling the Option Port
This category includes functions that do not directly influence the grabbing process, but rather deal with the features of the Grabber, i.e. I/O port, I²C interface, etc. These functions need only to be called when a corresponding Grabber feature is implemented.
Important:
In all the following routines the parameter nDevNo is used. This parameter identifies the desired pciGrabber-4x4 rather decoder. The number of the installed pciGrabber-4/decoder can be determined by the function Max_Device_Number().
Programming Manual
PHYTEC Messtechnik GmbH 2008 L-720e_0
91
Programming Manual
Compatibility to the pciGrabber-4
The driver is basically downwards compatible. Programs for the pciGrabber-4, pciGrabber-4plus and pciGrabber-4 express works also with the pciGrabber-4x4. But pay attention, the forerunner work with an different kind of Option Port and the numbers and mapping of video inputs are different.
Functions that are not compatible with the older driver version for the pciGrabber-4 are denoted with a star ().
Please take note of the functions with a when adding new features from the pciGrabber-4x4 to existing applications.
Most functions are compatible with the pciGrabber-4, although some functions may not be used due to non-compliance with hardware requirements. In any case, the new driver version should be used with new applications.
pciGrabber-4x4
92
PHYTEC Messtechnik GmbH 2008 L-720e_0
Evaluation of the Error Messages
WORD Get_Error(void);
Returnvalue: 0 = no error 1 = device number not found 2 = bad register number 3 = initialization failed 4 = Grabber not found
5 = unknown parameter value 6 = not supported 7 = newer driver version required (update) 8 = no PHYTEC grabber card found 9 = no acknowledge 10 = invalid address 11 = write access denied
Each execution of a diver function should be checked if it was successful. For this purpose there is the function Get_Error. Immediately after the execution of the function, the internal error variable of the driver is set to the actual status.
This variable is available to the user program via the function Get_Error, so that a reaction to this error message can occur.
The investigation of the error variable is possible until a new execution of a driver function has occurred. Then the error status of the new function call is set.
Loading...