Home

CC-USB User Manual

image

Contents

1. WIENER Plein amp Baus GmbH 12 www wiener d com Werk Rir Industrie elekvonde WIENER j ah 5 efkronik Plein amp Baus Elektronil Regeln technik To upgrade switch the firmware selector to one of the 4 firmware programming positions P1 P4 The red Failure LED will be on Start the XXUSBWin program which will show the following error message Select Yes or go to the Flash ROM Operations page and click program Open the file of the latest firmware xxx bit Look in E firmware aae Name Size Type Date Modified v E vmeusb_0603 bit 208KB BIT File 5 8 2006 11 10 AM iccusb_0204 bit 128KB BITFile 5 3 2006 12 08 AM E vmeusb_0602 bit 208KB BIT File 4 23 2006 12 24 AM E ccusb_0202 bit 128KB BIT File 4 23 2006 12 23 AM E ccusb_0201 bit 128KB BIT File 4 18 2006 2 26 PM E vmeslave_top bit 208KB BIT File 3 31 2006 4 46 PM E vmeusb_0601_0 208KB BITFile 3 21 2006 4 10 PM E vmeusb_0601_0 208KB BITFile 3 21 2006 4 10 PM E vmeusb_O601 bit 208KB BITFile 3 15 2006 11 26 AM E vmusb_0502 bit 208 KB BIT File 12 19 2005 5 30 PM E vmeusb_0501 bit 208KB BIT File 11 21 2005 6 31 PM E vmeusb_0405 bit 208KB BIT File 9 28 2005 8 49 AM E ccusb_o 101 bit 128KB BIT File 9 26 2005 9 52 AM A mn ibe ADA bid ane vp DT Eia Ais ian 1 nE ana File name Iccusb_0204 bit v My Network Files of type FPGA Configuration Files bit X Places J Open as read only When done one has to reset t
2. signal indicates that stack processing is in progress with CAMAC operations not being completed Busy is asserted when event readout is triggered and deasserted as soon as CAMAC operations are completed Note 2 Acquire idicates that the data acquisition mode is active Note 3 USB Trigger is generated in response to writing to bit 1 of Action Register Note 4 Event Trigger indicates that event readout has been triggered WIENER Plein amp Baus GmbH 52 www wiener d com Werk F r Industvie elekivonit WIENER j efkronik Plein amp Baus Elektronil Regekogs technik Note 5 Invert bit causes the signal to be inverted Note 6 Latch bit causes the signal to be latched To release the latch one must toggle the bit 9 1 6 LAM Mask Register The LAM Mask Register is a 24 bit register that stores the LAM Mask defining what combination of LAM s triggers event readout during the data acquisition When zero the readout is triggered by a signal applied to the NIM input 9 1 7 Action Register Bit 0 ofthe Action Register activates data acquisition in list mode when event readout is triggered either by a start signal applied to the User NIM input Il or a combination of LAMs coinciding with the LAM mask Writing 1 to Bit 1 of the Action Register generates an internal signal of 150ns duration called USB Trigger The bit is in actuality never set i e requires no resetting This signal c
3. 4 COMMUNICATING WITH CC USB Communication with the CC USB consists in writing and reading of buffers of data to from the USB2 port of the CC USB using bulk transfer mode Borrowing from the USB language the buffers to be written to the CC USB will be called Out Packets and they are sent to pipe 0 of the USB port The buffers to be read will be called In Packets and they are read from pipe 2 of the USB port The USB controller IC when connected to a USB2 port configures packet lengths to 512 bytes For USBI full speed the packet length is set to 64 bytes The Out Packets must be properly formatted to be understood by the internal devices of CC USB and by the same token the format of the In Packets retrieved from the CC USB must be understood by the user in order to be useful User may send Out Packets to four devices the Register Block RB CAMAC Readout Stacks CDS and CSS and the NAF Generator RB CDS CCS CNAF User may read In Packets only from the Common Output Buffer Reading back data from the RB CDS and CSS is achieved by first sending a data request Out Packet to these devices and then by reading the In Packet containing the requested data from the Common Output Buffer Writing to the CAMAC NAF Generator constitutes implicitly a request for data such that in response to such a writing CC USB performs the requested CAMAC operation and returns the CAMAC data in the Common Output Buffer Both In and Out Packets are of
4. Inputs 3 user inputs NIM level LEMO pre programmed firmware 7504 I 1 trigger with 24 bit trigger counter I 2 24 bit counter I 3 coincidence register Outputs 3 programmable outputs for CAMAC USB and DAQ signals NIM level LEMO default setting firmware 7504 O 1 busy O 2 internal event trigger O 3 end of busy Display 2 power LED s 6V 3 programmable User LED s red green yellow 3 USB status LED s USB1 USB2 Failure CAMAC data way display N F A Data LAM Q X C Z I B Aux Controller Build in auxiliary crate controller support Front panel connectors for Grant In Out and Request Rear side LAM grade connector Firmware Software upgradeable 4 firmware locations Selection via 8 position switch P program C use Performance CAMAC up to 3MB s FASTCAMAC special modes up to 12MB s 1 5 Power Consumption Voltage Max current Power 6 V 12A about 8 W 6V 0 1 A WIENER Plein amp Baus GmbH 7 www wiener d com Werk Rir WIENER Plein amp Baus Elektronik Regeln techni 1 6 Block diagram STACKS YALSVIN External to BE Fpca BE Pat FPGA P Control Il User NIM input Ol User NIM Busy output ACQ Data Acquisition Control REG Register Block STACKS CAMAC Command Stacks 2 kBytes NAF NAF Sequence Generator CAMAC CAMAC Bus Including Arbitration FIFO s Three Stage Pipe lined FIFO Array 22 kBytes Ma
5. save and read as well as to upload the CAMAC command stack list in an easy and convenient way Further it is possible to create the CAMAC command stack with either a text editor or user program All required programming details are given in chapter 4 5 amp CCUSB Win File Options Help DAQ Flash ROM Operations Stack Builder if Diagnostics Define CAMAC Operation Options a __Readback _ F Hit Register NoS2 3838 23 3 2 Do ne BB38 jas 0080 M Repeat Inc Number Module 0200 CAMAC Response IE 0220 x a D Q Stop 0240 at 0260 I Address Scan 00 393D Repeat Mode 2B3A M Wait for LAM Kersten FastCamac I Use Emulator Address Pattem Special Commands Set Inhibit Clear Inhibit cal za Read LAM Stack Operations Reg C Sch Ini End DAQ Test a Gace Clear Start Trigger Stop Fe Read Read USB Buffer Display Execute DAQ Idling Running Firmware Version WIENER Plein amp Baus GmbH 22 www wiener d com Werk K r Industvie elekionit WIENER a elkironik Plein amp Baus Elektro Regelngs technik 3 9 CC USB CAMAC Function Table N A F Function Data 0 bi 16 Write a 16 bit marker word into the output data stream 16 1 24 Executes N 1 24 A F command on CAMAC data way 16 24 25 0 0 Read Firmware ID 32 25
6. Plein amp Baus GmbH 45 www wiener d com Wesk f r Industvie elekivonit WIENER 2 ee efkronik Plein amp Baus Elektronil Regekn ibis Longs Parameters hDevice in Handle to the XX USB device Data out LAM mask read from the CC_USB Return Values On success the function returns the number of bytes written to CC USB Function returns a negative number on a failure 7 8 CAMAC write The CAMAC write function writes a 24 bit word to a CAMAC address short CAMAC write HANDLE hDevice USHORT N USHORT A USHORT F LONG Data USHORT Q USHORT X 3 Parameters hDevice in Handle to the XX USB device N in CAMAC station number to write to A in CAMAC Sub address to write to F in CAMAC Function Data in data written to the CC_USB out Q response from CAMAC dataway X out comment accepted response from CAMAC dataway Return Values On success the function returns the number of bytes written to CC USB Function returns a negative number on a failure WIENER Plein amp Baus GmbH 46 www wiener d com Wesk f r Industvie elekivonit WIENER 2 j ah A efkronik Plein amp Baus Elektronil Regekn neo 7 9 CAMAC read The CAMAC read function reads a 24 bit word from a CAMAC address short CAMAC read HANDLE hDevice USHORT N USHORT A USHORT F LONG Data USHORT Q USHORT X E Parameters hDevice in Handle to the XX USB device N in CAMAC station number to rea
7. bit code identifies the source of the signal For firmware 95000101 the sources are as follows Code Yellow LED 0 Event Trigger Acquire NIM 13 1 Busy CAMACFI Busy 2 USB Trigger Reserved NIMD 3 USB Out FIFO not empty Event Trigger CAMAC S1 4 USB In FIFO not full CAMACN CAMACS2 5 Reserved Reserved USB In FIFO not empty 6 Acquire NIMII Executing scaler stack T CAMAC F2 USB In FIFO not empty USB Trigger WIENER Plein amp Baus GmbH 17 www wiener d com Werk K r Industvie efekronik WIENER j S elekivonit Plein amp Baus Elektro Regeln techni Code NIM O1 NIM O2 NIM O3 0 Busy Event Trigger End Of Busy 1 Event Trigger CAMAC FI Busy 2 USB Trigger CAMAC N NIMD 3 DGG_A Acquire CAMAC SI 4 DGG_B DGG_A CAMAC S2 5 USB In FIFO not empty DGG_B DGG_A 6 Acquire NIM Il DGG_B 7 CAMAC F2 USB In FIFO not empty USB Trigger Note 1 Busy signal indicates that stack processing is in progress with CAMAC operations not having completed Busy is asserted when event readout is triggered and de asserted as soon as CAMAC operations are completed Note 2 Acquire indicates that the data acquisition mode is active Note 3 USB Trigger is generated in response to writing to bit 1 of Action Register Note 4 Event Trigger indicates that event readout has been triggered Note 5 Invert bit causes the signal to be inverted Note 6 Latch bit causes the signa
8. for the controller and the USB port provide all necessary system information for monitoring hardware control and debugging 1 1 CC USB Features e high speed USB2 interface auto selecting USB2 USB1 LED s for speed and status e 3 pre defined NIM 3 user programmable NIM with LEMO connectors e 3 user programmable LED s e visual CAMAC data and status display with 54 red green and yellow LED s N F A Data LAM Q X C Z e auxiliary crate controller support e FASTCAMAC level 1 compatible e programmable LAM mask e direct USB to CAMAC calls EASY CAMAC e 1kx 16 bit CAMAC command stack for user definable host controlled readout modes e readout triggered either via USB link or by a programmable combination of LAM s or by a start signal applied to a programmable NIM input e 22 kByte pipelined data buffer FIFO with programmable level of transfer trigger e low power consumption only 6V 6V used e Sustained readout rate in excess of 2 8 MByte s 1 2 Read out Modes single word transfer 16 or 24 bit Q stop repeated readout of the same A and N until Q 0 is returned Q scan repeated readout with A and N increment until Q 0 is returned autonomous intelligent readout pursuant to user programmed stack 1k of 16 bit stack memory conditional readout gated by 16 bit hit register quadruple OR of 16 fold AND s of hit bits and programmable mask bits e optional cycle by cycle wait for LAM with progra
9. in Handle to the XX USB device wRegisterAddress in Address of the XX USB register For a list of XX USB addresses see Remarks IpRegisterData out Pointer to a variable that receives the data returned by the operation i e the value stored at wRegisterAddress of XX USB Return Values On success the function returns the number of bytes read XX USB Valid values are 2 and 4 with the latter only for LAM Mask and LAM registers Function returns a negative number on a failure WIENER Plein amp Baus GmbH 35 www wiener d com Werk F r Pay WIENER 4 Plein amp Baus Elektronik ee eine technik 6 8 xxusb_stack write The xxusb_stack_write function sends a buffer to XX USB causing the latter to store this content in a dedicated block RAM for use when data acquisition mode is active This content can be read back using xxusb_stack_read function WORD xxusb_stack_write HANDLE hDevice WORD wWStackType LPDWORD IpStackData E Parameters hDevice in Handle to the XX USB device wStackAddress in Type of the XX USB stack the content of which is to be read Valid types are 0 for the regular stack and 1 for the periodic scaler readout stack IpStackData in Pointer to a variable array that contains the data to be stored in the target stack Return Values On success the function returns the number of bytes sent to XX USB The latter value is twice the length of the stack plus 2 for a header word identifying a s
10. 1 0 Read Global Mode 16 25 1 16 Write Global Mode 16 25 2 0 Read Delays 16 25 2 16 Set Delays 16 25 3 0 Read Scaler Readout Control 24 25 3 16 Write Scaler Readout Control 24 25 4 0 Read User LED Source Selector 32 25 4 16 Write User LED Source Selector 32 25 5 0 Read User NIM Output Source Selector 32 25 5 16 Write User NIM Output Source Selector 32 25 6 0 Read Source Selector for User Devices 32 25 6 16 Write Source Selector for User Devices 32 25 7 0 Read Timing for Delay amp Gate Generator A 32 25 7 16 Write Timing for Delay amp Gate Generator A 32 25 8 0 Read Timing for Delay amp Gate Generator B 32 25 8 16 Write Timing for Delay amp Gate Generator B 32 25 9 0 Read LAM Mask 24 25 9 16 Write LAM Mask 32 25 10 0 Read CAMAC LAM pseudo register 24 25 11 0 Read Scaler A pseudo register 32 25 12 0 Read Scaler B pseudo register 32 25 13 0 Read Extended Delays Register 32 25 13 16 Write Extended Delays Register 32 25 14 0 Read USB Buffering Setup Register 32 25 14 16 Write USB Buffering Setup Register 32 25 15 0 Read Broadcast Map notepad register 24 26 ii execute Broadcast A F on CAMAC dataway 16 24 27 Set Broad cast mask 3 sequential calls for 24 bit mask 24 28 8 29 CAMAC Z a 28 9 29 CAMACC 29 9 24 Set CAMAC I 29 9 26 Clear CAMAC I WIENER Plein amp Baus GmbH 23 www wiener d com a a u gt INES Plein amp Baus Elektronik Regekngs
11. AC Stack that is involved in generating the buffer In the Split Event mode when events span two or more buffers no buffer terminator is written For the direct access of the CAMAC NAF generator EASY CAMAC no header words are written and the In Packet contains only one event with data and or Q X CAMAC Write returns 1 word with Q X WIENER Plein amp Baus GmbH 29 www wiener d com Werk F r Industvie elekivonit WIENER j S elektronik Plein amp Baus Elektronil Regelungs technik Bits 15 14 13 2 11 0 19 gt 8 7 6 5 4 3 gt 2 11 0 CAMAC 16 bit Read returns 1 word with data 0 15 Bits 15 14 13 12 11 10 918 7 J6 J5 J4 3 2J J0 1 D15 D14 D13 D12 D11 D10 D9 D8 D7 D6 D5 D4 D3 D2 D1 DO CAMAC 24 bit Read returns 2 words with data 0 15 data 16 23 and Q X Bits 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 1 D15 D14 D13 D12 D11 D10 D9 D8 D7 D6 D5 D4 D3 D2 D1 DO 2 X Q D23 D22 D21 D20 D19 D18 D17 D16 CC USB has dedicated 2kWords long event FIFO to assemble events To handle longer events CC USB splits the long event into parts each of which appears as a separate event in the output buffer The partial events are distinguishable by bit 12 of the Event Length wo
12. AP NT Hit Data identifies the data as a 16 bit hit register data coincidence register data to be used for the conditional readout of subsequent CAMAC modulesS2 When set S2 strobe is suppressed the CAMAC cycle ending at the end of S1 Numbers Data identifies the data as representing the number of times the next command in stack has to be performed Hit Mode instructs the NAF Generator to condition the readout with the content of the hit pattern read in the first command of the stack first command in an event The Number of Product Terms used to condition the readout must be specified as well Q stop mode the command is to be repeated as long as Q 1 Q response from the addressed CAMAC module but not more than the number specified in the following stack line Address Scan the command is to be repeated a number of times specified in the following word of the stack with A incremented by 1 each time Repeat Mode repeat command a number of times specified in the following stack line LAM Mode wait for LAM subject to LAM Timeout and perform the readout only when LAM is set Fast CAMAC Mode perform the readout in Fast CAMAC mode a number of times specified in the following stack line Address Pattern Data identifies the data as an address pattern to be used in conjunction with the command that follows The subsequent command will be repeated for every address for which the bit is set in the address patte
13. C have identical structure differing only in the Target Address and in length 1 Target Address 2 3 or 8 for CDS CSS and CNAF respectively 2 Number of words in the stack 3 N Sequence of stack words where N Number of words in stack 2 The CAMAC Data Stack Address 2 is 768 words deep and is intended for storing information on the sequence of the CAMAC commands to be performed when an event readout is initiated The CAMAC Scaler Stack Address 3 is 256 words deep and is intended for storing information on the sequence of the scaler readout commands when a periodic readout of scalers is desired The CAMAC NAF Generator Address 8 is an internal module that interprets the information found either in the CAMAC Stacks when CC USB is in data acquiring mode or in the Out Packet received from the USB port when CC USB is in interactive mode 4 5 Structure of the CAMAC Stack The CAMAC stack consists of a sequence of properly encoded simple one line for CAMAC Read commands and 3 lines for CAMAC Write commands or complex multi line CAMAC commands Simple commands specify only the desired N A and F to be issued by CC USB and additionally whether the data is 24 bits Long Mode or 16 bits long For the CAMAC Write commands additional two lines specify the data to be written The data word for a simple command has the following structure Bits 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 Value 0 Long Mode
14. CAMAC A 8 0x8 Delay and Gate Generator B CAMAC A 13 0xD Extended Delays coarse The two Delay and Gate Generator Registers DGG_A and DGG _B as well as the DGG P_A B Extend register store data defining the length of the delay and the length of the gate in units of 10 ns 100 MHz clock for either the gate and delay generator or for the pulser These values can be set for channel A and B independently The pulser is re triggering after the defined delay time i e the delay time gate length defines the pulser repetition rate The value of the delay is a composite of a high resolution value 12 5ns and a coarse range value which was added with firmware 6 0 to increase the possible time range up to 53 5s Earlier firmware versions use only the fine 10 value Gate length 10ns Gate Delay 10ns Delay_fine 655 36 us Delay_coarse Pulser repetition period Gate Delay DGG_A A 7 Bits DGG A 16 31 DGG _A 0 15 Function Gate Delay_fine DGG_B A 8 Bits DGG _B 16 31 DGG_B 0 15 Function Gate Delay fine DGG_ Ext A 13 Bits Function DGG B Ext 16 31 Delay coarse DGG A Ext 0 15 Delay coarse WIENER Plein amp Baus GmbH 19 www wiener d com Werk K r Jadustie efekronik WIENER es elkironik Plein amp Baus Elektro Regelungs technik 3 2 8 Scaler Registers SLR_A and SCLR_B Read Write CAMACA 11 0xB Scaler A CAMACA 12 0xC Scaler B Scale
15. Devices Source Selector Read Write eusessessssnssnnessnessnnnsonnesnnsensennuens 18 3 2 7 Delay and Gate Generator Registers DGG_A and DGG_B Read Write 19 3 2 8 Scaler Registers SLR_A and SCLR_B Read Write neee 20 3 2 9 LAM Mask Register Read Write ucesssessssesssessssenssnensnennnnnnnnnnnnnsnnnnnennnnnn 20 3 2 10 USB Bulk Transfer Setup Register Read Write nennnneen 20 3 2 11 Broadcast MapResister W rite Oly ae 20 3 2 12 Broadcast Map Notepad Register Read unesseessesnseenenennnenenennennen 21 3 3 CAMAC NAF Generator EASY CAMAL sciences nennen 21 3 4 CAMAC common TNC TITS a een 21 3 5 Broadcast Write and Control Commmands ceccceescesseeeseeeseeceseceneceeeeenseecnaeenseeeeees 21 3 6 Writing a Marker Word into the Output Data Stream nnnnnen 21 3 7 CAMAC Command Stacks nes a 22 3 8 Using the XXUSBWin Application essesssesssessssesnsennneensnensnenennennnennnnnennnnnn 22 3 9 CC USB CAMAC Function Table a eins e 23 4 Communicating with CC USB seessescoeseesoesooesoesoesooesoesoesoossoessesoossoosseesoesoossoesoesoosseeso 24 4 1 General structure of Out Packen ee 24 4 2 Writing Data to the Register Block ana 25 4 3 Reading Back Data from the Register Block unesunnnie en 25 44 Writing Data to the CAMAC Command Stacks and to the NAF Generator 26 4 5 Structure of the CAMAC Stack une 26 WIENER Plein amp Baus Gm
16. Function returns a negative number on a failure WIENER Plein amp Baus GmbH 48 www wiener d com Wesk f r Industvie elekironit WIENER 2 j cea efkironik Pp amp Baus Elektronil Regen techni 8 APPENDIX A USE OF MULTIPLEXED USER DEVICES The FPGA configuration of the CC USB may set up optionally various user devices that are beyond the scope of a CAMAC controller but which are intended to facilitate and reduce the cost of a data acquisition setup The firmware of the CC USB Firmware Id 95000101 sets up two delay and gate generators DGG_A and DGG B and two 32 bit scalers SCLR_A and SCLR_B 8 1 Characteristics and the Use of Delay and Gate Generators The two user gate and delay generators allow one to generate delays and gates in the range of 10 ns approx 650 us with the 10 ns granularity To make use of an DGG_A or DGG _B one simply needs to select the desired trigger signal by properly setting the respective selector code bits in the User Devices Register and set write the desired delay and gate data in units of 10 ns into the respective DGG register as described in Section 3 2 7 8 2 Characteristics and the Use of Scalers The two user scalers allow one to count various signals and read out the resulting numbers in CAMAC like commands The latter commands access the scaler data without generating CAMAC bus activity Both scalers are asynchronous with respect to the CC USB clock each using a dedicated fa
17. N A F This data word can thus be calculated as Command F 32 A 512 N 16384 LongMode Note that the CAMAC Read commands have both bits 3 and 4 the most significant bits of F set while the Write commands have only bit 4 set Control commands have bit 3 set Complex commands are possible only for Read operations The first word of a complex commands is similar to a simple command except that it has the continuation bit bit 15 set LE WIENER Plein amp Baus GmbH 26 www wiener d com Werk K r Industvie efekronik WIENER en elekivonit Plein amp Baus Elektro Regeln recht Bits 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 Value 1 Long Mode N A F The second word is a modifier word detailing the mode of readout to be performed or the nature of the data to be read Depending on which bits in the second word are set a number of additional words if any will follow The continuation bit bit 15 of the second word is set whenever additional data are to follow The structure of the modifier word is as follows Bits 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 Value U NT U AP FC LM RM AS QS HM ND S2 HD Where the individual bits have the following meaning HD ND HM QS AS LM FC
18. Outputs The actual selection of sources is firmware specific and subject to customization The general bit composition of the selector word is shown in the table below Yellow LED NIM 03 Green LED NIM O2 Bit 14 13 12 11 10 9 8 7 6 5 4 3 21 0 Value Latch Invert Code Latch Invert Code Latch Invert Code The 3 bit code identifies the source of the signal The sources differ for different LEDs and NIM outputs but they are the same between the LED and NIM targets i e Red LED has the same sources as the NIM output Ol Green LED the same as O2 and Yellow LED the same as O3 For firmware 4503 the sources are as follows Code RE TED I Green LED Yellow LED 0 Event Trigger Acquire NIM B 1 Busy CAMACFI Busy 2 USB Trigger Reserved NIMR 3 USB Out FIFO not empty Event Trigger CAMAC S1 4 USB In FIFO not full Data Buffer Full CAMAC S2 5 Reserved Reserved USB In FIFO not empty 6 Acquire NIM I1 Executing scaler stack 7 CAMAC F2 USB In FIFO not empty USB Trigger Code NIM O1 NIM 02 NIM 03 0 Busy Event Trigger EndOfBusy 1 Event Trigger CAMAC F1 Busy 2 USB Trigger Reserved NIM DR 3 USB Out FIFO not empty Event Trigger CAMAC S1 4 USB In FIFO not full Data Buffer Full CAMAC S2 5 Reserved Reserved USB In FIFO not empty 6 Acquire NIM 1 Executing scaler stack 7 CAMAC F2 USB In FIFO not empty USB Trigger Note 1 Busy
19. RD xxusb_bulk_read HANDLE hDevice CHAR pData WORD wDataLen WORD wTimeout i Parameters hDevice in Handle to the XX USB device pData out Pointer to a character array that receives the data returned by the operation i e the content of the USB port output FIFO of the XX USB wDataLen in Number of bytes to read This number must be not less than the number of bytes stored in the output FIFO wTimeout in Time in milliseconds after which the I O operation is canceled should there be no data available for the readout Return Values On success the function returns the number of bytes read from XX USB Function returns a negative number on a failure which in most cases signifies a timeout condition Remarks The xxusb_bulk_read is given for the sake of completeness 6 13 xxusb_bulk_write The xxusb_bulk_ write function writes a character array to the USB port FIFO of XX USB WORD xxusb_bulk_write HANDLE hDevice CHAR pData WORD wDataLen WORD wTimeout E WIENER Plein amp Baus GmbH 39 www wiener d com Werk F r Industvie elekivonit WIENER cea efkronik Plein amp Baus Elektronil Regelungs technik Parameters hDevice in Handle to the XX USB device pData out Pointer to a character array that receives the data returned by the operation i e the content of the USB port output FIFO of the XX USB wDataLen in Number of bytes to read This number must be not less than the numb
20. The HeaderOpt bit controls the structure of the buffer header such that HeaderOpt 0 writes out one header word identifying the buffer type bit 15 1 watchdog buffer bit 14 0 data buffer bit 14 1 scaler buffer and the number of events in buffer When HeaderOpt 1 the second header word is written out listing the number of words in the buffer The Arbitr Bit when set to 1 activates CAMAC bus arbitration 3 2 3 Delays Register Read Write CAMAC A 2 0x2 Bits 8 15 0 7 Function LAM timeout trigger delay The delays register stores the desired trigger delay from the start signal applied to the NIM input to the actual start of the CAMAC readout least significant 8 bits and the LAM timeout period most significant 8 bits Both delays are in units of us 3 2 4 Scaler Readout Control Register Read Write CAMAC A 3 0x3 Bits 16 23 0 15 Function Timelnterval NumSepEvts WIENER Plein amp Baus GmbH 16 www wiener d com ER NNN The Scaler Readout Frequency Register stores the numbers defining the frequency at which scalers are to be read out scaler stack is executed during the data acquisition and the mode of triggering the readout There are two options for triggering the readout of scalers with one based on the number of events collected and the other on real time lapsed from the previous scaler dump The scaler readout can be also triggered by writing 1 to b
21. USHORT invert USHORT latch 5 Parameters hDevice in Handle to the XX USB device Channel in The NIIM output channel you wish to modify Valid values are 1 Ol 2 02 3 03 code in Determines what event the output is linked to Valid valuesare 0 7 and are described in section 2 3 5 invert in Determines whether or not the output is inverted Valid values are WIENER Plein amp Baus GmbH 44 www wiener d com Werk F r Industvie elekivonit WIENER es efkronik Plein amp Baus Elektronil Regelungs technik 0 Not inverted 1 Is inverted latch in Determines whether or not the output is latched Valid values are 0 Not latched 1 Is latched Return Values On success the function returns the number of bytes from from the CC_USB Function returns a negative number on a failure 7 6 CAMAC write LAM_ mask The CAMAC write LAM mask function writes a LAM mask to the appropriate internal register of the CC_USB short CAMAC write LAM MASK HANDLE hDevice LONG Data 5 Parameters hDevice in Handle to the XX USB device Data in LAM mask passed to CC_USB Return Values On success the function returns the number of bytes written to CC USB Function returns a negative number on a failure 7 7 CAMAC _read_LAM _mask The CAMAC read LAM mask function reads the LAM mask from the appropriate internal register of the CC_USB short CAMAC read_LAM_ MASK HANDLE hDevice LONG Data 3 WIENER
22. Werk Rir WIENER amp Plein amp Baus Elektronik Regetnas User Manual WIENER Plein amp Baus GmbH 1 www wiener d com Rev 2 02 May 8 2006 Wesk f r Industvie elekivonit WIENER 2 j ae efkronik Plein amp Baus Elektronil Regalo techni General Remarks The only purpose of this manual is a description of the product It must not be interpreted a declaration of conformity for this product including the product and software W Ie Ne R revises this product and manual without notice Differences of the description in manual and product are possible W Ie Ne R excludes completely any liability for loss of profits loss of business loss of use or data interrupt of business or for indirect special incidental or consequential damages of any kind even if W Ie Ne R has been advises of the possibility of such damages arising from any defect or error in this manual or product Any use of the product which may influence health of human beings requires the express written permission of W Ie Ne R Products mentioned in this manual are mentioned for identification purposes only Product names appearing in this manual may or may not be registered trademarks or copyrights of their respective companies No part of this product including the product and the software may be reproduced transmitted transcribed stored in a retrieval system or translated into any language in any form by any means with the express written permissi
23. a negative number on a failure 6 11 xxusb_usbfifo_read The xxusb_usbfifo read function reads the content of the USB port FIFO of XX USB or times out whenever this FIFO has not set the FIFO Full flag WORD xxusb_usbfifo_read HANDLE hDevice LPDWORD IpData WORD wDataLen WORD wTimeout E Parameters hDevice in Handle to the XX USB device IpData out Pointer to a variable array that receives the data returned by the operation i e the content of the USB port output FIFO of the XX USB wDataLen in Number of bytes to read This number must be not less than the number of bytes stored in the output FIFO wTimeout in Time in milliseconds after which the I O operation is canceled should there be no data available for the readout Return Values On success the function returns the number of bytes read from XX USB Function returns a negative number on a failure which in most cases signifies a timeout condition Remarks The xxusb_usbfifo_read is intended for use while XX USB is in data acquisition mode Upon timeouts the host application receives the control and may reissue the command or terminate the acquisition 6 12 xxusb_bulk_read WIENER Plein amp Baus GmbH 38 www wiener d com es F r WIENER Z PH Plein amp Baus Elektronik Regehr Jungs The xxusb _ bulk read function reads the content of the USB port FIFO of XX USB or times out whenever this FIFO has not set the FIFO Full flag WO
24. a variable length depending on which internal address is involved and what the content of the message is Important Note With some drivers EZUSB in conjunction with Windows API read operations from the USB port are blocking operations such that the host program will stop executing until the data is available at the port Therefore the host program must make sure by first requesting data that the CC USB has placed data in the Common Output before the read command is issued The CC USB provides a mechanism for supplying data even when the host program is frozen in a state of waiting for data The mechanism consists in starting a second copy of the program and issuing a bare request for data command from this second copy not followed by the read IN Packet command The libxxusb package of CC USB access functions makes overlapped USB calls that have preset timeout periods When no data is available until the end of this period the I O is canceled and the respective function returns error code The user is then expected to take proper actions which may include resubmitting the call It is important to specify a sufficiently long In Packet size to be at least of the size of the actual data buffer available at the Common Output Buffer This is especially important in the case of reading CAMAC data buffers which differ in size substantially depending on the structure of the CAMAC Readout Stack 4 1 General structure of Out Packets Si
25. an be routed to user NIM output O1 or O3 and or displayed on user Red or Yellow LED Bit 2 of the Action Register clears a number of internal registers and is intended for primarily for use during firmware debugging Bit 3 clears the Input 2 Scaler 24 bit 9 1 8 Serial Number Register The Serial Number Register is a Read Only register containing the serial number of the CC USB The serial number can be also obtained during the initialization of the USB port e g by calling the libxxusb library function xxusb_devices_ find WIENER Plein amp Baus GmbH 53 www wiener d com
26. bH 3 www wiener d com ER 4 6 Structure of the IN Packen een er see Guide to List Mode Data Acquisition with CC USB ussssosssssnnsssnnsssonnesnonnennnnnenne 31 LIBXXUSB Library for Windows and Linux sssssssoossssonssssonnssnnnnsnnonnennnnnennonnennnnne 32 6 1 22150 devices IN Reese 32 62 DUST SVC SOC nee ee 32 6 3 KRUSE Seal OPM een R A EE E E ERRER aA 33 64 Xx Sb device Lo einen 33 6 5 SE DeTeWe ee een 34 66 EIST f gister Wie eis 34 6 7 XX SD Tesister tead einknahkeinuneser 35 68 Bush Black Wii 36 69 xxusb SLANE Tears 36 6 10 EDS cr 37 Oll Sets US TNT Teades E EEE EAE E EREE 38 612 sexs Bulk TAG unseren 38 6 13 SSID BE Wii een Re TeRETE 39 5 414 xxusb flashblock Prosa Rss 40 7 CE USB Specific Function ana en 41 7 1 CAMAC register Write en iiiaae EE E EEEE ETE ER ENEE 41 72 GAMING register tead aus 41 Wed CAMAC DOG een neues 42 TA CAMAC LED setting Soinen a E E N 43 7 5 CAMAC Output settings een 44 TO CAMAC Write CAM Mas n RE SL 45 7 1 MOANA read LAM WER 45 EB SL AMAL wie een een 46 T9 SCAN Tead eier een 47 710 CAMAC Z erkenne 47 TAIL EAN C irene ep Gam mse 48 742 MOAI Tasse 48 8 APPENDIX A Use of Multiplexed User Devices rssssusssonssssonnssnonnssnnnnennonnennonnennen 49 8 1 Characteristics and the Use of Delay and Gate Generators ennnneen 49 8 2 Characteristics and the Use of Scalers u a 49 9 APPENDIX B Firmware lt 101 Gen
27. d by bits in the Broadcast Map Register Broadcast commands are generated by setting N 26 and using the desired A F and D 3 6 Writing a Marker Word into the Output Data Stream Firmware 0301 and newer offers the capability to insert into the output data stream marker words to facilitate viewing and interpreting the content of data buffers A typical use of such WIENER Plein amp Baus GmbH 21 www wiener d com Wesk f r Industvie elekironik WIENER elkronik Plein amp Baus Elektronik einge er onik marker words is to mark the end of an event or end of long blocks of data Note that firmware 0301 and newer no longer marks end of events by OxFFFF leaving the user the flexibility of deciding on the number and the appearance of end of event markers 3 7 CAMAC Command Stacks For maximum performance all CAMAC commands have to be stored and executed from the CC USB CAMAC command stack The stack with 1k x 16bit size can consist of up to 1000 simple CAMAC operations but also consist of more complex operations The following commands can be programmed others may be added in future firmware versions e CAMAC NAF CAMAC NAF read 16bit 24bit CAMAC NAF write 16bit 24bit C Z I as NAF see paragraph 4 6 LAM mode Hit data hit mode Repeat mode number data Q stop Address scan Fast CAMAC L1 Broadcast write and control commands 3 8 Using the XXUSBWin Application The MS Windows application XXUSBWin allows to create
28. d from A in CAMAC Sub address to read from F in CAMAC Function Data out data read from the CC_USB out Q response from CAMAC dataway X out comment accepted response from CAMAC dataway Return Values On success the function returns the number of bytes written to CC USB Function returns a negative number on a failure 7 10 CAMAC Z The CAMAC Z function performs a CAMAC initialize short CAMAC_Z HANDLE hDevice 5 WIENER Plein amp Baus GmbH 47 www wiener d com Werk F r Industvie elekivonit WIENER j en efkronik Plein amp Baus Elektronil Regekogs technik Parameters hDevice in Handle to the XX USB device Return Values On success the function returns the number of bytes written to CC USB Function returns a negative number on a failure 7 11 CAMAC C The CAMAC C function performs a CAMAC clear short CAMAC Cf HANDLE hDevice E Parameters hDevice in Handle to the XX USB device Return Values On success the function returns the number of bytes written to CC USB Function returns a negative number on a failure 7 12 CAMAC I The CAMAC I function performs a CAMAC inhibit short CAMAC I HANDLE hDevice USHORT inhibit 5 Parameters hDevice in Handle to the XX USB device inhibit in Determines whether CAMAC inhibit is on or off Valid values are 0 Inihibit OFF 1 Inhibit ON Return Values On success the function returns the number of bytes written to CC USB
29. de event readout is triggered either by a start signal applied to the User NIM input Il or a combination of LAM s coinciding with the LAM mask Writing 1 to Bit 1 of the Action Register generates an internal signal of 150ns duration called USB Trigger This signal can be routed to user NIM output O1 or O3 and or displayed on user Red or Yellow LED Writing 1 to Bit 2 of the Action Register clears a number of internal registers and is intended primarily for use during firmware debugging Writing 1 to Bit 4 of the Action Register triggers scaler dump when CC USB is in data acquisition mode and the readout of the scaler stack has been activated Note that Bits 1 2 and 3 are in actuality never set and hence they require no resetting 3 2 Internal CAMAC Register File The internal register file consists of 10 registers storing one constant Firmware ID and 9 words encoding static operational parameters Additionally there are three pseudo registers mapping onto scaler data and the status of CAMAC LAM lines such that the latter are accessed by issuing Read commands to pseudo registers All registers of the Internal Register File are WIENER Plein amp Baus GmbH 14 www wiener d com Werk K r usiye Bros ar nik IENER Regelungs technik 4 accessed via CAMAC commands N 25 F 0 A i and N 25 F 16 A i for read and Write access respectively where 66599 1 The functionality
30. e CC USB memory e g by calling the libxxusb library function xxusb_ stack write It is recommended to read back the stack function xxusb_stack_read to verify that the stack is correctly stored 3 When the setup calls for it build and load the scaler stack 4 Set up the data acquisition trigger mode By default CC USB commences execution of the stack upon receipt of a NIM signal at its user NIM input I1 5 Set the trigger delay time from the receipt of an event to the commencement of the stack execution and LAM timeout 6 Set up event termination mode By default CC USB terminates every event by one terminator word OxFFFF 7 Set up buffering mode and data buffer length by writing a suitable 4 bit code into bits 0 3 of the Global Mode Register The default is buffer length of 4096 words and events fitting into one buffer Set up CAMAC bus arbitration if necessary The default is no arbitration 9 Set buffer header option By default CC USB writes one buffer header word containing information on the number of events in the buffer buffer type regular or periodic scaler and the buffer termination mode regular or watchdog 10 Start acquisition by setting bit 0 of the Action Register to 1 End acquisition by resetting this bit to 0 While in acquisition mode the host software is expected to read the USB port In FIFO in a loop to empty it and make space for subsequent events WIENER Plein amp Baus GmbH 31 ww
31. e and revision numbers respectively 3 2 2 Global Mode Register read write CAMAC A 0 0x1 The global mode register has the following 16 bit structure Krb 11 109 8 7 6 5 4 3 2 1 0 Unused Arbitr Unused HeaderOpt EvtSepOpt MixBuffOpt Unused BuffOpt WIENER Plein amp Baus GmbH 15 www wiener d com Werk K r Industvie elektronik WIENER elekironit Plein amp Baus Elektronik eein er chine The BuffOpt bits 0 2 define the output buffer length Bit 3 controls the mode of buffer filling such that 0 closes buffers at event boundaries and allows spreading events across the adjacent buffers BuffOpt Value Buffer Length words 0 4096 1 2048 2 1024 3 512 4 256 5 128 6 64 7 Single Event The MixBuffOpt 1 causes regular and scaler data to share the data buffers with scaler events identified by bit 15 set in the event header word Conversely MixBufOpt 0 causes regular and scaler data to be written in separate buffers identified by bit 13 1 in the buffer header word Note that by allowing scaler and regular data to share buffers a better use is made of buffering which results in a superior USB bandwidth a recommended mode of operation The EvtSepOpt set the number of event terminator word hexadecimal FFFF such that EvtSepOpt 0 1 cause one two terminator word s written at the end of each event
32. e driver signing is important WIENER Plein amp Baus GmbH 11 www wiener d com Wesk f r Industvie elekironik WISNER A q 3 5 efkronik Plein amp Baus Elektronil Regekn neo a Found New Hardware Wizard Completing the Found New Hardware Wizard The wizard has finished installing the software for ad WIENER CAMAC Crate Controller with USB Click Finish to close the wizard 9 Run the XXUSBWin exe program from the program directory or use one of the sample programming packages to communicate with the CC USB 2 2 Installation for Linux Operating Systems Linux support for the CC_USB is provided through a shared library and header file To use these file simply copy them to an appropriate location such as usr lib for the library and usr include for the header file The functions available in the library are exactly the same as those available at for Windows and are described later in the manual Linux specific details are located in the readme file on the software CD that you received with your module 2 3 Firmware upgrades The CC USB is shipped with the latest firmware for the FPGA loaded however new versions of it may be available on the web Please occasionally check at www wiener d com gt support gt downloads if newer versions of firmware documentation and or software are available The firmware upgrade is done via USB and can be performed by the help of the XXUSBWin program
33. ead Write 10 Action Read Write 12 CAMAC LAM 24 bits Read Only 15 Serial Number 11 bits Read Only 16 24 bit counter 1 2 24 bits Read Only 18 Event counter I 1 24 bits Read Only 9 1 1 Firmware ID Register This Firmware ID register identifies the acting FPGA firmware in four hexadecimal digits MYER where M and Y represent the month and year of creation and F and R represent the firmware and revision numbers respectively 9 1 2 Global Mode Register The global mode register has the following 16 bit structure WIENER Plein amp Baus GmbH 50 www wiener d com Wesk f r Industvie elektronik WIENER elekivonit Plein amp Baus Elektronik ee eine er chine Bits 15 14 13 12 1111019 8 7 6 5 4 3 2 1 0 Value Arbitr WdgFreq HeaderOpt EvtSepOpt BuffOpt The BuffOpt bits 0 2 define the output buffer length Bit 3 controls the mode of buffer filling such that 0 closes buffers at event boundaries and allows spreading events across the adjacent buffers BuffOpt Value Buffer Length words 4096 2048 1024 512 256 128 64 Single Event NACAR UIN S The EvtSepOpt set the number of event terminator word hexadecimal FFFF such that EvtSepOpt 0 1 cause one two terminator word s written at the end of each event The HeaderOpt bit controls the structure of the buffer header such that Heade
34. er of bytes stored in the output FIFO wTimeout in Time in milliseconds after which the I O operation is canceled should there be no data available for the readout Return Values On success the function returns the number of bytes read from XX USB Function returns a negative number on a failure which in most cases signifies a timeout condition Remarks The xxusb_usbfifo_read is given for the sake of completeness 6 14 xxusb_flashblock_program The xxusb_flashblock program function programs one sector of 256 bytes of the flash memory FPGA configuration memory WORD xxusb_usbfifo_read HANDLE hDevice UCHAR pData Ss Parameters hDevice in Handle to the XX USB device pData out Pointer to the configuration byte data array Return Values On success the function returns the number of bytes written to XX USB the correct number is 518 Function returns a negative number on a failure which in most cases signifies a timeout condition WIENER Plein amp Baus GmbH 40 www wiener d com ER MNN Remarks To program the flash memory one must call repeatedly xxusb_flashblock_ program while pausing for at least 30ms between consecutive calls and incrementing the pointer to the data array by 256 on each consecutive call The device must be in programming mode with the rotary selector in one of the 4 P positions The configuration file of a XC3S200 FPGA of CC USB will occupy 512 sectors of flas
35. eral Architecture of CC USB and its User WOR TAG a een 50 9 1 Register Bloch use een 50 9 1 1 Firmwar ID R gistetinsiinrna i a E EISS 50 9 1 2 Global Mode Register nee enkeeacne 50 9 1 3 DCI AVS Reuisier een 51 9 1 4 Scaler Readout Frequency Register un 51 9 1 5 User LED and NIM Output Selectors s nnsenneeneesseeseeseoeseesseseessressesersseessessrssres 52 9 1 6 LAM Mask Resister nee a E T ee 53 9 1 7 Action RC ISLET sinus 53 9 1 8 Senal N mber KS SIGUE nenn 53 WIENER Plein amp Baus GmbH 4 www wiener d com Ben y F r WIENER fay Pr Plein amp Baus Elektronik Regehr Jungs GENERAL DESCRIPTION The CC USB is a full featured CAMAC Crate controller with integrated high speed USB interface It supports Master and Slave operations with full CAMAC arbitration as a master it accepts slaves The CC USB is FASTCAMAC compliant The CC USB internal FPGA can be programmed to operate as command sequencer with data buffering in a 22kB FIFO Combined with front panel triggering via the CAMAC operation and data taking can be done without any PC or USB activity All CC USB logic is controlled by the XILINX Spartan 3 FPGA Upon power up the FPGA boots from a flash memory The configuration flash memory can be reprogrammed via the USB port allowing convenient updates of the firmware 4 memory sections allow upload and use of different firmware versions The integrated CAMAC data way display as well as additional user and status LED s
36. h memory 512 calls to the xxusb_flashblock program The XC3S400 FPGA of VM USB will occupy 830 sectors of flash memory 7 CC_USB SPECIFIC FUNCTIONS The following functions are specific to the CC_USB They are built on top of the general purpose functions described in section 6 and provide users with an eaiser and more transparent way of communicating with the controller 7 1 CAMAC register_write The CAMAC register_write function writes to the internal registers of the CC_USB as described in section 3 2 short CAMAC register_write HANDLE hDevice USHORT Address LONG Data E Parameters hDevice in Handle to the XX USB device Address in Internal register address to write to as specified in Section 3 2 Data in Data to be written to the specified register Return Values On success the function returns the number of bytes written to CC USB Function returns a negative number on a failure 7 2 CAMAC register_read The CAMAC register_read function read from the internal registers of the CC_USB as described in section 3 2 WIENER Plein amp Baus GmbH 41 www wiener d com Wesk f r Industvie elekivonit WIENER 2 j S efkronik Plein amp Baus Elektronil Regalo techni short CAMAC register_read HANDLE hDevice USHORT Address LONG Data 3 Parameters hDevice in Handle to the XX USB device Address in Internal register address to read from as specified in Section 3 2 Data out Data read fro
37. he consecutive bytes of the register Any command other than a Broadcast Map Register write command resets the byte counter to Zero 3 2 12 Broadcast Map Notepad Register Read CAMAC N 25 A 15 F 0 The Broadcast Map Notepad Register contains a copy of the Broadcast Map Register BMR to allow one to verify what was written into the BMR 3 3 CAMAC NAF Generator EASY CAMAC The CC USB allows a direct access from the computer via USB to the CAMAC bus and modules which is called Easy CAMAC These calls can be either simple CAMAC commands or be more complex to allow special CAMAC modes as Q stop Q scan see detailed description in chapter 4 4 an 4 5 Due to the USB latency time the EASY CAMAC calls are limited to a few kHz rate EASY CAMAC commands can be performed with the provided CCUSB WIN program Stack builder window For user programs a library of standard CAMAC calls is part of thelibxxusb dll for MS Windows or libxx_usb so for Linux operating systems 3 4 CAMAC common functions The common CAMAC controller functions as Initialize Z Clear C and Inhibit I are realized via NAF calls to internal station numbers N 28 and 29 These functions can be programmed as follows Function N A F Z 28 8 29 C 28 9 29 Set Inhibit 29 9 24 Clear Inhibit 29 9 26 3 5 Broadcast Write and Control Commands CC USB allows one to execute broadcast write and control commands to modules identifie
38. he controller or switch the selector switch to the corresponding run location C1 C4 and power cycle the crate USBWin CC005 a Eile Options Macro Help DAQ Flash ROM Operations Stack Builder LED NIM Multiplexers Regi Atmel PEROM Operations XXUSBWin Press Cancel if the FPGA is not configured C Documents and Set gs 7 3 2005 7 12 10 PM CETL Using EC USB CC0055 Firmware Unknown WIENER Plein amp Baus GmbH 13 www wiener d com WIENER 4 Plein amp Baus Elektronik Regekngs 3 GENERAL ARCHITECTURE OF CC USB AND ITS USER INTERFACE The CC USB presents to the user five internal devices or addresses shown in Table 1 Table 1 Internal devices of CC USB and their addresses Address Device Register Block RB CAMAC Data Readout Stack CDS CAMAC Scaler Readout Stack CSS CAMAC NAF Generator CNAF Common Output Buffer vAN 3 1 CC USB Register Blocks Since Firmware 95001010 the Register Block RB of CC USB contains only the Action Register which needs to be accessed outside the CAMAC operations path The remaining internal registers are accessed via CAMAC Commands with N 25as described in section 3 2 3 1 1 Action Register address 1 0x01 12 15 8 11 5 7 4 3 2 1 0 scaler dump clear USB trigger Start stop Bit 0 of the Action Register when set to 1 activates data acquisition in list mode In this mo
39. he xxusb_reset_toggle function toggles the reset state of the FPGA while XX USB is in programming mode rotary selector set in one of four P positions WORD xxusb_reset_toggle HANDLE hDevice E Parameters hDevice in Handle to the XX USB device Return Values Returns negative upon failure 6 6 xxusb_register_write The xxusb_register_write sends a data buffer to XX USB causing the latter to store the desired data in the target register WORD xxusb_register_write HANDLE hDevice WORD wRegisterAddress DWORD dwRegisterData j Parameters hDevice WIENER Plein amp Baus GmbH 34 www wiener d com Werk f r Industrie WIENER Plein amp Baus Elektronik PRegekwngs technik in Handle to the XX USB device wRegisterAddress in Address of the XX USB register For a list of XX USB addresses see chapter 3 and appendix B dwRegisterData in Data to be stored in the register Return Values On success the function returns the number of bytes sent to XX USB Function returns 0 on attempted writes to read only registers and negative numbers on failures 6 7 xxusb_register_read The xxusb_register read function first sends a buffer to XX USB causing the latter to write the content of a desired register to its USB port FIFO and then obtains the value by reading the buffer from the XX USB WORD xxusb_register_read HANDLE hDevice WORD wRegisterAddress LPDWORD IpRegisterData i Parameters hDevice
40. hed Return Values On success the function returns 1 Function returns a negative number on a failure 7 4 CAMAC LED settings The CAMAC LED settings function allows the user to setup the LEDs on the front panel of the CC_USB Details about the LED settings are found in section 3 2 5 short CAMAC_LED settings HANDLE hDevice USHORT LED USHORT code USHORT invert USHORT latch E Parameters hDevice in Handle to the XX USB device LED in The LED you wish to modify Valid values are 1 RED WIENER Plein amp Baus GmbH 43 www wiener d com Werk F r Industvie elekironik WIENER j S efkronik Plein amp Baus Elektronil Regelungs technik 2 GREEN 3 Yellow code in Determines what event the LED is linked to Valid valuesare 0 7 and are described in section 2 3 5 invert in Determines whether or not the LED is inverted Valid values are 0 Not inverted 1 Is inverted latch in Determines whether or not the LED is latched Valid values are 0 Not latched 1 Is latched Return Values On success the function returns the number of bytes from from the CC_USB Function returns a negative number on a failure 7 5 CAMAC Output_settings The CAMAC Output_ settings function allows the user to setup the NIM outputs on the front panel of the CC_USB Details about the output settings are found in section 3 2 5 short CAMAC Output_ settings HANDLE hDevice USHORT Channel USHORT code
41. henever all bits in any of the specified Bit Masks are set in the hit register data Since the stack can be quite complex it is advisable to write a proper routine to set up the stack As an option one may utilize the XXUSBWin Windows application to build the stack and save it to disk The following example shows the CAMAC command stack as saved to file for a simple 4 parameter readout Explanations are added in blue color CCUSB CAMAC Stack Generated on 8 10 2005 at 3 28 04 PM 9 number of lines 3B38 set inhibit I N 29 A 9 F 24 BB38 wait for LAM 0080 0200 read 1 channel N 1 A 0 F0 0220 read 2 channel N 1 A 1 F0 0240 read 3 channel N 1 A 2 F0 0260 read 4 channel N 1 A 3 F0 393D clear C N 28 A 9 F29 3B3A clear inhibit I N 29 A 9 F24 WIENER Plein amp Baus GmbH 28 www wiener d com Wesk f r Industvie elektronik WIENER elekivonit Plein amp Baus Elektronik ee eine er onik 4 6 Structure of the IN Packets The General Output Buffer is associated with Endpoint 6 of the USB2 controller IC which is configured as a 512 byte deep FIFO This endpoint is configured for bulk transfer and one can specify lengths of buffers to be read of any length up to 8192 bytes compatible with the CC USB functionality Al data supplied by the CC USB is to be read from the Endpoint 6 While reading it is important to specify the length of the buffer not shorte
42. in_062105 software to the specified destination directory Directory C Program Files CCUSB Change Directory Exit Setup 3 Connect the CC USB via the provided USB cable to a USB port of the computer Running Windows 2000 or XP the hardware change should be detected and the New Hardware Wizard Window should open and show the CAMAC USB controller 4 Do not use the automatic software installation but chose installation from specific location WIENER Plein amp Baus GmbH 9 www wiener d com Plein amp Baus Elektronik Found New Hardware Wizard This wizard helps you install software for WIENER CAMAC Crate Controller with USB O f your hardware came with an installation CD SB or floppy disk insert it now What do you want the wizard to do O Install the software automatically Recommended Install from a list or specific location Advanced Click Next to continue 5 Select manual search for the driver 6 Type in the drive letter for the CD ROM e g D F and locate the file CC USB inf Press Enter to select this driver and to close the window Found New Hardware Wizard Please choose your search and installation options id O Search for the best driver in these locations Use the check boxes below to limit or expand the default search which includes local paths and removable media The best driver found will be installed Dont sea
43. it 4 of the Action Register while CC USB is in data acquisition mode one must in fact write 17 to the Action Register to preserve the data acquisition mode The scaler readout is based on the whichever comes first principle such that with more than one option active the one that matures first triggers the actual readout with all control counters being reset to zero NumSepEvts represents the number of data events separating the scaler readout events When the value is set to zero this particular option of triggering the scaler readout is suppressed Timelnterval represents the time interval in units of 0 5 s separating the scaler readout events When the value is set to zero the timer is disabled Note that the range of the timer is from 0 5 sto 128s 3 2 5 User LED and NIM Output Selectors CAMAC A 4 0x4 LED Register CAMAC A 5 0x5 NIM output register Read Write Numbers stored in these registers identify sources of User LEDs and NIM Outputs The actual selection of sources is firmware specific and subject to customization The general bit composition of the selector word is shown in the table below i 8 12 8 10 5 4 0 2 Latch Invert Code Latch Invert Code NIM 03 NIM 02 NIM O1 21 20 16 18 13 12 8 10 5 4 0 2 Latch Invert Code Latch Invert Code Latch Invert Code The 3
44. l to be latched To release the latch one must toggle the bit Note 7 DGG_A and DGG B are output pulses of the two user delay and gate generators 3 2 6 User Devices Source Selector Read Write CAMAC A 6 0x6 In addition to the two NIM outputs firmware 95000101 implements four user devices two delay and gate generators and two 32 bit scalers All of these devices may use various signals as input trigger signals with the selection identified by respective code bits stored in the User Devices Source Selector register Additionally this register accommodates bits that enable and clear the two scalers The bit composition of the User Devices source selector register is shown in the table below Device Enable Reset Latch Bit Invert Bit Code SCLR A 5 4 0 2 SCLR B 13 12 8 10 DGG A 16 18 DGG B 24 26 The meaning of the input selector codes is shown in the table below WIENER Plein amp Baus GmbH 18 www wiener d com JENCR Regelungs technik Code SCLR_A SCLR_B DGG_A DGG B 0 Disabled Disabled Disabled Disabled 1 NIM II NIM II NIM Il NIM II 2 NIM 2 NIM 2 NIM I2 NIM I2 3 Event Event Event Trigger Event Trigger 4 End of Event End of Event 5 USB Trigger USB Trigger 6 z z z 7 B 3 2 7 Delay and Gate Generator Registers DGG_A and DGG_B Read Write CAMAC A 7 0x7 Delay and Gate Generator A
45. m the specified register Return Values On success the function returns the number of bytes read from the CC USB Function returns a negative number on a failure 7 3 CAMAC DGG The CAMAC DGG function allows the user to setup the characteristics of the Delay and Generator channels of the CC_USB short CAMAC DGG HANDLE hDevice SHORT channel SHORT trigger SHORT output SHORT delay SHORT gate SHORT invert SHORT latch Gaaeadaceadce 3 Parameters hDevice in Handle to the XX USB device channel in The DGG channel you wish to modify Valid values are 0 For DGG channel A 1 For DGG channel B trigger in Determines the start of the DGG Valid Values are 0 Channel Disabled 1 NIM input 1 WIENER Plein amp Baus GmbH 42 www wiener d com Werk F r Industvie elekivonit WIENER j en efkronik Plein amp Baus Elektronil Regekogs technik 2 NIM input 2 3 Event Trigger 4 End of Event 5 USB Trigger output in Determines the NIM ouput used for the DGG channel Valid values are 1 NIM O1 2 NIM O2 3 NM 03 delay in Sets the delay between the trigger and beginning of the gate in units of 10ns gate in Sets the length of the gate in units of 10ns invert in Determines whether or not the DGG is inverted Valid values are 0 Not inverted 1 Is inverted latch in Determines whether or not the DGG is latched Valid values are 0 Not latched 1 Is latc
46. mmable LAM timeout e optional cycle by cycle skipping of S2 strobe 500ns cycles e stack supports Q stop and address scan mode entries WIENER Plein amp Baus GmbH 5 www wiener d com Wesk f r Industvie elekironik WIENER j z A efkronik Plein amp Baus Elektronil Regeln neo 1 3 CC USB Front panel INH B Q X C ZLED s LAM L1 L2 L4 L8 L16 LED s Station N1 N2 N4 N8 N16 LED s Sub Address Al A2 A4 A8 LED s Function F1 F2 F4 F8 F16 LED s Data 9 10 11 12 13 14 15 LED s Data 9 10 11 12 13 14 15 LED s Data 1 2 3 4 5 6 7 8 LED s WIENER Plein amp Baus GmbH e assetece u stack supports FASTCAMAC mode entries optional readout of sub addresses identified in a previously fetched address pattern block single NAF write of up to 64 kWords 16 or 24 bit block single NAF read of up to 64 kWords 16 or 24 bit Power LED for 6V 6V 3 user LED s red green vellow 3 user inputs Lemo NIM 3 user outputs Lemo NIM Failure LED USB 1 or 2 indicator USB port Aux Controller RQ G in G out Firmware selector 1 4 P1 P4 for programming C1 C4 for use operation www wiener d com Wesk f r Industvie elekivonit WIENER 2 j S efkronik Pp amp Baus Elektronil Regalo techni 1 4 Technical Data Packaging double wide CAMAC module Interface USB2 USB1 auto detecting ranging Connector USB type B
47. nce internally the USB controller of the CC USB is set up as a 16 bit wide FIFO First In First Out Memory the In and Out Packets are organized as collections of 16 bit words For WIENER Plein amp Baus GmbH 24 www wiener d com Wesk f r Industvie efekironik WIENER efekironik Plein amp Baus Elektronik enge er chine the purpose of the software and more specifically of the Windows Application Programming Interface API routines the data are packed in byte wide buffers a process that may remain transparent to the user when proper sets of routines DLLs are used Also much of the technical information on writing and reading back data from the internal devices of the CC USB may be considered redundant when a set of routines is available to perform the task This information is however necessary for writing such routines First 16 bit word in an Out Packet identifies the internal device address for which the packet is intended and whether the packet represents a request for data or represents the data to be stored interpreted to by the target device The latter information is coded in bit 3 value 4 of the header word with bit 3 set to write data The meaning of the second word in the Out Packet depends on the address and represents the sub address in the case of the Register Block and the number of words to follow in the case of the CAMAC Stacks CDS and CSS and the CAMAC NAF Generator CNAF The subsequent word
48. of the registers is shown in Table 2 Table 2 Register sub addresses and their functionality represents the register sub address CAMAC A Register Note Hex Dec 0x0 0 Firmware ID Read Only 32 bits 0x1 1 Global Mode Read Write 16 bits 0x2 2 Delays Read Write 16 bits 0x3 3 Scaler Readout Control Read Write 24 bits 0x4 4 User LED Source Selector Read Write 32 bits 0x5 5 User NIM Output Source Selector Read Write 32 bits 0x6 6 Source Selector for User Devices Read Write 32 bits 0x7 7 Timing for Delay amp Gate Generator A Read Write 32 bits 0x8 8 Timing for Delay amp Gate Generator B Read Write 32 bits 0x9 9 LAM Mask Read Write 24 bits 0xA 10 CAMAC LAM pseudo register Read Only 24 bits 0xB 11 Scaler A pseudo register Read Only 32 bits 0xC 12 Scaler B pseudo register Read Only 32 bits 0xD 13 Extended Delays Register Read Write 32 bits 0xE 14 USB Buffering Setup Register Read Write 32 bits 0xF 15 Broadcast Map notepad register Read 24 bits 3 2 1 Firmware ID Register Read only CAMAC A 07 0x0 Bits 16 31 12 15 8 11 4 7 0 3 Value M Y R R This Firmware ID register identifies the acting FPGA firmware in four hexadecimal digits MYER where M and Y represent the month and year of creation and F and R represent the firmwar
49. og timeout should be made shorter than the software timeout set for bulk read The relevant numbers for multi buffer bulk transfer are stored in the USB Bulk Transfer Setup Register at A 14 OxE such that the number of buffers is specified in bits 0 7 of this register and the timeout is specified in bits 8 11 The 4 bit timeout represents the number of seconds in excess of 1s after which the packet end signal is issued should the specified number of buffers not be completed by that time Note that the default minimum is 1s Bits 12 31 8 11 4 7 0 3 Value Time out Number of buffers 3 2 11 Broadcast MapRegister Write Only CAMAC N 27 A D 0 3 F 4 1 F 0 3 D 4 7 CC USB allows to broadcast Write and Control commands to a number of selected modules identified by bits set in the Broadcast Map Register Because of the internal CC USB architecture writing to this register is done in a byte serial fashion where consecutive bytes of the 24 bit registers are written using CAMAC A 0 3 and CAMAC F 0 3 to encode the data WIENER Plein amp Baus GmbH 20 www wiener d com Wesk f r Industvie elektronik WIENER efekironik Plein amp Baus Elektronik einge er onik To write a byte one issues a CAMAC command with N 27 A equal to low nibble 4 bits of the data byte and F 0 3 equal to high nibble of the data byte F 4 must be set to 1 as for a write command Consecutive commands fill t
50. on of W Ie Ne R CC USB and VM USB are designed by JTEC Instruments WIENER Plein amp Baus GmbH 2 www wiener d com Wesk f r Industvie elekironit WIENER 2 j S elekivonit PI amp Baus Elektronil Regea neo Table of contents 1 General Description anne ee 5 1 1 CC USB Features sorene ee ae secs SEIESTEREE REIN AERLER SAEENARFIENER EEEE 5 1 2 Readout Modes een a O oan eeu TES 5 1 3 CC USB Front panel 6 1 4 Technical ANA PORENRDREREERIENDEENIENERDILENRERSIENUECENFERRTPENEENDUESVIERERVESTENUEUERPLERAUENNERSUELUILRBREEKFEIEEENTF 7 1 5 Pow r Consumption eek en 7 1 6 Block again ee ne ee RT 8 2 CC USB and USB driver installation esus s0cnsscansssonssanacsnanensionnennansssnossunnesensandennseeen 9 2 1 Installation for Windows Operating Systems uueerssessssesssessnenssnensnnnennnnnnnnnnennnnen nen 9 2 2 Installation for Linux Operating Systems nn na 12 2 3 Firmware UDOT ACES een 12 3 General Architecture of CC USB and its User Interface seoessoesssesssesssecssoossoossss 14 3 1 CC USB Resister Bloc eis anna 14 3 1 1 Action Register address 1 FON een 14 32 Internal CAMAC Register File nee 14 3 2 1 Firmware ID Register Read only u a na 15 3 2 2 Global Mode Register read write au 15 3 2 3 Delays Register Read Write une 16 3 2 4 Scaler Readout Control Register Read Write nnnnennnnn 16 3 2 5 User LED and NIM Output Selectors Read Write eenennee 17 3 2 6 User
51. r registers store 32 bit scaler data in a straightforward manner The use of the scalers is described further below 3 2 9 LAM Mask Register Read Write CAMAC A 9 0x9 The LAM Mask Register is a 24 bit register that stores the LAM Mask defining what combination of LAM s triggers event readout during the data acquisition When zero the readout is triggered by a signal applied to the NIM input 3 2 10 USB Bulk Transfer Setup Register Read Write CAMAC A 14 0xE To benefit from the high bandwidth of the USB2 interface one needs to avoid overheads associated with any single transfer operation Therefore one must strive to reduce the number of transfers by extending the length of bulk transfers CC USB by default closes USB buffer generates a packet end either at the end of the data buffer or at the end of event This guarantees bulk transfer lengths of only 8 kBytes for short events and lengths equal to event lengths in the case of long events Such default setting does not allow one to utilize the USB2 bandwidth when short events are acquired and therefore CC USB offers an option to bundle multiple data buffers together for a single bulk USB transfer Since in the case of short events the time of filling multiple buffers is variable the option includes setting of a watchdog timer which will guarantee that a packet end signal is generated at timeout should the data buffers fail to fill sufficiently fast This watchd
52. r than the length of the actual data buffer written by the CC USB into this endpoint The structure of data retrieved in conjunction with direct requests for data addressed to the Register Block and to the CAMAC Stacks is simple such that the buffer consists only of the requested data For write commands CC USB returns only XQ in one 16 bit word when the write command is the last command in the stack to guarantee that there is always at least one word returned as an acknowledgment of a stack execution The data buffers read during the data acquisition process have a structure depending on the mode of buffering i e whether event data are allowed to span two buffers bit 3 of BoffOpt set Additionally there are special rules for treating long events These are discussed at the end of this section For the Integer Event Mode the data buffer has the following structure 1 Header word Bit 15 1 indicates a watchdog buffer bitl4 1 indicates a scaler buffer Bits 0 9 represent the number of events in the buffer 2 Optional 2 Header Word Bits 0 11 represent the number of words in the buffer 3 Event Length Event length including terminator words 4 N1 Event Data N2 Event Terminator OxFFFF not applicable to firmware 0301 and newer N3 Optional 2 Terminator 0x FFFF not applicable to firmware 0301 and newer Subsequent Events N5 Buffer Terminator hex FFFF The unpacking of the events must be done in accordance with the CAM
53. rOpt 0 writes out one header word identifying the buffer type bit 15 1 watchdog buffer bit 14 0 data buffer bit 14 1 scaler buffer and the number of events in buffer When HeaderOpt 1 the second header word is written out listing the number of words in the buffer The WdgFreq bits define the frequency at which the watchdog is forcing writing of output buffer during data acquisition The three bit number represents the time interval in seconds counting from the end of an event after which the watchdog triggers when no new event has been observed The Arbitr Bit when set to 1 activates CAMAC bus arbitration 9 1 3 Delays Register The delays register stores the desired trigger delay from the start signal applied to the NIM input to the actual start of the CAMAC readout least significant 8 bits and the LAM timeout period most significant 8 bits Both delays are in units of us 9 1 4 Scaler Readout Frequency Register The Scaler Readout Frequency Register stores the number defining the frequency at which scalers are to be read out scaler stack is executed during the data acquisition The stored value is equal to the number of data events separating the scaler readout events When the value is zero scaler readout is suppressed WIENER Plein amp Baus GmbH 51 www wiener d com ER en RE 9 1 5 User LED and NIM Output Selectors Numbers stored in these registers identify sources of User LEDs and NIM
54. rch will choose the driver to install Choose this option to select the device driver from a list Windows does not guarantee that the driver you choose will be the best match for your hardware 7 The WIENER CC USB driver should be listed and highlighted in the driver list The driver is not digitally signed which however does not have any effect on it s functionality Press Next to finish the installation WIENER Plein amp Baus GmbH 10 www wiener d com Werk Rir Jndustrie efkironik WIENER A A efkronik Plein amp Baus Elektronik Regekmgss rechnik Install From Disk 5 Insert the manufacturer s installation disk and then make sure that the correct drive is selected below Have Disk Look in CC USB_06_2005 D klo amp demod Dlibusb win32 device bin 0 1 10 1 Dlibxxusb DO xusswin_Install062105 Fersen m Files of type Setup Information inf a 8 The New Hardware Wizard should copy all driver files into the Windows System32 folders and report a successful installation Select the device driver you want to install for this hardware Select the manufacturer and model of your hardware device and then click Next If you CR have a disk that contains the driver you want to install cick Have Disk M Show compatible hardware Model WIENER CAMAC Crate Controller with USB A This driver is not digitally signed Tell m
55. rd set except for the last part Also only the last installment is terminated by the Event Terminator word s CC USB has a provision to automatically change the output buffer packing mode to Split Event mode whenever the Event Length exceeds the length of the Integer Event buffer The occurrence of such a change is indicated by setting of bit 13 in the buffer header word WIENER Plein amp Baus GmbH 30 www wiener d com Wesk f r Industvie elektronik WIENER elekivonit Plein amp Baus Elektronik ee eine er onik 5 GUIDE TO LIST MODE DATA ACQUISITION WITH CC USB CC USB is intended for use in list mode data acquisition where it performs sequences of desired CAMAC operations pursuant to stack s stored in it upon receipt of event trigger CC USB then formats the data read form the CAMAC bus and buffers them in a data buffer When the buffer is full CC USB transfers its content to the In FIFO of the USB controller IC for readout by host software To set up CC USB for data acquisition in list mode the following steps are advised 1 Build the regular CAMAC command stack by adding all the desired simple and complex commands to it One must make sure that the stack sequence will clear all CAMAC modules It is recommended to first execute the stack from the host software to verify that it performs as intended For this purpose the libxxusb library function xxusb stack execute can be used 2 Load the stack into th
56. rn data word Number of Product Terms specifies the number of words in the stack that follow and that constitute bit masks for constructing a logical equation used in deciding whether the given operation is to be performed for the particular hit register data WIENER Plein amp Baus GmbH 27 www wiener d com Ben y F r WIENER fay Pr Plein amp Baus Elektronik egek Jungs The following rules apply i Whenever the Repeat Mode RM Address Scan AS Q Stop or FC bit is set the stack line must be followed by another line defining the maximum number up to OxFFFC 65532 of times the command is to be repeated Note that the large numbers of repetitions are suitable only for single NAF commands ii Whenever a write command is issued in conjunction with the Repeat Mode RM single NAF block write the first data word is to follow the first command line and the remaining words follow the Number of Repetitions word The number of repetitions may be as high as OxFFFC 65532 iii When the Hit Mode HM bit is set the Number of Terms bits must be declared The stack line must be followed by the specified number of data lines representing bit masks BMask 1 to NT to be used in constructing the logical condition for performing the command The logical equation is BMask 1 AND HD BMask 1 OR BMask 2 AND HD BMask 2 OR BMask 3 AND HD BMask 3 OR BMask 4 AND HD BMask 4 i e the command will be performed w
57. s in the buffer if any represent the data to be stored in the target device or the data to be interpreted and acted upon by the target device in the case of the CNAF A detailed description of Out Packets for the four target devices is given below 4 2 Writing Data to the Register Block The Out Packet for writing data to various registers of the register block is composed of the following words 1 Target Address 4 5 the target address of the register Block the write flag bit 3 2 Register Sub Address sub address of a particular register in the block see Table 2 further above 3 Data To be Written a 16 bit data word In the case of the LAM mask register sub address 8 additional 8 bits are sent in the additional fourth word 4 High Bits of the Data 16 bit data word containing 4 3 Reading Back Data from the Register Block To read back data from the Register block one must first send a request Out Packet to the Register Block consisting of two words 1 Target Address 1 the target address identifying the register block 2 Register Sub Address sub address of the register of interest see Table 2 WIENER Plein amp Baus GmbH 25 www wiener d com Wesk f r Industvie efekronik WIENER i SE elekironit Plein amp Baus Elektro Regeln techni 4 4 Writing Data to the CAMAC Command Stacks and to the NAF Generator The Out Packets targeting the two CAMAC Stacks and the CAMAC NAF Generator EASY CAMA
58. st clock network driven by the selected clock signal The use of the scalers is straightforward and entails selecting their respective input sources and enabling their operation by setting the respective enable bits Optionally one may wish to disable them by resetting the respective enable bits or clearing them by writing 1 to the respective reset bits WIENER Plein amp Baus GmbH 49 www wiener d com Werk K r Jadustie efekronik WIENER ee elkironik Plein amp Baus Elektro Regelungs technik 9 APPENDIX B FIRMWARE lt 101 GENERAL ARCHITECTURE OF CC USB AND ITS USER INTERFACE The CC USB presents to the user five internal devices or addresses shown in Table 1 Table 1 Internal devices of CC USB and their addresses Address Device Register Block RB CAMAC Data Readout Stack CDS CAMAC Scaler Readout Stack CSS CAMAC NAF Generator CNAF Common Output Buffer Qi amp WIN 9 1 Register Block The Register Block of CC USB is composed of a number of registers identified by sub addresses as shown in Table 2 Table 2 Register sub addresses and their functionality Sub Register Note address 0 Firmware ID Read only 1 Global Mode Read Write 2 Delays Read Write 5 Scaler Readout Frequency Read Write 6 User LED Source Selector Read Write 7 User NIM Output Source Selector Read Write 8 LAM Mask 24 bits R
59. ster Control Unit USB Controller FX2 CY7C68013 IC OUT FIFO USB Out FIFO Relative to Host IN FIFO USB In FIFO Relative to Host WIENER Plein amp Baus GmbH 8 www wiener d com Werk Rir WIENER Plein amp Baus Elektronik Pregelungs technik 2 CC USB AND USB DRIVER INSTALLATION ATTENTION Observe precautions for handling e Electrostatic device Handle only at static safe work stations Do not touch electronic components or wiring e The CAMAC crate as well as the used PC have to be on the same electric potential Different potentials can result in unexpected currents between the CC USB and connected computer which can destroy the units e Do not plug the CC USB into a CAMAC crate under power Switch off the CAMAC crate first before inserting or removing any CAMAC module For safety reasons the crate should be disconnected from AC mains 2 1 Installation for Windows Operating Systems 1 Switch off the CAMAC crate and remove the power cord Plug in the CC USB on the far right slots normally slot 24 amp 25 and secure it with the front panel screw Switch on the CAMAC crate 2 Insert the driver and software CD ROM into the CD ROM drive of the computer and run the setup program in the XXUSBWin Install folder Define directory for installation and click the installation button XUSBWin_062105 Setup XXUSBWin_062105 Setup Begin the installation by clicking the button below Click this button to install XXUSBW
60. tack as a target Function returns a negative number on a failure Remarks The physical length of the regular stack is 768 16 bit words for CC USB and 768 32 bit words for VM USB The physical length of the periodic scaler stack is 256 16 bit words for CC USB and 256 32 bit words for VM USB While the stack is expected to contain properly encoded sequence of CAMAC CC USB or VME VM USB commands to be performed by XX USB it can store any sequence of numbers 6 9 xxusb_stack_read The xxusb_stack read function first sends a buffer to XX USB causing the latter to write the content of a desired stack to its USB port FIFO and then obtains this content by reading a buffer from the XX USB WORD xxusb_stack_read HANDLE hDevice WORD wStackType WIENER Plein amp Baus GmbH 36 www wiener d com Wesk f r Industvie elekironit WIENER 2 j S elekivonit PI amp Baus Elektronil Regea neo LPDWORD IpStackData j Parameters hDevice in Handle to the XX USB device wStackAddress in Type of the XX USB stack the content of which is to be read Valid types are 0 for the regular stack and 1 for the periodic scaler readout stack IpStackData out Pointer to a variable array that receives the data returned by the operation i e the content ofa XX USB stack Return Values On success the function returns the number of bytes read from XX USB The valid value is twice the length of the stack as the latter s
61. ting with XX USB xxusb_device_open and xxusb_handle close are simply macros creating aliases to usb_open and usb_close functions of the libusb library 6 3 xxusb_serial_open Opens a xxusb device CC USB or VM USB whose serial number is given USB_DEV_HANDLE xxusb_serial_open char SerialString E Parameters SerialString a char string that gives the serial number of the device you wish to open It takes the form VM0009 for a VM_USB with serial number 9 or CC0009 for a CC_USB with serial number 9 Returns LpUSBDevice out Pointer to a variable containing the handle to the controller 6 4 xxusb_device_close The xxusb_device_close function closes the handle to the desired XX USB device obtained by a xxusb_ device open call This function is to be called upon termination of an XX USB session WIENER Plein amp Baus GmbH 33 www wiener d com Werk F r Industvie elekivonit WIENER j Rae efkronik Plein amp Baus Elektronil Regekogs technik WORD xxusb_device_close USB_DEV_HANDLE IpUSBDevice E Parameters IpUSBDevice in Pointer to a variable containing the handle to be closed Return Values Returns negative upon failure Remarks While all xxusb functions rely on the libusb www sourceforge net functions while communicating with XX USB xxusb_device_open and xxusb_handle close are simply macros creating aliases to usb_open and usb_close functions of the libusb library 6 5 xxusb_reset_toggle T
62. tores 2 byte words Function returns a negative number on a failure 6 10 xxusb_stack_execute The xxusb_ stack execute function first sends a buffer to XX USB causing the latter to interprete its content as a series of simple and complex CAMAC commands and to actually execute these commands and to write the returned CAMAC data to the USB port FIFO Then xxusb_ stack execute reads a buffer from XX USB containing the desired CAMAC data WORD xxusb_stack_execute HANDLE hDevice LPDWORD IpData E Parameters hDevice in Handle to the XX USB device IpData in Pointer to a dual use variable array When calling the function the array contains the data encoding the sequence of desired commands CAMAC commands for CC USB and VME commands for VM USB to be performed by XX USB The first element of the array is the number of bytes The following command has to be defined similar to the CAMAC VME command stack see paragraph 4 5 Upon return the array contains the CAMAC CC USB or VME VM USB data respectively Return Values WIENER Plein amp Baus GmbH 37 www wiener d com es F r WIENER Z Pr Plein amp Baus Elektronik Regehr Jungs On success the function returns the number of bytes read from XX USB The valid value is twice the number of 16 bit data words returned plus 2 CC USB or 4 VM USB The latter overhead bytes contain event terminator word OxFF for CC USB and OxFFFF for VM USB Function returns
63. tures storing parameters of all XX USB devices identified Return Values On success the function returns the number of XX USB devices found including 0 A negative return value indicates that the handle to a valid device could not be opened as a result of insufficient privileges It is recommended to retry in Superuser mode 6 2 xxusb_device_open The xxusb_device_open function obtains handle to the desired XX USB device identified by xxusb_devices find command This is the second command to be issued when attempting to establish communication with an XX USB The obtained handle is then to be used while calling various xxusb_ functions that require the handle Upon termination of a XX USB session the handle is to be released by calling xxusb_handle_close WIENER Plein amp Baus GmbH 32 www wiener d com Werk F r Industvie elekivonit WIENER 3 Rae efkronik PI amp Baus Elektronil Regelungs technik WORD xxusb_device_open USB_DEVICE_TYPE IpUSBDevice E Parameters IpUSBDevice in Pointer to a structure storing parameters of the target XX USB devices Return Values On success the function returns the handle to the target XX USB device A negative return value indicates that the handle to a valid device could not be opened as a result of insufficient privileges It is recommended to retry in Superuser mode Remarks While all xxusb functions rely on the libusb www sourceforge net functions while communica
64. w wiener d com Wesk f r Industvie efekironik WIENER efkironik Plein amp Baus Elektronik e eine er onik 6 LIBXXUSB LIBRARY FOR WINDOWS AND LINUX A dedicated library of functions was developed to facilitate the utilization of CC USB and its VME counterpart VM USB This library libxxusb requires the libusbO sys driver to be installed It is in fact a wrapper library for the general use open source libusb win32 library available via www sourceforge net All functions are part of the libxxusb dll libxxusb so dynamically loadable libraries For linux the library is called libxx_usb All the functions are identical to the ones used in Windows All xxusb functions for both 32 bit MS Windows Win98SE WinME Win2k WinXP as well as for Linux rely on the USB library libusb win32 Windows or libusb Linux For further details about these libraries please see www sourceforge net or http sf net projects libusb The following functions are used for both the CC_SUB and its counterpart the VM_USB 6 1 xxusb_devices_find The xxusb_devices_find function retrieves relevant parameters of USB ports of all XX USB devices attached to the host and returns these in an array of proper structures This is the first command to be issued when attempting to establish communication with an XX USB WORD xxusb_devices_find XXUSB_DEVICE_TYPE IpXXUSBDevice E Parameters IpXXUSBDevice out Pointer to an array of struc

Download Pdf Manuals

image

Related Search

Related Contents

Paulmann Salt  Mode d`emploi Pèse-bébé  F MC-16 FAMILY OPERATION MANUAL  Sharp MX-4140N Brochure  

Copyright © All rights reserved.
Failed to retrieve file