CAENComm User & Reference Manual UM1934 Rev.6

UM1934_CAENComm_User_Manual_rev.6

User Manual:

Open the PDF directly: View PDF PDF.
Page Count: 37

DownloadCAENComm User & Reference Manual UM1934 Rev.6
Open PDF In BrowserView PDF
CAEN
Tools for Discovery

n

Electronic Instrumentation

Rev. 0 -

C+
+

LabView

C/C++
Tools

User VME
DAQ

LabView
Tools

Applications
Libraries
CUSTOM
LIBRARY THAT
EXPORTS
CAENCOM
FUNCTIONS

CAEN COMM
user implemented

CAEN COMM Library

CAENVMElib

A3818
Driver

PCI

CAEN
PCI & PCIe
Controllers

A2818
Driver

PCIe

Software
Hardware

A3818

A2818

USB
Driver

CONET/CONET2 (Optical Link)

USB 2.0

CAEN VME
Waveform
Digitizers

CPU

VME
Module

CAEN
VME
Bridges

V2718

V17XX

VME
CAEN Catalog
Products

CAEN
NIM
Waveform
Digitizers

V1718

CAEN
Desktop
Waveform
Digitizers

UM1934
CAENComm User & Reference Manual
Rev. 6 - 15 Genuary 2014

Purpose of this User Manual
This User’s Manual contains the full description of the CAENComm library rel. 1.2 (Windows/Linux).

Change Document Record
Date

Revision
Changes
Previous releases of the document are not available
05
New graphical layout and added § 4
04
Removed “Preliminary”.
Modified CAEN_Comm_ConnectionType removing PCI/PCIE options
replaced with OpticalLink.
Added CAENComm_VMELIB_handle in CAENCOMM_INFO
Added message for developers in § System requirements &
installation setup

13 July 2012
15 Genuary 2014

Symbols, abbreviated terms and notation
ADC
DPP
OS
SBC
TDC

Analog to Digital Converter
Digital Pulse Processing
Operating System
Single Board Computer
Time to Digital Converter

Reference Document
Application Note: AN2472 - CONET1 to CONET2 migration
GD2512: CAENUpgrader QuickStart Guide
UM1935: CAENDigitizer User Manual

CAEN S.p.A.
Via Vetraia, 11 55049 Viareggio (LU) - ITALY
Tel. +39.0584.388.398 Fax +39.0584.388.959
info@caen.it
www.caen.it
© CAEN SpA – 2014
Disclaimer
No part of this manual may be reproduced in any form or by any means, electronic, mechanical, recording, or
otherwise, without the prior written permission of CAEN SpA.
The information contained herein has been carefully checked and is believed to be accurate; however, no responsibility
is assumed for inaccuracies. CAEN SpA reserves the right to modify its products specifications without giving any
notice; for up to date information please visit www.caen.it.

CAEN

Electronic Instrumentation

Index
........................................................................................................................ 2
........................................................................................................................... 2
.................................................................................................. 2
.................................................................................................................................... 2

........................................................................................................................................... 3
............................................................................................................................. 3
............................................................................................................................... 4
........................................................................................................ 5
.................................................................................................. 5

....................................................................................................... 8
............................................................................................................................... 9
...........................................................................................................................................9
......................................................................................................................................................9
...............................................................................................................................................................9
.............................................................................................................................................................................9

...................................................................................................... 10
.......................................................................................................... 10
.................................................................................................................................................10
.................................................................................................................................................11

.......................................................................................................... 12
.............................................................................................................................. 16
........................................................................................................................................................16
........................................................................................................................................................16
.........................................................................................................................................................17
.........................................................................................................................................................17

......................................................................................................................... 18
................................................................................................................................................18
................................................................................................................................................19
...............................................................................................................................................19
...............................................................................................................................................20
.......................................................................................................................................................20
...................................................................................................................................................21

.................................................................................................................... 22
...................................................................................................................................................22
....................................................................................................................................................22
........................................................................................................................................................23
....................................................................................................................................................23
................................................................................................................................................24
.............................................................................................................................................24
........................................................................................................................................25
........................................................................................................................................25

................................................................................................................................. 26
......................................................................................................................................... 27
...............................................................................................................................................................27
...................................................................................................................................................27
................................................................................................................................................28

................................................................................................................ 29
.................................................................................................. 30

List of Figures
..................................................................................................................................................6
...............................................................................................................................................12
...............................................................................................................................................14
............................................................................................................29

3

UM1934 – CAENComm User & Reference Manual

CAEN

Electronic Instrumentation
...................................................................................................................................30
...................................................................................................................................................31
................................................................................................................................................................32
......................................................................................................................................................................33
................................................................................................................................................................33
..........................................................................................................................................................................34
..........................................................................................................................................................................35

List of Tables
..............................................................................................................................................................5
.............................................................................................................................................................9
.................................................................................................................................................9
..............................................................................................................................................................9
.........................................................................................................................................................................9
.................................................................................29
...........................................................................................................................................32

UM1934 – CAENComm User & Reference Manual

4

CAEN

Electronic Instrumentation

1 CAENComm Overview
CAEN has developed a family of acquisition modules (ADC, TDC, etc.) with different standards and formats (VME, NIM
and Desktop). They all provide the possibility to be handled and readout by a host PC via several communication
channels. The purpose of the CAENComm library is to implement a common interface to the higher software layers,
masking the details of the physical channel and its protocol, thus making the libraries and applications that rely on the
CAENComm independent from the physical layer.
Moreover, the CAENComm is based in turn on CAENVMElib, a library developed specifically for USB-VME bridge (Mod
V1718) and PCI-VME (Mod V2718), which implements the basic functions for accessing the VME bus (besides other
specific functions for these bridge).
For this reason, it is necessary that the CAENVMELib is already installed on your PC before installing the CAENComm;
however, the CAENVMELib is completely transparent to the user..
Currently, the CAENComm (and so the CAENDigitizer) supports the following communication channels:


PC → USB → Digitizer (either Desktop or NIM models)



PC → USB → V1718 → VME → Digitizers (VME models only)



PC → PCI (A2818) → CONET → Digitizers (all models)



PC → PCI (A2818) → CONET → V2718 → VME → Digitizers (VME models only)



PC → PCIe (A3818) → CONET → Digitizers (all models)



PC → PCIe (A3818) → CONET → V2718 → VME → Digitizers (VME models only)

CONET (Chainable Optical NETwork) indicates the CAEN proprietary protocol for communication on Optical Link. Refer
to [RD1] for useful information.
It is possible to develop a software for one CAEN VME card with a bus controller different from those proposed by
CAEN (such as a VME-SBC); in this case it is necessary to provide a “CAENComm equivalent” library by exporting only
the functions used by the software.

System requirements & installation setup
OS

OS version

CAEN Library required

XP/Vista/7

Third-party software required

n/a
CAENVMELib

kernel Rel. 2.4/2.6
with gnu C/C++
compiler

n/a

Tab. 1.1: Host PC requirements

LabVIEW 2009 (only for LabVIEW VIs)

LabVIEW™ is a Trademark of National Instruments Corp.

5

UM1934 – CAENComm User & Reference Manual

CAEN

Electronic Instrumentation
The hardware and software layers are reported in the scheme below.
C+
+

C/C++
Tools

User VME
DAQ

LabView

LabView
Tools

Applications
Libraries
CUSTOM
LIBRARY THAT
EXPORTS
CAENCOM
FUNCTIONS

CAEN COMM
user implemented

CAEN COMM Library

CAENVMElib

A3818
Driver

CAEN
PCI & PCIe
Controllers

USB
Driver

PCI

PCIe

Software
Hardware

A2818
Driver

A3818

A2818

CONET/CONET2 (Optical Link)

USB 2.0

CAEN VME
Waveform
Digitizers

CPU

VME
Module

CAEN
VME
Bridges

V2718

V17XX

VME
CAEN Catalog
Products

CAEN
NIM
Waveform
Digitizers

V1718

CAEN
Desktop
Waveform
Digitizers

Fig. 1.1: Hardware and Software layers

UM1934 – CAENComm User & Reference Manual

6

CAEN

Electronic Instrumentation

In order to install the CAENComm library:





Go to CAEN web site in the “Download” area of the CAENComm page.



Download the CAENComm installation package related to your OS.



Extract files to your host.



Click on the red link below the library package and download the CAEN required libraries



Install the required CAENVMELib.



For Windows users: run the CAENDigitizer setup executable file and follow the installer instructions.



For Linux users: follow the instructions in the README file.

Note: Exclusively for Windows OS, the installation of CAENComm also includes a demo program version in Java
(Comm/java/Demo) and LabVIEW (Comm/labview/Basic Example Demo) described in Chapter 4.

Users who developed their own software relying on a CAENComm library version less
than

1.2,

if

they

want

to

upgrade

to

1.2,

they

have

to

modify

the

CAENComm_ConnectionType value accordingly to the new definition!

7

UM1934 – CAENComm User & Reference Manual

CAEN

Electronic Instrumentation

2 Function classification
CAENComm functions are divided into 4 groups:
 Device Initialization/Termination Functions
CAENComm_OpenDevice
CAENComm_CloseDevice
 Data Transfer Functions
CAENComm_Write32
CAENComm_Write16
CAENComm_Read32
CAENComm_Read16
CAENComm_MultiRead32
CAENComm_MultiRead16
CAENComm_MultiWrite16
CAENComm_MultiWrite32
CAENComm_BLTRead
CAENComm_MBLTRead
 Interrupt Handling Functions
CAENComm_IRQDisable
CAENComm_IRQEnable
CAENComm_IRQWait
CAENComm_IACKCycle
CAENComm_VMEIRQWait
 Information recovery functions
CAENComm_Info
CAENComm_SWRelease
CAENComm_DecodeError

UM1934 – CAENComm User & Reference Manual

8

CAEN

Electronic Instrumentation

CAENComm Data Types
CAENComm_ConnectionType
Code
CAENComm_USB
CAENComm_OpticalLink

Value
0
1

Description
Connected through USB
Connected by optical link

Value
0
-1
-2
-3
-4
-5
-6
-7
-8
-9
-10
-11
-12
-13

Description
Operation completed successfully
VME bus error during the cycle
Communication error
Unspecified error
Invalid parameter
Invalid Link Type
Invalid device handler
Communication Timeout
Unable to Open the requested Device
Maximum number of devices exceeded
The device is already opened
Not supported function
There aren't boards controlled by that Bridge
Communication terminated by the Device

Value
0
1
2
3
4

Description
s/n of the PCI/PCIe board
Firmware Release of the PCI/PCIe board
s/n of the VME bridge
Firmware Release for the VME bridge
Firmware Release for the optical chipset inside the VME
bridge (V2718 only)

Tab. 2.1: Connection Type table

CAENComm_ErrorCode
Error code
CAENComm_Success
CAENComm_VMEBusError
CAENComm_CommError
CAENComm_GenericError
CAENComm_InvalidParam
CAENComm_InvalidLinkType
CAENComm_InvalidHandler
CAENComm_CommTimeout
CAENComm_DeviceNotFound
CAENComm_MaxDevicesError
CAENComm_DeviceAlreadyOpen
CAENComm_NotSupported
CAENComm_UnusedBridge
CAENComm_Terminated
Tab. 2.2: CAENComm error codes table

CAENCOMM_INFO
Code
CAENComm_PCI_Board_SN
CAENComm_PCI_Board_FwRel
CAENComm_VME_Bridge_SN
CAENComm_VME_Bridge_FwRel1
CAENComm_VME_Bridge_FwRel2
CAENComm_VMELIB_handle

5

Tab. 2.3: CAENComm info table

IRQ Levels
Error code
IRQ1
IRQ2
IRQ3
IRQ4
IRQ5
IRQ6
IRQ7

Value
0x01
0x02
0x04
0x08
0x10
0x20
0x40

Description
Interrupt level 1
Interrupt level 2
Interrupt level 3
Interrupt level 4
Interrupt level 5
Interrupt level 6
Interrupt level 7

Tab. 2.4: IRQ levels table

9

UM1934 – CAENComm User & Reference Manual

CAEN

Electronic Instrumentation

3 Function descriptions
Initialization/termination functions
These functions allow to open and close the connection with a remote board.
To open one board is necessary to describe the 'logical' path from the PC to the device to access (one of the path
indicated in the introduction). This path is specified by the input parameters of the OpenDevice function. Once the
device is opened, the function returns a handle that becomes the unique identifier of that device; any access operation
to the device (except for VME cards IRQ management) will take place according to its handle, thus making transparent
the physical channel.

CAENComm_OpenDevice
Description
This function allows to open the device
Synopsis
CAENComm_ErrorCode CAENComm_OpenDevice(
CAENComm_ConnectionType LinkType,
int LinkNum,
int ConetNode,
uint32_t VMEBaseAddress,
int *handle
);

Arguments
Name
LinkType
LinkNum
ConetNode
VMEBaseAddress
*handle

Description
Indicates the link used by the device:
0: CAENComm_USB
1: CAENComm_OpticalLink
When using OpticalLink, it is the optical link number to be used.
When using USB, it is the USB device number to be used.
For OpticalLink, it identifies which device in the daisy-chain is addressed.
For USB, it must be 0.
The VME base address of the board in case you want to access a VME device, 0 otherwise.
Pointer to the handler returned by the open function, to be used for accessing the device

Return Values
0: Success; Negative numbers are error codes (see Tab. 2.2).
LabVIEW Representation
CAENComm_OpenDevice.vi

UM1934 – CAENComm User & Reference Manual

10

CAEN

Electronic Instrumentation

CAENComm_CloseDevice
Description
This function allows to close the device
Synopsis
CAENComm_ErrorCode CAENComm_CloseDevice(
int handle
);

Arguments
Name
handle

Description
The handler to use for accessing the device

Return Values
0: Success; Negative numbers are error codes (see Tab. 2.2).
LabVIEW Representation
CAENComm_CloseDevice.vi

11

UM1934 – CAENComm User & Reference Manual

CAEN

Electronic Instrumentation

Initialization/termination examples
Example N° 1

Fig. 3.1: Block diagram of example N° 1

The host PC houses two CAEN A2818; the VME crate houses the following boards:
a)

Bridge CAEN V2718 physically connected via optical links to the PCI card A2818 N° 0

b)
Two Digitizers CAEN (model V1724 with VME base address 0x32100000 and model V1740 with VME base
address 0x40000000)
c)
Two Digitizers CAEN (model V1724 and V1731 model) connected in a daisy chain between them and to the PCI
card A2818 N° 1
The open for the 4 cards to access are:
Open the V1724 (VME BASE ADDRESS 0x32100000) accessed via VMEbus through the V2718:
CAENComm_OpenDevice(
Physical link
CAENComm_OpticalLink,
PCI board n.
0,
Device in chain
0,
VME Base address
0x32100000,
&handleV1724_0
);

Open the V1740 (VME BASE ADDRESS 0x40000000) accessed via VMEbus through the V2718:
CAENComm_OpenDevice(
Physical link
CAENComm_OpticalLink,
PCI board n.
0,
Device in chain
0,
VME Base address
0x40000000,
&handleV1740
);

UM1934 – CAENComm User & Reference Manual

12

CAEN

Electronic Instrumentation

Open the V1724 (first in daisy chain) directly accessed via Optical Link:
CAENComm_OpenDevice(
Physical link
CAENComm_OpticalLink,
PCI board n.
1,
Device in chain
0,
not used
0,
&handleV1724_1
);

Open the V1731 (second in daisy chain) directly accessed via Optical Link:
CAENComm_OpenDevice(
Physical link
CAENComm_OpticalLink,
PCI board n.
1,
Device in chain
1,
not used
0,
&handleV1731
);

13

UM1934 – CAENComm User & Reference Manual

CAEN

Electronic Instrumentation
Example N° 2

Fig. 3.2: Block diagram of example N° 2

Host PC houses two USB ports and a A3818 card; it is connected to three crates, respectively VME, NIM and Sy2791,
housing the following boards:
a)

VME Crate

- Bridge CAEN V1718 physically connected to the PC via USB cable
- Digitizer model V1724 with VME base address 0x12340000
b)

NIM Crate

- Multi Channel Analyzer model N957 physically connected to the PC via USB cable
c)

Crate SY2791

- Model A2792 Acquisition module physically connected via optical links to the PCI Express A3818
The open for the 3 cards to access are:
Open the V1724 accessed from VMEbus through V1718:
CAENComm_OpenDevice(
Physical link
CAENComm_USB,
USB link n.
0,
not used
0,
VME Baseaddress
0x12340000,
&handleV1724
);

UM1934 – CAENComm User & Reference Manual

14

CAEN

Electronic Instrumentation

Open the N957 connected via USB cable:
CAENComm_OpenDevice(
Physical link
CAENComm_USB,
USB link n.
1,
not used
0,
not used
0,
&handleN957
);

Open the SY2792 connected via Optical Link
CAENComm_OpenDevice(
Physical link
CAENComm_OpticalLink,
PCIE link n.
0,
Device in chain
0,
not used
0,
&handleSY2792
);

15

UM1934 – CAENComm User & Reference Manual

CAEN

Electronic Instrumentation

Data transfer functions
CAENComm_Write32
Description
This function allows to write a 32 bit register of the device
Synopsis
CAENComm_ErrorCode CAENComm_Write32(
int handle,
uint32_t Address,
uint32_t Data
);

Arguments
Name
handle
Address
Data

Description
Device handler
Register address offset
New register content to write into the device

Return Values
0: Success; Negative numbers are error codes (see Tab. 2.2).
LabVIEW Representation
CAENComm_Write32.vi

CAENComm_Write16
Description
This function allows to write a 16 bit register of the device.
Synopsis
CAENComm_ErrorCode CAENComm_Write16(
int handle,
uint32_t Address,
uint16_t Data
);

Arguments
Name
handle
Address
Data

Description
Device handler
Register address offset
New register content to write into the device

Return Values
0: Success; Negative numbers are error codes (see Tab. 2.2).
LabVIEW Representation
CAENComm_Write16.vi

UM1934 – CAENComm User & Reference Manual

16

CAEN

Electronic Instrumentation

CAENComm_Read32
Description
This function allows to read 32 bit register of the device.
Synopsis
CAENComm_ErrorCode CAENComm_Read32(
int handle,
uint32_t Address,
uint32_t *Data
);

Arguments
Name
handle
Address
Data

Description
Device handler
Register address offset
The data read from the device

Return Values
0: Success; Negative numbers are error codes (see Tab. 2.2).
LabVIEW Representation
CAENComm_Read32.vi

CAENComm_Read16
Description
This function allows to read 16 bit register of the device
Synopsis
CAENComm_ErrorCode CAENComm_Read16(
int handle,
uint32_t Address,
uint16_t *Data
);

Arguments
Name
handle
Address
Data

Description
Device handler
Register address offset
The data read from the device

Return Values
0: Success; Negative numbers are error codes (see Tab. 2.2).
LabVIEW Representation
CAENComm_Read32.vi

17

UM1934 – CAENComm User & Reference Manual

CAEN

Electronic Instrumentation

Multi read/write functions
MultiRead and MultiWrite Functions have been developed to optimize the time in the individual accesses. In fact, both
the USB in the Conet (Optical Link) foresee the exchange of request and response packets for the execution of a single
read or write cycle. Because of the latency due to physical channel and protocol, the overhead of the protocol (package
management) is very heavy when compared to the amount of data transferred (a 16 or 32 bit word), thus making
communication ineffective. This overhead is particularly onerous in the case of the USB protocol which foresees a
scheduling of the communication frames that are repeated at fixed intervals of 1ms (USB 1.1) or 125µs (USB 2.0). The
purpose of MultiRead and MultiWrite is to place the requests in a single packet transmission from the PC to the device
and then receive back the responses in a single package, thereby reducing the impact of latency on the single access.
NOTE: MultiRead and MultiWrite foresee an implementation at physical channel level. If a VME CAEN controller is not
used, these libraries must be exported through a loop at software level running a series of individual accesses.

CAENComm_MultiRead32
Description
The function performs a sequence of single 32bit Read operation
Synopsis
CAENComm_ErrorCode CAENComm_MultiRead32(
int handle,
uint32_t *Address,
int nCycles,
uint32_t *data,
CAENComm_ErrorCode *ErrorCode
);

Arguments
Name
handle
Address
nCycle
data
ErrorCode

Description
Device handler
Degister address offsets
The number of Read to perform
The data read from the device
The error codes relative to each cycle

Return Values
0: Success; Negative numbers are error codes (see Tab. 2.2).
LabView Representation
CAENComm_MultiRead32.vi

UM1934 – CAENComm User & Reference Manual

18

CAEN

Electronic Instrumentation

CAENComm_MultiRead16
Description
The function performs a sequence of single 16 bit Read operation.
Synopsis
CAENComm_ErrorCode CAENComm_MultiRead16(
int handle,
uint32_t *Address,
int nCycles,
uint16_t *data,
CAENComm_ErrorCode *ErrorCode
);

Arguments
Name
handle
Address
nCycle
data
ErrorCode

Description
Device handler
Degister address offsets
The number of Read to perform
The data read from the device
The error codes relative to each cycle

Return Values
0: Success; Negative numbers are error codes (see Tab. 2.2).
LabView Representation
CAENComm_MultiRead16.vi

CAENComm_MultiWrite32
Description
The function performs a sequence of single 32 bit Write operation.
Synopsis
CAENComm_ErrorCode CAENComm_MultiWrite32(
int handle,
uint32_t *Address,
int nCycles,
uint32_t *data,
CAENComm_ErrorCode *ErrorCode
);

Arguments
Name
handle
Address
nCycle
data
ErrorCode

Description
Device handler
Degister address offsets
The number of Write to perform
The data to write to the device
The error codes relative to each cycle

Return Values
0: Success; Negative numbers are error codes (see Tab. 2.2).
LabView Representation
CAENComm_MultiWrite32.vi

19

UM1934 – CAENComm User & Reference Manual

CAEN

Electronic Instrumentation

CAENComm_MultiWrite16
Description
The function performs a sequence of single 16 bit Write operation.
Synopsis
CAENComm_ErrorCode CAENComm_MultiWrite16(
int handle,
uint32_t *Address,
int nCycles,
uint16_t *data,
CAENComm_ErrorCode *ErrorCode
);

Arguments
Name
handle
Address
nCycle
data
ErrorCode

Description
Device handler
Degister address offsets
The number of Write to perform
The data to write to the device
The error codes relative to each cycle

Return Values
0: Success; Negative numbers are error codes (see Tab. 2.2).
LabView Representation
CAENComm_MultiWrite16.vi

CAENComm_BLTRead
Description
This function allows to read a block of data from the device using a BLT (32 bit) cycle.
Synopsis
CAENComm_ErrorCode CAENComm_BLTRead(
int handle,
uint32_t Address,
uint32_t *Buff,
int BltSize,
int *nw
);

Arguments
Name
handle
Address
BltSize
buff
nw

Description
Device handler
Data space starting address
Size of the Block Read Cycle (in bytes)
Pointer to the read data buffer
Number of longwords (32 bit) actually read from the device

Return Values
0: Success; Negative numbers are error codes (see Tab. 2.2).
LabView Representation
CAENComm_BLTRead.vi

UM1934 – CAENComm User & Reference Manual

20

CAEN

Electronic Instrumentation

CAENComm_MBLTRead
Description
This function allows to read a block of data from the device using an MBLT (64 bit) cycle.
Synopsis
CAENComm_ErrorCode CAENComm_MBLTRead (
int handle,
uint32_t Address,
uint32_t *Buff,
int BltSize,
int *nw
);

Arguments
Name
handle
Address
BltSize
buff
nw

Description
Device handler
Data space starting address
Size of the Block Read Cycle (in bytes)
Pointer to the read data buffer
Number of longwords (32 bit) actually read from the device

Return Values
0: Success; Negative numbers are error codes (see Tab. 2.2).
LabView Representation
CAENComm_MBLTRead.vi

21

UM1934 – CAENComm User & Reference Manual

CAEN

Electronic Instrumentation

Interrupt Handling Functions
CAENComm_IRQDisable
Description
This function disables the IRQ lines.
Synopsis
CAENComm_ErrorCode CAENComm_IRQDisable(
int handle
);

Arguments
Name
handle

Description
Device handler

Return Values
0: Success; Negative numbers are error codes (see Tab. 2.2).
LabView Representation
CAENComm_IRQDisable.vi

CAENComm_IRQEnable
Description
This function enables the IRQ lines.
Synopsis
CAENComm_ErrorCode CAENComm_IRQEnable(
int handle
);

Arguments
Name
handle

Description
Device handler

Return Values
0: Success; Negative numbers are error codes (see Tab. 2.2).
LabView Representation
CAENComm_IRQEnable.vi

UM1934 – CAENComm User & Reference Manual

22

CAEN

Electronic Instrumentation

CAENComm_IRQWait
Description
The function waits the IRQ lines specified by Mask until one of them raise or timeout expires.



Note: This function can be used ONLY on board NOT controlled by CAEN VME Bridges.
Synopsis
CAENComm_ErrorCode CAENComm_IRQWait(
int handle,
uint32_t Timeout
);

Arguments
Name
handle
Timeout

Description
Device handler
Timeout in milliseconds

Return Values
0: Success; Negative numbers are error codes (see Tab. 2.2).
LabView Representation
CAENComm_IRQWait.vi

CAENComm_IACKCycle
Description
The function performs an interrupt acknowledge cycle.
Synopsis
CAENComm_ErrorCode CAENComm_IACKCycle(
int handle,
IRQLevels Level,
int *BoardID
);

Arguments
Name
handle
Level
BoardID

Description
Device handler
The IRQ level to acknowledge
The ID of the Board that raised the interrupt

Return Values
0: Success; Negative numbers are error codes (see Tab. 2.2).
LabView Representation
CAENComm_IACKCycle.vi

23

UM1934 – CAENComm User & Reference Manual

CAEN

Electronic Instrumentation

CAENComm_VMEIRQWait
Description
The function waits the IRQ until one of them raises or timeout expires.
Synopsis
CAENComm_ErrorCode CAENComm_VMEIRQWait(
CAENComm_ConnectionType LinkType,
int LinkNum,
int ConetNode,
uint8_t IRQMask
uint32_t Timeout,
int *VMEHandle
);

Arguments
Name
LinkNum
LinkType

ConetNode
IRQMask
Timeout
VMEHandle

Description
When using Optical Link , it is the optical link number to be used
When using USB, it is the USB device number to be used
LinkType: The link used by the device
0: CAENComm_USB
1: CAENComm_OpticalLink
The CAEN VME Bridge number in the link
A bit-mask indicating the IRQ lines
Timeout in milliseconds
The CAEN Bridge handle to use in VMEIRQCheck and VMEIACKCycle

Return Values
0: Success; Negative numbers are error codes (see Tab. 2.2).
LabView Representation
CAENComm_VMEIRQWait.vi

CAENComm_VMEIRQCheck
Description
The function returns a bit mask indicating the active IRQ lines.
Synopsis
CAENComm_ErrorCode CAENComm_VMEIRQCheck(
int VMEhandle,
uint8_t *Mask
);

Arguments
Name
VMEhandle
Mask

Description
CAEN Brigde handle
A bit-mask indicating the IRQ lines

Return Values
0: Success; Negative numbers are error codes (see Tab. 2.2).
LabView Representation
CAENComm_VMEIRQCheck.vi

UM1934 – CAENComm User & Reference Manual

24

CAEN

Electronic Instrumentation

CAENComm_VMEIACKCycle16
Description
The function performs a 16 bit interrupt acknowledge cycle
Synopsis
CAENComm_ErrorCode CAENComm_VMEIACKCycle16(
int VMEhandle,
IRQLevels Level,
int *BoardID
);

Arguments
Name
VMEhandle
Level
BoardID

Description
CAEN Brigde handle
The IRQ level to acknowledge (see IRQLevels enum)
The Id of the Board that read the interrupt

Return Values
0: Success; Negative numbers are error codes (see Tab. 2.2).
LabView Representation
CAENComm_VMEIACKCycle16.vi

CAENComm_VMEIACKCycle32
Description
The function performs a 32 bit interrupt acknowledge cycle
Synopsis
CAENComm_ErrorCode CAENComm_VMEIACKCycle16(
int VMEhandle,
IRQLevels Level,
int *BoardID
);

Arguments
Name
VMEhandle
Level
BoardID

Description
CAEN Brigde handle
The IRQ level to acknowledge (see IRQLevels enum)
The Id of the Board that read the interrupt

Return Values
0: Success; Negative numbers are error codes (see Tab. 2.2).
LabView Representation
CAENComm_VMEIACKCycle32.vi

25

UM1934 – CAENComm User & Reference Manual

CAEN

Electronic Instrumentation

Details and Examples
The interrupts management foresees two cases:
1.

The device you want to broadcast the request is directly connected to the PC

2.

The device you want to broadcast the request is accessed via bridge (only with VME)

If a device is directly connected to the optical link or USB the IRQ wait is managed by the funtion:
CAENComm_IRQWait(
int handle,
uint32_t Timeout
);

The function wait the IRQ until one of them raise or timeout expires.
If a device is accessed via VMEbus through the CAEN Bridge the IRQ wait is managed by the function:
CAENComm_VMEIRQWait(
int LinkType,
int LinkNum,
int ConetNode,
uint32_t Timeout,
int *VMEHandle
);

The function waits either until the bridge that manages the VME boards (specified by the function parameters) raises
an IRQ or the timeout to expire.
As this function returns an VMEHandle, in order to acknowledge which board raised the IRQ, it is necessary to use the
function CAENComm_VMEIRQCheck.
EXAMPLES (for a setup like the picture shown in Fig. 3.1):
1) In order to handle the IRQ of boards V1740 (BA 0x40000000) and V1724 (BA 0x32100000).
IRQ manage for boards in Fig. 3.1:
CAENComm_VMEIRQWait(
Physical link
PCI board n.
Device in chain
IRQmask
Timeout
Handle of bridge that raises the IRQ
);

CAENComm_OpticalLink,
0,
0,
0xff,
5000,
&VMEHandle

Then CAENComm_VMEIRQCheck and / or CAENComm_VMEIACKCycle32 can be used to acknowledge the activated IRQ
Level.
2) In order to handle the IRQ of boards connected to the A2818#1:
CAENComm_IRQWait(
handleV1724_1,
Timeout 5000
);

And
CAENComm_IRQWait(
handleV1731,
Timeout 5000
);

UM1934 – CAENComm User & Reference Manual

26

CAEN

Electronic Instrumentation

Utility Functions
CAENComm_Info
Description
The function returns information about serial number or firmware release of the device.
Synopsis
CAENComm_ErrorCode CAENComm_Info(
int handle,
CAENCOMM_INFO info,
char *data
);

Arguments
Name
handle
info
data

Description
Device handler
The interested info (see CAENCOMM_INFO)
An array (user defined to 30 byte) with the requested info

Return Values
0: Success; Negative numbers are error codes (see Tab. 2.2).
LabView Representation
CAENComm_Info.vi

CAENComm_SWRelease
Description
The function returns the Software Release of the library.
Synopsis
CAENComm_ErrorCode CAENComm_SWRelease(
char *SwRel
);

Arguments
Name
SwRel

Description
The Software Release of the library

Return Values
0: Success; Negative numbers are error codes (see Tab. 2.2).
LabView Representation
CAENComm_SWRelease.vi

27

UM1934 – CAENComm User & Reference Manual

CAEN

Electronic Instrumentation

CAENComm_DecodeError
Description
This function decodes the error code.
Synopsis
CAENComm_ErrorCode CAENComm_DecodeError(
int ErrCode,
char *ErrMsg
);

Arguments
Name
ErrCode
ErrMsg

Description
The error code
A string with the error message

Return Values
0: Success; Negative numbers are error codes (see Tab. 2.2).
LabView Representation
CAENComm_DecodeError.vi

UM1934 – CAENComm User & Reference Manual

28

CAEN

Electronic Instrumentation

4 Demo programs
Once installed the CAENComm tool, two demo programs are available for a first approach to the library, provided both
as graphical user interfaces ready to use and as source files and projects for the user development:
 Java demo (Comm/java/Demo)
 LabVIEW demo (Comm/labview/Basic Example Demo)

Fig. 4.1: Folder path of the two CAENComm demo programs.

The following table shows the system and software requirements needed by the demos.
OS

OS version

XP/Vista/7
(32 and 64-bit)

CAEN Library required

Third-party software required

Java(1) Runtime Environment 6
or later. You can download
from http://www.java.com

CAENVMELib

LabVIEW 2009(2)
Tab. 4.1: System and software requirements for CAENComm demo programs
(1)

Java™ is a registered trademark of Oracle, Inc.

(2)

LabVIEW™ is a Trademark of National Instruments Corp.

The CAENComm demos can be used with all the CAEN digitizer series running both the standard and the DPP firmware.

29

UM1934 – CAENComm User & Reference Manual

CAEN

Electronic Instrumentation

Getting started with CAENComm demos

Fig. 4.2: CAENComm Java and LabVIEW demos

This paragraph describes how to use the functions of the CAENComm library implemented in the demos. The Java
version is taken as reference; the LabVIEW version is exactly the same.
All the following steps have been executed on a CAEN desktop digitizer DT5724 running the DPP-PHA firmware with
the Optical Link (CONET2) as communication channel (through the A3818 PCIe CAEN Controller).

UM1934 – CAENComm User & Reference Manual

30

CAEN

Electronic Instrumentation

Demo structure

Fig. 4.3: CAENComm demo structure

Control and Info buttons: connection/disconnection handling, target FW
revision information, log window clearing.

Write/Read section: target registers read and write mode management

MBLT section: target board Multi BLock Transfer read mode function

Log window: run time log of the actions being performed

31

UM1934 – CAENComm User & Reference Manual

CAEN

Electronic Instrumentation
Launch the demo
For the Java version: launch the CAENCommDemo.jar file in the CAEN/ Comm/java/Demo path.
For the LabVIEW version: launch the Basic Example Demo.vi file in the CAEN/ Comm/labview/Basic Example Demo
path.
Fig. 4.2 shows the GUI and VI being opened.

Control and Info buttons
 The Connect function is based on CAENComm_OpenDevice:
Click on the CONNECT button and select the proper connection parameters in the connection window.

Fig. 4.4: Connection funtcion

Read in the Log window the result of the connection: “Connected” if succeded; an error message in case of failure
(refer to CAENComm_ErrorCode).
Here below several connection cases and the relative settings are shown as reference.
Connection chain
PC –> USB –> Desktop digitizer
PC –> USB –> V1718 –> VME –> VME digitizer
PC –> PCI –> A2818 –> CONET –> NIM digitizer
PC –> PCI –> A2818 –> CONET –> VME digitizer
PC –> PCI –> A2818 –> CONET –> VME digitizer **
PC -> PCIe -> A3818 -> CONET -> Desktop/NIM digitizer
PC –> USB –> Desktop digitizer***

Type
USB
USB
Optical Link
Optical Link
Optical Link
Optical Link
USB

Link
0
0
0
0
0
0
1

Slave
0
0
0
0
1
0
0

Address
0
21110000*
0
33210000*
0
0
0

Tab. 4.2: Examples of connection settings
* For the correct VME base address to be used, please refer to the Digitizer’s User Manual.
** The VME Digitizer is intended to be part of a Daisy chain (see the examples at the end of [RD2])
*** It is supposed that at least two USB ports are used by the PC to communicate with as many digitizers (see the examples at the end
of [RD3]).

UM1934 – CAENComm User & Reference Manual

32

CAEN


Electronic Instrumentation

The Get Info function implements a single read access to the ROC FPGA register of the target board, basing on
CAENComm_Read32:

Click on the GET INFO button to read the ROC FPGA firmware release in the Log window.

Fig. 4.5: Get Info function



The Disconnect function is based on CAENComm_CloseDevice:

Click on the DISCONNECT button to get disconnected from the target (disconnection is confirmed by the
“Disconnected” message in the Log window)

Fig. 4.6: Disconnect function



The Clear Log is a software utility and doesn’t base on any CAENComm function:

Click on the CLEAR LOG button to clear the Log window.

33

UM1934 – CAENComm User & Reference Manual

CAEN

Electronic Instrumentation
Read/Write target board registers


The Read function is based on CAENComm_Read16 and CAENComm_Read32, allowing a 16-bit and 32-bit
single read of the target board registers.

In order to read the content of a register:
Type the register address (the low 16 bits of the 32-bit address) in the ADDRESS field (in Fig. 4.7 the 108C address is
the AMC FPGA firmware release register).
Select the read access size (32 or 16 bit) in the SIZE field.
Click on the READ button.
Read the value of the register in the VALUE field.

Fig. 4.7: Read function

Refer to the digitizer User Manual to decode the register information.

UM1934 – CAENComm User & Reference Manual

34

CAEN


Electronic Instrumentation

The Write function is based on CAENComm_Write16 and CAENComm_Write32, allowing a 16-bit and 32-bit
single write of the target board registers.

In order to write a register:
Type the register address (the low 16 bits of the 32-bit address) in the ADDRESS field (in Fig. 4.8 the 8100 address is
the Acquisition Control register and the written value enable the acquisition run; refer the the digitizer User Manual for
details).
Type the value (hexadecimal) to write in the VALUE field.
Select the write access size (32 or 16 bit) in the SIZE field.
Click on the WRITE button (a further read of the same register can be performed to check the correct writing).

Fig. 4.8: Write function

35

UM1934 – CAENComm User & Reference Manual

CAEN

Electronic Instrumentation
Perform a MBLT Read
The MBLT Read function is based on CAENComm_MBLTRead, which allows to read a block of data from the targert
board using an MBLT (64 bit) cycle.
Here follows a simple example of how to perform a MBLT read:
Use the Write function to enable the acquisition run (i.e. write ‘4’ at the adress 8100).
Use the Write function to send a software trigger to the target board (i.e. write any value at the address 8108).
Type the data space starting address in the ADDRESS field (default value is “0”).
Read data in the Log window.

For details about the data format, please refer to the digitizer User Manual (if running the standard firmware) or to the
DPP firmware User Manual (if running the DPP firmware).

UM1934 – CAENComm User & Reference Manual

36

CAEN
Tools for Discovery

n

Electronic Instrumentation

CAEN SpA is acknowledged as the only company in the world providing a complete range of High/Low Voltage Power
Supply systems and Front-End/Data Acquisition modules which meet IEEE Standards for Nuclear and Particle Physics.
Extensive Research and Development capabilities have allowed CAEN SpA to play an important, long term role in this field.
Our activities have always been at the forefront of technology, thanks to years of intensive collaborations with the most
important Research Centres of the world. Our products appeal to a wide range of customers including engineers, scientists
and technical professionals who all trust them to help achieve their goals faster and more effectively.

CAEN
Tools for Discovery

CAEN S.p.A.

CAEN GmbH

CAEN Technologies, Inc.

Via Vetraia, 11

Klingenstraße 108

1140 Bay Street - Suite 2 C

55049 Viareggio
Italy
Tel. +39.0584.388.398
Fax +39.0584.388.959
info@caen.it
www.caen.it

D-42651 Solingen
Germany
Tel. +49 (0)212 254 4077
Mobile +49 (0)151 16 548 484
Fax +49 (0)212 25 44079
info@caen-de.com
www.caen-de.com

Staten Island, NY 10305
USA
Tel. +1.718.981.0401
Fax +1.718.556.9185
info@caentechnologies.com
www.caentechnologies.com

Electronic Instrumentation

Guide GD1934 - CAENComm User & Reference Manual rev. 5 - 13 July 2012
00118-10-DGT11-MUTX
Copyright © CAEN SpA. All rights reserved. Information in this publication supersedes all earlier versions. Specifications subject to change without notice.

37

UM1934 – CAENComm User & Reference Manual



Source Exif Data:
File Type                       : PDF
File Type Extension             : pdf
MIME Type                       : application/pdf
PDF Version                     : 1.5
Linearized                      : No
Page Count                      : 37
Language                        : it-IT
Tagged PDF                      : Yes
Title                           : CAENComm User & Reference Manual
Author                          : Guido Esposito, Pierluigi Barba
Subject                         : 00118-10-DGT11-MUTX
Creator                         : Microsoft® Word 2010
Create Date                     : 2014:12:19 11:18:02+01:00
Modify Date                     : 2014:12:19 11:18:02+01:00
Producer                        : Microsoft® Word 2010
EXIF Metadata provided by EXIF.tools

Navigation menu