[go: up one dir, main page]

0% found this document useful (0 votes)
270 views32 pages

Technical Information Manual: 25 January 2010 Revision N. 3

The document is a technical manual for the CAENComm library, which provides a common interface for communicating with CAEN acquisition modules over various physical layers like USB, PCI, and VME. It summarizes the library functions and data types. The manual describes that CAEN will repair or replace defective products under warranty if not due to user error. It also notes that CAEN is not responsible for damages from improper use and that the manual contents may change without notice.

Uploaded by

elrhyso
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
270 views32 pages

Technical Information Manual: 25 January 2010 Revision N. 3

The document is a technical manual for the CAENComm library, which provides a common interface for communicating with CAEN acquisition modules over various physical layers like USB, PCI, and VME. It summarizes the library functions and data types. The manual describes that CAEN will repair or replace defective products under warranty if not due to user error. It also notes that CAEN is not responsible for damages from improper use and that the manual contents may change without notice.

Uploaded by

elrhyso
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 32

Technical Information Manual

Revision n. 3 25 January 2010

CAENComm LIBRARY DESCRIPTION

CAEN will repair or replace any product within the guarantee period if the Guarantor declares that the product is defective due to workmanship or materials and has not been caused by mishandling, negligence on behalf of the User, accident or any abnormal conditions or operations.

CAEN declines all responsibility for damages or injuries caused by an improper use of the Modules due to negligence on behalf of the User. It is strongly recommended to read thoroughly the CAEN User's Manual before any kind of operation.

CAEN reserves the right to change partially or entirely the contents of this Manual at any time and without giving any notice.

Document type: User's Manual (MUT)

Title: CAENcomm

Revision date: 25/01/2010

Revision: 3

TABLE OF CONTENTS
1. CAENCOMM OVERVIEW ...........................................................................................................................4 1.1. 2. SYSTEM REQUIREMENTS ..........................................................................................................................5

FUNCTION CLASSIFICATION....................................................................................................................6 2.1. CAENCOMM DATA TYPES ......................................................................................................................7 2.1.1. CAENComm_ConnectionType.......................................................................................................7 2.1.2. CAENComm_ErrorCode.................................................................................................................7 2.1.3. CAENCOMM_INFO ......................................................................................................................7 2.1.4. IRQ Levels.......................................................................................................................................7

3.

FUNCTION DESCRIPTIONS........................................................................................................................8 3.1. INITIALIZATION/TERMINATION FUNCTIONS ..............................................................................................8 3.1.1. CAENComm_OpenDevice..............................................................................................................8 3.1.2. CAENComm_CloseDevice .............................................................................................................9 3.1.3. Examples .......................................................................................................................................10 3.1.3.1. Example No.1 .......................................................................................................................10 3.1.3.2. Example No.2 .......................................................................................................................11 3.2. DATA TRANSFER FUNCTIONS ..................................................................................................................13 3.2.1. CAENComm_Write32 ..................................................................................................................13 3.2.2. CAENComm_Write16 ..................................................................................................................14 3.2.3. CAENComm_Read32 ...................................................................................................................15 3.2.4. CAENComm_Read16 ...................................................................................................................16 3.2.5. Multi read/write functions .............................................................................................................17 3.2.5.1. CAENComm_MultiRead32 ..................................................................................................17 3.2.5.2. CAENComm_MultiRead16 ..................................................................................................18 3.2.5.3. CAENComm_MultiWrite32..................................................................................................19 3.2.5.4. CAENComm_MultiWrite16..................................................................................................20 3.2.6. CAENComm_BLTRead................................................................................................................21 3.2.7. CAENComm_MBLTRead ............................................................................................................22 3.3. INTERRUPT HANDLING FUNCTIONS ........................................................................................................23 3.3.1. CAENComm_IRQDisable ............................................................................................................23 3.3.2. CAENComm_IRQEnable .............................................................................................................23 3.3.3. CAENComm_IRQWait.................................................................................................................24 3.3.4. CAENComm_IACKCycle ............................................................................................................25 3.3.5. CAENComm_VMEIRQWait ........................................................................................................26 3.3.6. CAENComm_VMEIRQCheck......................................................................................................27 3.3.7. CAENComm_ VMEIACKCycle16...............................................................................................28 3.3.8. CAENComm_ VMEIACKCycle32...............................................................................................29 3.3.9. Details and Examples ....................................................................................................................29 3.4. UTILITY FUNCTIONS ...............................................................................................................................31 3.4.1. CAENComm_Info.........................................................................................................................31 3.4.2. CAENComm_SWRelease .............................................................................................................32 3.4.3. CAENComm_ DecodeError..........................................................................................................32

LIST OF FIGURES
FIG. 1.1: HARDWARE AND SOFTWARE LAYERS.....................................................................................................5 FIG. 3.1: BLOCK DIAGRAM OF EXAMPLE NO.1 ....................................................................................................10 FIG. 3.2: BLOCK DIAGRAM OF EXAMPLE NO.2 ....................................................................................................11

Filename: CAENcomm_rev3.doc

Number of pages: 32

Page: 3

Document type: User's Manual (MUT)

Title: CAENcomm

Revision date: 25/01/2010

Revision: 3

1.

CAENComm overview
CAEN has developed a family of acquisition modules (ADC, TDC, etc ...) with different standards and formats (VME, NIM, Desktop and others). 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 supports the following channels of communication: 1. PC => USB => CAEN Front-end Modules with USB 2.0 interface: CAEN Waveform digitizers with USB (NIM/Desktop form factors) N957 8k Multi-Channel Analyzer 2. PC => USB => V1718 => VME => all CAEN VME Modules 3. PC => PCI (A2818) => CONET => CAEN Modules with Opt. link: Waveform digitizers (VME, NIM/Desktop form factors) SY2791 TPC Readout System 4. PC => PCI (A2818) => CONET => V2718 => VME => all CAEN VME Modules Conet (Chainable Optical NETwork) indicates the CAEN proprietary protocol for communication on Optical Link. A new type of PCIe communication card (A3818) with four optical links will soon replace or complement the PCI card A2818. It is possible to develop a software for one CAEN VME card (such as a digitizer) 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. interface

Filename: CAENcomm_rev3.doc

Number of pages: 32

Page: 4

Document type: User's Manual (MUT)

Title: CAENcomm

Revision date: 25/01/2010

Revision: 3

1.1.

System Requirements
CAENComm supports the following platforms: Windows 2003/XP/Vista or Linux kernel Rel. 2.4/2.6 with gnu C/C++ compiler LabView 8.2 professional (for LabVIEW VIs)

The hardware and software layers are reported in the following scheme:

Fig. 1.1: Hardware and Software layers

Filename: CAENcomm_rev3.doc

Number of pages: 32

Page: 5

Document type: User's Manual (MUT)

Title: CAENcomm

Revision date: 25/01/2010

Revision: 3

2. Function classification
CAENComm functions are divided into 4 groups: Device Initialization/Termination Functions CAENComm_OpenDevice CAENComm_CloseDevice Data Transfer Functions 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

Filename: CAENcomm_rev3.doc

Number of pages: 32

Page: 6

Document type: User's Manual (MUT)

Title: CAENcomm

Revision date: 25/01/2010

Revision: 3

2.1.

CAENComm Data Types


2.1.1. CAENComm_ConnectionType
Code CAENComm_USB CAENComm_PCI_OpticalLink CAENComm_PCIE_OpticalLink CAENComm_PCIE Value 0 1 2 3 Meaning Connected through USB Connected by opticalLink through PCI Card Connected by optical link through PCI Express Card Connected by PCI Card

2.1.2. 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 Value 0 -1 -2 -3 -4 -5 -6 -7 -8 -9 -10 -11 -12 -13 Meaning 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

2.1.3. CAENCOMM_INFO
Code CAENComm_PCI_Board_SN CAENComm_PCI_Board_FwRel CAENComm_VME_Bridge_SN CAENComm_VME_Bridge_FwRel1 CAENComm_VME_Bridge_FwRel2 Value 0 1 2 3 4 Meaning 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)

2.1.4. IRQ Levels


Level IRQ1 IRQ2 IRQ3 IRQ4 IRQ5 IRQ6 IRQ7 Value 0x01 0x02 0x04 0x08 0x10 0x20 0x40 Meaning Interrupt level 1 Interrupt level 2 Interrupt level 3 Interrupt level 4 Interrupt level 5 Interrupt level 6 Interrupt level 7

Filename: CAENcomm_rev3.doc

Number of pages: 32

Page: 7

Document type: User's Manual (MUT)

Title: CAENcomm

Revision date: 25/01/2010

Revision: 3

3. Function descriptions
3.1. 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 described in ) will take place according to its handle, thus making transparent the physical channel.

3.1.1. CAENComm_OpenDevice
Description This function allows to open the device Input Parameters Name LinkType Type CAENComm_ConnectionType Description LinkType: The link used by the device 0: CAENComm_USB 1: CAENComm_PCI_OpticalLink 2: CAENComm_PCIE_OpticalLink 3: CAENComm_PCIE LinkNum: when using OpticalLink, it is the optical link number to be used when using USB, it is the USB device number to be used ConetNode: for OpticalLink identify which device in the daisy-chain is addressed for USB must be 0. The VME base address of the board in case you want to access a VME device, 0 otherwise Description The handler to use for access to the device

LinkNum

Int

ConetNode

int

VMEBaseAddress

uint32_t

Output Parameters Name handle Return Type CAENComm_ErrorCode

Type int

Description 0: Success; Negative numbers are error codes see 2.1.2

Filename: CAENcomm_rev3.doc

Number of pages: 32

Page: 8

Document type: User's Manual (MUT)

Title: CAENcomm

Revision date: 25/01/2010

Revision: 3

C++ Representation CAENComm_ErrorCode CAENComm_OpenDevice( CAENComm_ConnectionType int int uint32_t VMEBaseAddress, int LinkType, LinkNum, ConetNode, *handle);

LabView Representation CAENComm_OpenDevice.vi

3.1.2. CAENComm_CloseDevice
Description

This function allows to close the device


Input Parameters Name Type Description

handle
Return Type CAENComm_ErrorCode

int

device handler

Description 0: Success; Negative numbers are error codes see 2.1.2

C++ Representation: CAENComm_ErrorCode LabView Representation CAENComm_CloseDevice.vi CAENComm_CloseDevice( int handle);

Filename: CAENcomm_rev3.doc

Number of pages: 32

Page: 9

Document type: User's Manual (MUT)

Title: CAENcomm

Revision date: 25/01/2010

Revision: 3

3.1.3. Examples 3.1.3.1. Example No.1

Fig. 3.1: Block diagram of example no.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_PCI_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_PCI_OpticalLink,

Filename: CAENcomm_rev3.doc

Number of pages: 32

Page: 10

Document type: User's Manual (MUT)

Title: CAENcomm

Revision date: 25/01/2010

Revision: 3

PCI board n. Device in chain VME Base address

0, 0, 0x40000000, &handleV1740);

Open the V1724 (first in daisy chain) directly accessed via Optical Link CAENComm_OpenDevice( Physical link CAENComm_PCI_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_PCI_OpticalLink, PCI board n. 1, Device in chain 1, not used 0, &handleV1731);

3.1.3.2.

Example No.2

Fig. 3.2: Block diagram of example no.2

Filename: CAENcomm_rev3.doc

Number of pages: 32

Page: 11

Document type: User's Manual (MUT)

Title: CAENcomm

Revision date: 25/01/2010

Revision: 3

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); 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_PCIE_OpticalLink, PCIE link n. 0, Device in chain 0, not used 0, &handleSY2792);

Filename: CAENcomm_rev3.doc

Number of pages: 32

Page: 12

Document type: User's Manual (MUT)

Title: CAENcomm

Revision date: 25/01/2010

Revision: 3

3.2.

Data transfer functions


3.2.1. CAENComm_Write32
Description

This function allows to write a 32 bit register of the device


Input Parameters Name handle Address Data Return Type CAENComm_ErrorCode Type int uint32_t uint32_t Description device handler register address offset new register content to write into the device

Description 0: Success; Negative numbers are error codes see 2.1.2

C++ Representation: CAENComm_ErrorCode CAENComm_Write32( int handle, uint32_t Address, uint32_t Data);

LabView Representation CAENComm_Write32.vi

Filename: CAENcomm_rev3.doc

Number of pages: 32

Page: 13

Document type: User's Manual (MUT)

Title: CAENcomm

Revision date: 25/01/2010

Revision: 3

3.2.2. CAENComm_Write16
Description

This function allows to write a 16 bit register of the device


Input Parameters Name handle Address Data Return Type CAENComm_ErrorCode Type int uint32_t Uint16_t Description device handler register address offset new register content to write into the device

Description 0: Success; Negative numbers are error codes see 2.1.2

C++ Representation: CAENComm_ErrorCode CAENComm_Write16( int handle, uint32_t Address, uint16_t Data);

LabView Representation CAENComm_Write16.vi

Filename: CAENcomm_rev3.doc

Number of pages: 32

Page: 14

Document type: User's Manual (MUT)

Title: CAENcomm

Revision date: 25/01/2010

Revision: 3

3.2.3. CAENComm_Read32
Description This function allows to read 32 bit register of the device Input Parameters Name handle Address Output Parameters Name Data Return Type CAENComm_ErrorCode Type int uint32_t Type uint32_t Description device handler register address offset Description The data read from the device

Description 0: Success; Negative numbers are error codes see 2.1.2

C++ Representation: CAENComm_ErrorCode CAENComm_Read32( int handle, uint32_t Address, uint32_t *Data);

LabView Representation CAENComm_Read32.vi

Filename: CAENcomm_rev3.doc

Number of pages: 32

Page: 15

Document type: User's Manual (MUT)

Title: CAENcomm

Revision date: 25/01/2010

Revision: 3

3.2.4. CAENComm_Read16
Description This function allows to read 16 bit register of the device Input Parameters Name handle Address Output Parameters Name Data Return Type CAENComm_ErrorCode Type int uint32_t Type Uint16_t Description device handler register address offset Description the data read from the device

Description 0: Success; Negative numbers are error codes see 2.1.2

C++ Representation: CAENComm_ErrorCode CAENComm_Read16( int handle, uint32_t Address, uint16_t *Data);

LabView Representation CAENComm_Read32.vi

Filename: CAENcomm_rev3.doc

Number of pages: 32

Page: 16

Document type: User's Manual (MUT)

Title: CAENcomm

Revision date: 25/01/2010

Revision: 3

3.2.5. 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 125s (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.

3.2.5.1.

CAENComm_MultiRead32

Description The function performs a sequence of single 32bit Read operation Input Parameters Name handle Address nCycle Output Parameters Name data ErrorCode Return Type CAENComm_ErrorCode Type int uint32_t [ ] int Type uint32_t [ ] CAENComm_ErrorCode Description device handler register address offsets the number of read to perform Description the data read from the device the error codes relative to each cycle

Description 0: Success; Negative numbers are error codes see 2.1.2

C++ Representation: CAENComm_ErrorCode CAENComm_MultiRead32( int uint32_t int uint32_t CAENComm_ErrorCode handle, *Address, nCycles, *data, *ErrorCode);

LabView Representation CAENComm_Read32.vi

Filename: CAENcomm_rev3.doc

Number of pages: 32

Page: 17

Document type: User's Manual (MUT)

Title: CAENcomm

Revision date: 25/01/2010

Revision: 3

3.2.5.2.

CAENComm_MultiRead16

Description The function performs a sequence of single 16 bit Read operation Input Parameters Name handle Address nCycles Output Parameters Name data ErrorCode Return Type CAENComm_ErrorCode Type int uint32_t [ ] int Type uint16_t [ ] CAENComm_ErrorCode Description device handler register address offsets the number of read to perform Description the data read from the device the error codes relative to each cycle

Description 0: Success; Negative numbers are error codes see 2.1.2

CAENComm_ErrorCode

CAENComm_MultiRead16( int uint32_t int uint16_t CAENComm_ErrorCode

handle, *Address, nCycles, *data, *ErrorCode);

LabView Representation CAENComm_Read16.vi

Filename: CAENcomm_rev3.doc

Number of pages: 32

Page: 18

Document type: User's Manual (MUT)

Title: CAENcomm

Revision date: 25/01/2010

Revision: 3

3.2.5.3.

CAENComm_MultiWrite32

Description The function performs a sequence of single 32 bit Write operation Input Parameters Name handle Address nCycles data Output Parameters Name ErrorCode Return Type CAENComm_ErrorCode Type int uint32_t [ ] int uint32_t [ ] Type CAENComm_ErrorCode Description device handler register address offsets the number of read to perform the data to write to the device Description The error codes relative to each cycle

Description 0: Success; Negative numbers are error codes see 2.1.2

C++ Representation: CAENComm_ErrorCode CAENComm_MultiWrite32( int uint32_t int uint32_t CAENComm_ErrorCode handle, *Address, nCycles, *data, *ErrorCode);

LabView Representation CAENComm_MultiWrite32.vi

Filename: CAENcomm_rev3.doc

Number of pages: 32

Page: 19

Document type: User's Manual (MUT)

Title: CAENcomm

Revision date: 25/01/2010

Revision: 3

3.2.5.4.

CAENComm_MultiWrite16

Description The function performs a sequence of single 16 bit Write operation Input Parameters Name handle Address nCycles data Output Parameters Name ErrorCode Return Type CAENComm_ErrorCode Type int uint32_t [ ] int Uint16_t [ ] Type CAENComm_ErrorCode Description device handler register address offsets the number of read to perform the data to write to the device Description The error codes relative to each cycle

Description 0: Success; Negative numbers are error codes see 2.1.2

C++ Representation: CAENComm_ErrorCode CAENComm_MultiWrite16( int uint32_t int uint16_t CAENComm_ErrorCode handle, *Address, nCycles, *data, *ErrorCode);

LabView Representation CAENComm_MultiWrite16.vi

Filename: CAENcomm_rev3.doc

Number of pages: 32

Page: 20

Document type: User's Manual (MUT)

Title: CAENcomm

Revision date: 25/01/2010

Revision: 3

3.2.6. CAENComm_BLTRead
Description This function allows to read a block of data from the device using a BLT (32 bit) cycle Input Parameters Name handle Address BltSize Output Parameters Name buff nw Return Type CAENComm_ErrorCode Type int uint32_t int Type uint32_t int Description device handler data space starting address size of the Block Read Cycle (in bytes) Description pointer to the read data buffer number of longwords (32 bit) actually read from the device

Description 0: Success; Negative numbers are error codes see 2.1.2

C++ Representation: CAENComm_ErrorCode CAENComm_BLTRead( int handle, uint32_t Address, uint32_t *Buff, int BltSize, int *nw);

LabView Representation CAENComm_BLTRead.vi

Filename: CAENcomm_rev3.doc

Number of pages: 32

Page: 21

Document type: User's Manual (MUT)

Title: CAENcomm

Revision date: 25/01/2010

Revision: 3

3.2.7. CAENComm_MBLTRead
Description This function allows to read a block of data from the device using an MBLT (64 bit) cycle Input Parameters Name handle Address BltSize Output Parameters Name buff nw Return Type CAENComm_ErrorCode Type int uint32_t int Type uint32_t int Description device handler data space starting address size of the Block Read Cycle (in bytes) Description pointer to the read data buffer number of longwords (32 bit) actually read from the device

Description 0: Success; Negative numbers are error codes see 2.1.2

C++ Representation: CAENComm_ErrorCode CAENComm_MBLTRead ( int handle, uint32_t Address, uint32_t *Buff, int BltSize, int *nw);

LabView Representation CAENComm_MBLTRead.vi

Filename: CAENcomm_rev3.doc

Number of pages: 32

Page: 22

Document type: User's Manual (MUT)

Title: CAENcomm

Revision date: 25/01/2010

Revision: 3

3.3.

Interrupt Handling Functions


3.3.1. CAENComm_IRQDisable
Description This function disables the IRQ lines Input Parameters Name handle Return Type CAENComm_ErrorCode Type int Description device handler

Description 0: Success; Negative numbers are error codes see 2.1.2

C++ Representation: CAENComm_ErrorCode LabView Representation CAENComm_MBLTRead.vi CAENComm_IRQDisable( int handle);

3.3.2. CAENComm_IRQEnable
Description This function enables the IRQ lines Input Parameters Name handle Return Type CAENComm_ErrorCode Type int Description device handler

Description 0: Success; Negative numbers are error codes see 2.1.2

C++ Representation: CAENComm_ErrorCode LabView Representation CAENComm_MBLTRead.vi CAENComm_IRQEnable( int handle);

Filename: CAENcomm_rev3.doc

Number of pages: 32

Page: 23

Document type: User's Manual (MUT)

Title: CAENcomm

Revision date: 25/01/2010

Revision: 3

3.3.3. CAENComm_IRQWait
Description The function waits the IRQ lines specified by Mask until one of them raise or timeout expires This function can be used ONLY on board NOT controlled by CAEN VME Bridges Input Parameters Name handle Timeout Return Type CAENComm_ErrorCode Type int uint32_t Description device handler timeout in milliseconds

Description 0: Success; Negative numbers are error codes see 2.1.2

C++ Representation: CAENComm_ErrorCode CAENComm_IRQWait( int handle, uint32_t Timeout);

LabView Representation CAENComm_IRQWait.vi

Filename: CAENcomm_rev3.doc

Number of pages: 32

Page: 24

Document type: User's Manual (MUT)

Title: CAENcomm

Revision date: 25/01/2010

Revision: 3

3.3.4. CAENComm_IACKCycle
Description The function performs an interrupt acknowledge cycle Input Parameters Name handle Level Output Parameters Name BoardID Return Type CAENComm_ErrorCode Type int
IRQLevels

Description device handler the IRQ level to acknowledge Description the Id of the Board that raised the interrupt

Type int

Description 0: Success; Negative numbers are error codes see 2.1.2

C++ Representation: CAENComm_ErrorCode CAENComm_IACKCycle( int handle, IRQLevels Level, int *BoardID);

LabView Representation CAENComm_IACKCycle.vi

Filename: CAENcomm_rev3.doc

Number of pages: 32

Page: 25

Document type: User's Manual (MUT)

Title: CAENcomm

Revision date: 25/01/2010

Revision: 3

3.3.5. CAENComm_VMEIRQWait
Description The function waits the IRQ until one of them raises or timeout expires Input Parameters Name LinkNum Type CAENComm_Connectio nType Description when using OpticalLink , 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_PCI_OpticalLink 2: CAENComm_PCIE_OpticalLink 3: CAENComm_PCIE the CAEN VME Bridge number in the link timeout in milliseconds Description the CAEN Bridge handle to use in VMEIRQCheck and VMEIACKCycle

LinkType

int

ConetNode Timeout: Output Parameters Name VMEHandle Return Type CAENComm_ErrorCode

int uint32_t Type int

Description 0: Success; Negative numbers are error codes see 2.1.2

C++ Representation: CAENComm_ErrorCode CAENComm_VMEIRQWait( CAENComm_ConnectionType int int uint32_t int LinkType, LinkNum, ConetNode, Timeout, *VMEHandle);

LabView Representation CAENComm_VMEIRQWait.vi

Filename: CAENcomm_rev3.doc

Number of pages: 32

Page: 26

Document type: User's Manual (MUT)

Title: CAENcomm

Revision date: 25/01/2010

Revision: 3

3.3.6. CAENComm_VMEIRQCheck
Description The function returns a bit mask indicating the active IRQ lines Input Parameters Name handle Output Parameters Name Mask Return Type CAENComm_ErrorCode Type int Type uint8_t Description device handler Description a bit-mask indicating the IRQ lines

Description 0: Success; Negative numbers are error codes see 2.1.2

C++ Representation: CAENComm_ErrorCode CAENComm_VMEIRQCheck( int VMEhandle, uint8_t *Mask);

LabView Representation CAENComm_VMEIRQCheck.vi

Filename: CAENcomm_rev3.doc

Number of pages: 32

Page: 27

Document type: User's Manual (MUT)

Title: CAENcomm

Revision date: 25/01/2010

Revision: 3

3.3.7. CAENComm_ VMEIACKCycle16


Description The function performs a 16 bit interrupt acknowledge cycle Input Parameters Name handle Level Output Parameters Name BoardID Return Type CAENComm_ErrorCode Type int
IRQLevels

Description device handler The IRQ level to acknowledge (see IRQLevels enum) Description the Id of the Board that read the interrupt

Type int

Description 0: Success; Negative numbers are error codes see 2.1.2

C++ Representation: CAENComm_ErrorCode CAENComm_VMEIACKCycle16( int VMEhandle, IRQLevels Level, int *BoardID);

LabView Representation CAENComm_VMEIACKCycle16.vi

Filename: CAENcomm_rev3.doc

Number of pages: 32

Page: 28

Document type: User's Manual (MUT)

Title: CAENcomm

Revision date: 25/01/2010

Revision: 3

3.3.8. CAENComm_ VMEIACKCycle32


Description The function performs a 32 bit interrupt acknowledge cycle Input Parameters Name handle Level Output Parameters Name BoardID Return Type CAENComm_ErrorCode Type int
IRQLevels

Description device handler The IRQ level to acknowledge (see IRQLevels enum) Description the Id of the Board that read the interrupt

Type int

Description 0: Success; Negative numbers are error codes see 2.1.2

C++ Representation: CAENComm_ErrorCode CAENComm_VMEIACKCycle32( int VMEhandle, IRQLevels Level, int *BoardID);

LabView Representation CAENComm_VMEIACKCycle32.vi

3.3.9. Details and Examples


The interrupts management foresees two cases: The device you want to broadcast the request is directly connected to the PC 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);
Filename: CAENcomm_rev3.doc Number of pages: 32 Page: 29

Document type: User's Manual (MUT)

Title: CAENcomm

Revision date: 25/01/2010

Revision: 3

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: Examples: ( For a setup like picture shown in 3.1.3.1 ) 1) In order to handle the IRQ of boards V1740 (BA 0x40000000) and V1724 (BA 0x32100000) IRQ manage for boards in 3.1.3.1 CAENComm_VMEIRQWait( Physical link CAENComm_PCI_OpticalLink, PCI board n. 0, Device in chain 0, IRQmask 0xff Timeout 5000, Handle of bridge that raises the IRQ &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);

Filename: CAENcomm_rev3.doc

Number of pages: 32

Page: 30

Document type: User's Manual (MUT)

Title: CAENcomm

Revision date: 25/01/2010

Revision: 3

3.4.

Utility Functions
3.4.1. CAENComm_Info
Description The function returns information about serial number or firmware release of the device Input Parameters Name handle info Output Parameters Name data Return Type CAENComm_ErrorCode Type int CAENCOMM_INFO Type char Description device handler The interested info (see 2.1.3) Description an array (user defined to 30 byte) with the requested info

Description 0: Success; Negative numbers are error codes see 2.1.2

C++ Representation: CAENComm_ErrorCode CAENComm_Info( int CAENCOMM_INFO char handle, info, *data);

LabView Representation CAENComm_Info.vi

Filename: CAENcomm_rev3.doc

Number of pages: 32

Page: 31

Document type: User's Manual (MUT)

Title: CAENcomm

Revision date: 25/01/2010

Revision: 3

3.4.2. CAENComm_SWRelease
Description The function returns the Software Release of the library Input Parameters Name SwRel: Return Type CAENComm_ErrorCode Type char Description the Software Release of the library

Description 0: Success; Negative numbers are error codes see 2.1.2

C++ Representation: CAENComm_ErrorCode LabView Representation CAENComm_SWRelease.vi CAENComm_SWRelease( char *SwRel);

3.4.3. CAENComm_ DecodeError


Description This function decodes the error code Input Parameters Name ErrCode Output Parameters Name ErrMsg Return Type CAENComm_ErrorCode Type int Type char Description The error code Description A string with the error message

Description 0: Success; Negative numbers are error codes see 2.1.2

C++ Representation: CAENComm_ErrorCode CAENComm_DecodeError( int ErrCode, char *ErrMsg);

LabView Representation CAENComm_DecodeError.vi

Filename: CAENcomm_rev3.doc

Number of pages: 32

Page: 32

You might also like