Home
CAEN V288
Contents
1. exit 0 sscanf argv 3x amp V288addr sscanf targv x amp craten v288addr UPDATE v288addr For Eltec E 6 VME board init buserr To handle Bus Error if get limits TUTTOK Get information about the boards esci Main Loop for switch makemenu case 0 read_ident break case 1 ch_monitor 1 break case 2 ch_monitor 2 break case 3 ch_monitor 3 break case 4 ch_monitor 4 break case 5 par set break case 6 Speed test break case 7 B 14 18 12 92 V288 User Manual esci break default break B 15
2. b tween the user program and V288 in file Vmcaenet c int caenet_read int caenet_write Declarations of Global Variables defined in the user program extern unsigned extern ushort v288addr craten code these functions are defined VE EEE kkk kkk kk kkk kk A 22 22 22 22 22 22 22 22 I 22 2 2 Xn C A E N SpA Wes VMCAENET C Caenet Package for V288 Module 2 18 12 92 include vmcaenet h V288 User Manual Read data int read data datovme ushort datovme ushort q 0 vme_read v288addr datovme WORD vme_read STATUS amp q WORD return q TUTTOK TIMEOUT Wait resp int wait resp datovme ushort datovme int i 0 ushort 0 while 1 TIMEOUT amp amp 0 vme_read v288addr datovme WORD vme_read STATUS amp q WORD itt return i TIMEOUT TIMEOUT TUTTOK Send comm int send comm vmeaddress datovme unsigned int vmeaddress ushort datovme int i 0 ushort q 0 while 1 TIMEOUT amp amp q Q if vme_write vmeaddress amp datovme WORD return E_BUSERR vme_read STATUS amp q WORD itt return i TIMEOUT TIMEOUT TUTTOK Caenet read Called by user programs to load byte count bytes from CAENET into th
3. This example is to be used as guides in creating a communication software between the V288 and an H S CAENET SLAVE module B 1 18 12 92 V288 User Manual 57 EJ 7 Ay CQ e Ada N SpA Pa VMCAENET H Declarations for communication with V288 Module KK EEE EEE EZ Ck Ck kk kkk kkk kkk 2 2 22 22 2 2 2 2 22 22 22 22 22 22 I 2 2 2 2 2 2 2073 ifndef uchar define uchar unsigned char endif ifndef ushort define ushort unsigned short endif define define define WOR LWO an D RD Errors returned by caenet read and Constants for vme cycles routines BYTI caenet_write the positive ones are depending from V288 Module and not from CAENET network define define define define define define define define define Number define define define define define define define Interfac TUT _N _N N N N N pi pj Dd d d TOK O Q IDE CRAT O_Q_CODE O DATA O Q TX RX ESSDATA EB USERR of iterations before deciding that V288 does not answer TIM Q V28 EOUT 8 Registers of V288 Module CO EO aL ushort Oxfffe 1 STATUS v288addr 0x02 TXMIT v288addr 0x04 LOBYTE x uchar x amp 0xff HIBYTE x uchar x amp Oxff00 gt gt 8
4. if response caenet_read char amp ch read i sizeof struct hvrd TUTTOK gotoxy 1 22 printf Caenet read Error number d received n response puts Press any key to continue ny getch return code MAKE_CODE channel READ SETTINGS if response caenet_read char amp ch set i sizeof struct hvch TUTTOK gotoxy 1 22 printf Caenet read Error number d received n response puts Press any key to continue ys getch return Then test if this group is present in the sistem if ISPRESENT 0 gotoxy 1 22 puts Sorry this group is not present puts Press any key to continue getch return If the group is present display the information if page Page 0 of display for i 0 i lt 16 i B 10 18 12 92 V288 User Manual gotoxy 1 1 5 printf 9s ch set i chname gotoxy 12 1 5 printf 07 2 07 2 07 2 07 2 07 2 07 2 4x 2d ch read i vread scalev ch read i iread scalei ch set i vOset scalev ch set i iO0set scalei ch set i vlset scalev ch set i ilset scalei ch set i flag chs ti else Page 1 of display for i 0 i lt 16 i gotoxy 1 1 5 printf 9s ch set i chname gotoxy 14 1 5 printf 4d 3d 3d 05 1f 4x 2d n ch set i vmax ch set i rup ch set i
5. Node and a Control logic microprocessor based with dedicated firmware which integrates the functions of Node controller with Network error reporting and H S CAENET interrupt handler The Control logic directly controls the on board H S CAENET Node and its multiplexing logic interfaces the 16 bit VME data bus with the two 8 bit FIFOs so as they are seen by VME as 16 bit buffers It receives commands from a VME Master in a way that few standard VME cycles allow the user to easily control the serial communication on the H S CAENET network the communication is performed according to the typical MASTER SLAVE communication protocol where the VME Master assumes the H S CAENET MASTER function The Module is an A24 D16 VME Slave it is composed of a collection of registers for the operation control and two memory buffer for the data packets transmitted and received arranged in a FIFO logic 16 bit wide 256 word deep see Fig 1 1 The Status Register content indicates whether the previous H S CAENET Operation has been successfully performed in particular shows when the valid data are read from the Receive Data Buffer In the memory buffer for the received data are also stored error messages generated by the Control logic when the H S CAENET operation has failed The module operations can be software controlled in polling mode or can be handled via interrupt facility It houses a VME ROAK INTERRUPTER 1 that generates a VME interrupt if enabl
6. Read only Base Address 00 Receive data storage Buffer Status Read only Base Address 02 After an H S CAENET op Register eration has been performed the Status Register bit 0 indicates whether the operation is valid or not 0 Valid Operation 1 No Valid Operation Transmission Write only Base Address 04 By writing into this register Register the Transmit Data Buffer content is transmitted on the cable Base Address 06 Modules Reset Interrupt Vector Write only Base Address 08 Interrupt vector program Register ming register 11 18 12 92 V288 User Manual 4 3 TRANSMIT DATA BUFFER Base Address 0 write access This is the buffer which is loaded with the data packet to transmit it is arranged in a FIFO logic 16 bit wide the data packet transmitted is composed of 16 bit words as shown in Tab 5 1 4 4 RECEIVE DATA BUFFER Base Address 0 read access This is the buffer where the H S CAENET Node automatically stores the data packet received from the SLAVE or if the H S CAENET operation has failed the Control Logic stores an error code It is arranged in a FIFO logic 16 bit wide the data packet received is composed of 16 bit words as shown in Tab 5 2 4 5 STATUS REGISTER Base Address 2 read only The LSB bit ofthe V288 Status Register indicates if the previous H S CAENET Operation handled via VME is valid or not Status Register bit 0 1 No valid operation Status Register bit 0 0 Valid
7. channel char sy403ident 12 loopdata l2 char tempbuff 22 code IDENT To see if sy403 is present if response caenet_read tempbuff 22 TUTTOK amp amp response E_LESSDATA printf Caenet_read Error number d received n response puts Press any key to continue getch return for 1 0 1 lt 11 1 sy403ident i tempbuff 2 i 1 sy403ident 1 0 puts Looping press any key to exit Loop until one presses a key while _gs_rdy 0 1 if response caenet_read tempbuff 22 TUTTOK amp amp response E LESSDATA printf Caenet_read Error number d received n response puts Press any key to continue getch return for i 0 i lt 11 i loopdata i tempbuff 2 i 1 loopdata i 0 if strcmp sy403ident loopdata Data read in loop are not good printf Test loop error String read s n loopdata puts Press any key to continue getch return end while getch B 13 18 12 92 V288 User Manual Esci void esci clrscr deinit buserr Kill my Bus Error Handler exit 0 Main Program void main argc argv int argc char argv if argc 3 puts Usage vmesy403 lt v288 vme address in hex gt lt sy403 Caenet number in hex gt
8. operation The bits from 1 to 15 are unused and are read as one After one of the following operations the user is recommended to read the Status Register write data in the Transmit Data buffer it indicates if the datum written has been stored or not in the Transmit Data Buffer a No valid operation means that the Transmit Data Buffer is not available for data storage This may happen in these cases if the H S CAENET Node is active it is transmitting a previous data packet or it is receiving the SLAVE response data packet if the Transmit Data Buffer is full the maximum number of data stored is 256 write in the Transmission Register Start data packet transmission it indicates if the Start Transmission command has been recognized by the Mod V288 a No valid operation means that the H S CAENET Node is not able to transmit data This may happen if the H S CAENET Node is active it is transmitting a previous data packet or it is receiving the SLAVE response read data from the Receive Data Buffer it indicates if the data read is valid or not 12 18 12 92 V288 User Manual 4 6 TRANSMISSION REGISTER Base Address 4 write only An access in writing at this location enables the V288 Control Logic to transmit on the cable the data stored in the Transmit Data Buffer If this operation is performed with the Transmit Data Buffer empty The Control logic stores an error message in the Receive Data Buffer erro
9. receive the data and only the SLAVE addressed then accesses the serial line to transmit the data requested by the MASTER In this way is possible from a single point to control up to 100 SLAVEs 15 18 12 92 V288 User Manual 5 3 MASTER TO SLAVE DATA COMPOSITION The MASTER to SLAVE data have to be written in the Transmit Data Buffer by performing subsequent write accesses to the address Base 0 and should have the following structure Table 5 1 MASTER to SLAVE data composition Order Operation Address Datum Meaning 4 Ad 0 See S CAENET Controller identified code Write Base Ad 0 OOXX SLAVE address code 0 99 performed 256 5 4 SLAVE TO MASTER DATA COMPOSITION The answer data coming from the SLAVE or a Control Logic error message is stored into the V288 Receive Data buffer The VME Master can get it by performing subsequent read accesses to the address Base 0 The following Table shows the structure of the SLAVE data packet Table 5 2 SLAVE to MASTER data composition Order Operation Address Datum Meaning Base Ad 0 2 to 255 Ad 0 Eventual Parameter value The first data of the packet is read and checked by the Control Logic as shown in 3 4 5 The Error codes are described in Tab 5 3 16 18 12 92 V288 User Manual 5 5 ERROR CODES The Error codes are described in the following Table Table 5 3 Error Codes Hex eee et 28 1 Successful operation FF
10. 11 i sy403ident 1 tempbuff 2 i 1 sy403ident i 0 printf The module has answered s n sy403ident puts Press any key to continue getch Get limits int get limits int response code READ_LIMITS if response caenet read amp max vi sizeof struct vi max TUTTOK printf Caenet read Error number d received n response puts Press any key to continue getch return response Ch monitor void ch monitor group int group int i caratt P response chs group 1 16 static float 10 1 0 10 0 100 0 B 9 18 12 92 V288 User Manual float scalei scalev ushort channel static int page 0 static struct hvch ch_set 16 Settings of 16 chs static struct hvrd ch_read 16 Status of 16 chs 10 vi decv group 1 1 10 max_vi deci group 1 clrscr highvideo if page puts Channel Vmon Imon Voset I0set Viset Ilset Flag ch ys else puts Channel Vmax Rup Rdwn Trip Status Ch4 normvideo gotoxy 1 23 puts Press P to change page any other key to exit while caratt P Loops until someone presses a key different from P First update from Caenet the information about the channels for 1 0 1 lt 16 1 channels uchar chs i code MAKE_CODE channel READ STATUS
11. ENET operation has failed The Module is an A24 D16 VME Slave Its Base Address is programmable through dip switches located on the Board The module operations can be software controlled in polling mode or can be handled via interrupt facility It houses a VME ROAK INTERRUPTER 1 that generates a VME interrupt if enabled as soon as the data packet or the error message is stored in the receive buffer The communication line uses a simple 50 ohm coaxial cable as physical medium The data transfer rate is 1 MBaud A functional block diagram is shown in Fig 1 1 18 12 92 V288 User Manual H S CAENET NODE TX Serial data lt 0 7 gt VO DB lt 0 15 gt MUX LOGIC 502 coaxial cable CAENET SERIAL x INTERFACE VME INTERFACE RESET REGISTER i i TRANSMIT CLOCK 3 MHz Man RESET LOGIC p cH REGISTER DB lt 0 7 gt INTERRUPT VECTOR REG INTERRUPTER w 2 OD SW3 4 YME BUS Fig 1 1 Mod V288 block diagram 18 12 92 V288 User Manual 2 SPECIFICATION 2 1 PACKAGING 1 unit wide VME module 2 2 EXTERNAL COMPONENTS refer to Fig 2 1 CONNECTORS No 1 SERIAL LINE LEMO 00 type 50 Ohm connector connector for the H S CAENET communication line LEDs No 1 DATA red LED is On when the H S CAENET Node is active SWITCHES No 1 RESET push button by pushing this button the V288 enters in restart mode this causes the following operations the b
12. FD No data to be transmitted it has tried to start a transmission with the Transmit data Buffer empty i FFFE The H S CAENET Controller identifier is incorrect Control Logic error message FFFF The addressed SLAVE does not exist This message are generated after a period of 500 msec Control Logic error message All the other possible error codes from the SLAVE module have the format FFnn where nn can be any number 18 12 92 V288 User Manual 6 REFERENCES 1 VMEbus specification Manual Revision C 1 October 1985 17 07 01 V288 User Manual APPENDIX A SOFTWARE BUGS AS OF SEPTEMBER 1992 This appendix contains the software bugs recognized as of September 1992 A 1 H S CAENET OPERATION BUGS If one of the SLAVE in the H S CAENET Network has the address code 0 the Network communications do not work Do not use SLAVE address code 0 18 12 92 V288 User Manual APPENDIX B SOFTWARE EXAMPLES The detail of using the Mod V288 to communicate with an H S CAENET SLAVE are explained by means of complete examples VMECAENET H Declaration for communication via VME with the Mod V288 VMCAENET C Caenet Package for V288 Module These two listings describes the function and general design of a driver for the Mod V288 all the possible errors are handled included the VME Buserror VMESY403 C Demonstration on the use of Caenet Routines in communication between V288 module and the SY403 HighVoltage System
13. NET NETWORK IMPLEMENTATION CAEN APPROACH 15 5 3 MASTER SLAVE DATA COMPOSITION 17 5 4 SLAVE TO MASTER DATA COMPOSITION 17 5 5 ERROR CODES 18 6 REFERENCE S deadessateenddediaaddvaatinedaeateadyys 19 APPENDIX A SOFTWARE BUGS AS OF SEPTEMBER 1992 A 1 H S CAENET OPERATION BUGS A 1 APPENDIX B SOFTWARE 5 B 1 18 12 92 V288 User Manual 1 DESCRIPTION 1 1 FUNCTIONAL DESCRIPTION The Model V288 HIGH SPEED 5 VME CONTROLLER has been designed to control an H S CAENET network through the VME bus It houses an H S CAENET Node and a Control Logic microprocessor based which integrates the functions of Node controller and Network error handler Standard VME cycles allow the user to easily control the serial communication on the H S CAENET network according to the typical MASTER SLAVE communication protocol where the VME controller assumes the MASTER function It is composed of a collection of registers for the operation control and two memory buffers for the data packet transmitted and received arranged in a FIFO logic 16 bit wide 256 word deep In the memory buffer for the received data are also stored error messages generated by the on board Control logic when the H S CA
14. ODE OPERATION 6 3 3 THE MOD V288 H S VME CONTROLLER 6 3 4 MOD V288 OPERATING MODES 7 RESET intestatus br dis 7 9 4 2 STATUS REGISTER tito aem tote ere ea 7 3 4 3 DATA PACKET STORAGE 7 3 4 4 START TRANSMISSION 8 3 4 5 WAITING FOR THE SLAVE RESPONSE 8 3 4 6 READING THE RESPONSE eene 9 3 5 V288 SLAVE COMMUNICATION 10 4 VME INTERFAQGE citt eor ntt ortos 11 4 1 V288 ADDRESSING 11 4 2 V288 DATA TRANSFER 11 4 3 TRANSMIT DATA 12 4 4 RECEIVE BUFFER thee heran hei tot bnt nes nahen 12 4 5 STATUS REGISTER iiit ttt et I etse reste trees a 12 4 6 TRANSMISSION REGISTER is 13 4 7 RESET REGISTER eter iecore eve sata en Eire 13 4 8 INTERRUPT VECTOR 13 4 9 V288 INTERRUPTER CAPABILITY esses 13 4 10 V288 INTERRUPT LEVE etit a Res 13 D CAEN PROTOCOL te pee 15 5 1 H S CAENET NETWORK FOR REMOTING CONTROL 15 5 2 H S CAE
15. RE ON WHEN DOT IS VISIBLE S W3 IN zRRLPTLEvELZ zl Hz 0 Fig 4 1 Mod V288 dip switches setting 14 18 12 92 V288 User Manual 5 C A E N PROTOCOL 5 1 H S CAENET NETWORK FOR REMOTING CONTROL H S CAENET provides a unique way of remotely controlling passive electronic modules modules which have not been designed for specific data acquisition purposes and therefore have no bus interfaces like CAMAC or VME NIM modules Delay Units Attenuators Amplifiers I O registers as well as supplies have several parameters which need to be adjusted under computer control many CAEN units houses an H S CAENET Node inside the module that allows the possibility of linking devices of different types and functionality with a central controller 5 2 H S CAENET NETWORK IMPLEMENTATION CAEN APPROACH CAEN has developed a transmission protocol via H S CAENET line that permits the monitoring and control of many CAEN units from a single controller This network has the following structure and protocol The transfers between H S CAENET Nodes take place according to the typical MASTER SLAVEs communication There is a single MASTER H S CAENET Controller The SLAVEs are daisy chained on the network and are identified by an address code from 0 to 99 the address is usually selectable via thumb wheel switch located on the front panel of the module the H S CAENET MASTER initiates the transmission all the SLAVEs
16. Technical Information M anual Revision n O 22 December 1992 MOD V 288 5 CAENET VMECONTROLLER 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 TABLE OF CONTENTS TABLE T i 1 DESCRIPTO N 1 ctii ea iei cee 1 1 1 FUNCTIONAL DESCRIPTION iii 1 2 SPECIFICATION are aan od jeden nah naar 3 2 1 PACKAGING 3 2 2 EXTERNAL COMPONENTS innt ae eine dee dan 3 2 3 INTERNAL EA EAA A 3 2 4 OWER REQUIREMENTS etn E eR eani Ra var ix 3 3 OPERATING MODE tb etate RD 5 3 1 H S CAENET NETWORK 5 3 2 H S CAENET N
17. VEs receive the data and only the SLAVE addressed then accesses the serial line to transmit the data requested by the MASTER The maximum data packet length is 512 bytes An external clock source provides the basic time reference in the Node the clock frequency is three times the data transfer rate Actually the clock frequency used in the H S CAENET network is 3 MHz 1 MBaud transfer rate The Node is seen as an 8 bit pheripheral device composed of a collection of registers and two memory buffers arranged in FIFO logic It generates an interrupt H S CAENET interrupt upon the completion of a transmission of a data packet the reception of a data packet when the RX FIFO has been completely unloaded 18 12 92 V288 User Manual 3 2 H S CAENET NODE OPERATION The basic operation of the H S CAENET Node consists in 3 distinct modes Transmit Receive and Restart mode n the Transmit mode the Node accesses the data stored in the TX FIFO and transmits them on the cable In the Receive mode the serial packet is stored in the RX FIFO n Restart mode the Node does not execute any commands all the TX and RX buffers are cleared and the H S CAENET interrupt is removed it remains in this mode until it detects that the line is clear 3 3 THE MOD V288 H S CAENET VME CONTROLLER The Model V288 H S CAENET VME CONTROLLER has been designed to easily control an H S CAENET network through the VME bus It houses an H S CAENET
18. e Receive Data Buffer read the Status Register if Status Register No Valid Operation discard the data and repeat the two read operation if Status Register Valid Operation accept the data read it may be the first data of the SLAVE response data packet or a Control Logic error message go to the Read Response section Read SLAVE response read the Receive data buffer read the Status Register if Status Register Valid Operation accept the data read and repeat the two read operations if Status Register No Valid Operation discard the data read and exit the Receive Data Buffer is empty 10 18 12 92 V288 User Manual 4 VME INTERFACE 4 1 V288 ADDRESSING CAPABILITY The module works in A24 mode this means that the module address must be specified in a field of 24 bits The Address Modifiers recognized by the module are AM 39 Standard user data access AM 3A Standard user program access AM 3D Standard supervisor data access AM Standard supervisor program access The module s Base address is fixed by dip switches located on the board see Fig 4 1 The Base address can be selected in the range 9600 0000 lt gt FF FFFO 4 2 V288 DATA TRANSFER CAPABILITY The registers and the buffers are accessible in D16 mode Table 4 1 Mod V288 Registers NAME TYPE ADDRESS FUNCTION Transmit Data Write only Base Address 00 Transmit data storage Buffer Receive Data
19. e buffer pointed by dest buff The VME address of V288 the CA B 3 EN ET crate number and the 18 12 92 V288 User Manual CAENET code are found in global variables Caenet_read returns TUTTOK 0 if everything has worked It returns one from seven different errors defined as positive constants in Vmcaenet h if it has received one error which strictly depends from V288 Module It returns a negative error depending from the CAENET slave module if the CAENET communication has not worked Remember Module V288 can return thr general negativ rrors related to the CAENET network that this routine does not handle separately from the slave specific ones int caenet read dest buff byte count uchar dest buff int byte count int i esito ushort mstident V288 datatemp short dato if esito send_comm v288addr mstident TIMEOUT return E_NO_O_IDENT lse if esito E BUSERR return esito Transmit Crate Number if esito send comm v288addr ushort craten TIMEOUT return E NO Q CRATE lse if esito E BUSERR return esito Transmit Code 7 f esito send comm v288addr ushort code TIMEOUT return E NO Q CODE lse if esito E BUSERR return esito p Start Transmission if esito send comm TXMIT mst
20. eated 7 10 14 91 Updated System Software Version 1 08 11 15 91 Updated System Software Version 1 27 7 04 01 92 Updated System Software Version 1 40 Je KK Ck Ck A kk kk kk kk kk kk 2 2 22 22 22 2 2 22 2 2 2 2 A 22 22 22 22 22 22 22 22 22 22 22 22 2 2 EX include lt stdio h gt include lt strings h gt include vmcaenet h ifndef uchar define uchar unsigned char endif ifndef ushort define ushort unsigned short endif define ESC 0x1b define CR 0x0d define BLANK 0x20 define EUROCOM 0xff000000 define IDENT 0 define READ STATUS 1 define READ_SETTINGS 2 define READ LIMITS 3 define VOSE 0 define VISE 1 define IOSE 2 define I1SE 3 define VMAX 4 define RUP 5 define RDWN 6 define TRIP 7 define ISPRESENT x ch_read x status amp 1 lt lt 2 define MAKE_CODE ch cod ch lt lt 8 cod The following macro transforms the V288 input address in a good VME address for Standard Accesses by Eltec CPU board define UPDATE addr unsigned int EUROCOM addr The following structure contains all the useful information about the settings of a channel struct hvch char chname 12 B 7 18 12 92 long vOset long vlset short i0set short ilset short vmax short rup short rdwn short trip ushort flag The following structure contains a
21. ed as soon as the data packet or the error message is stored in the receive buffer The interrupt vector is software programmable while the interrupt level is selectable via dip Switches The Mod V288 registers are described in the Table 4 1 18 12 92 V288 User Manual 3 4 MOD V288 OPERATING MODES The following paragraphs describe the various operations that can be performed via VME and the use of the V288 registers to accomplish an H S CAENET communication 3 4 1 RESET It is possible to reset the Mod V288 in these ways by pushing the Front Panel push button RESET by writing via VME at the address Base 6 Reset Register After one of these operation the V288 enters in Restart Mode this causes the following operation the buffers are cleared every VME interrupt pending is cleared every data transfer is aborted the V288 does not accept any command It remains in this status for about 3 msec 3 4 2 STATUS REGISTER The LSB of the V288 Status Register indicates if the previous H S CAENET Operation handled via VME is valid or not The RESET operation see above is not considered as a H S CAENET operation thus the content of the Status Register is not valid after a RESET Status Register bit 0 1 No valid operation Status Register bit 0 0 Valid operation The Status Register is available at the VME address Base 2 3 4 3 DATA PACKET STORAGE The data to be transmitted are stored i
22. emp short dato if esito send_comm v288addr mstident return E NO Q IDENT lse if esito E BUSERR return esito Transmit Crate Number TIMEOUT if esito send comm v288addr ushort craten TIMEOUT return E NO Q CRATE lse if esito E BUSERR return esito Transmit Code if esito send_comm v288addr ushort code return E_NO_O_CODE lse if esito E BUSERR return esito Transmit data for i 0 i lt byte_count i 2 TIMEOUT datatemp ushort source buff i 8 source buff i l if esito send_comm v288addr datatemp return E_NO_O_DATA lse if esito E_BUSERR return esito Start transmission TIMEOUT if esito send comm TXMIT mstident TIMEOUT return E NO Q IX lse if esito E BUSERR return esito if wait resp amp dato TIMEOUT return E NO RX return dato B 5 18 12 92 V288 User Manual B 6 18 12 92 V288 User Manual Va EEE A kk kk 22 22 22 kkk kk kk k A 22 22 22 22 22 2 2 22 I 22 2 2 EX i C is r SPA 7 ess RK VMESY403 C Demonstration on the use of Caenet Routines in VA communication between V288 module and SY403 High FX Voltage System Version 1 06 X Jet 06 05 91 Cr
23. ice Decode scale pow10 max vi decv channel 16 input value scale value ushor break case VISET t input value code MAKE DE channel 17 scale pow10 max_vi decv channel 16 input_value scale value ushor break case IOSET t input_value code MAKE_CO DE channel 18 scale pow10 max_vi deci channel 16 input_value scale value ushor break case 15 t input_value code MAKE _ DE channel 19 scale pow10 max_vi deci channel 16 input_value scale value ushor break case VMAX co t input_value code MAKE_ value ushor break case RUP co DE channel 20 2 input value code MAKE_ DE channel 21 value ushor break case RDWN t input_value code MAKE_CO DE channel 22 value ushor break case TRIP t input_value code MAKE _ DE channel 23 B 12 the parameter the value the par xf x 18 12 92 V288 User Manual input_value 10 Trip is in 10 th of sec value ushort input value break if response caenet_write amp value sizeof ushort TUTTOK printf Caenet write Error number d received n response puts Press any key to continue getch Speed test void speed test int i response ushort
24. ident TIMEOUT return E NO Q IX lse if esito E BUSERR return esito if wait resp amp dato TIMEOUT return E NO Q RX if dato TUTTOK Test on the operation for i 0 i lt byte_count it 2 if read_data amp datatemp TIMEOUT amp amp i byte count 1 return E_LESSDATA dest buff i HIBYTE datatemp dest buff i 1 LOBYTE datatemp return dato Caenet write Called by user programs to transfer byte count bytes to CAENET from the buffer pointed by source buff B 4 18 12 92 V288 User Manual The VME address of V288 the CAENET crate number and the CAENET code are found in global variables Caenet_write returns TUTTOK 0 if everything has worked It returns one from seven different errors defined as positive constants in Vmcaenet h if it has received one error which strictly depends from V288 Module It returns a negative error depending from the CAENET slave module if the CAENET communication has not worked Remember Module V288 can return thr general negativ rrors g related to the CAENET network that this routine does not handle separately from the slave specific ones int caenet write source buff byte count uchar source buff int byte count int i esito ushort mstident V288 datat
25. ll the the status of a channel struct hvrd long vread short ireag ushort status V288 User Manual useful information about The following structure contains all the useful information about the voltage and current limits of every board AY struct vi_max short vmax 4 short imax 4 short resv 4 short resi 4 short decv 4 short deci 4 Globals int y File conio c needs it unsigned v288addr craten ushort code Caenet code struct vi max max vi akemenu int makemenu Int i puts MAIN MENU normvideo puts 0 Read Module Identifier puts 1 Channels 0 15 Monitor puts 2 Channels 16 31 Monitor puts 3 Channels 32 47 Monitor puts 4 Channels 48 63 Monitor puts 5 Parameter Setting ir puts 6 Speed test s B 8 n n n 7 18 12 92 V288 User Manual n n 7 Quit while c getch 0 lt 0 c gt 7 return c Read Ident void read ident int i response char sy403ident 12 char tempbuff 22 code IDENT To see if sy403 is present if response caenet read tempbuff 22 TUTTOK amp amp response E LESSDATA printf Caenet_read Error number d received n response puts Press any key to continue getch return for i 0 i lt
26. n the TX FIFO by performing subsequent VME write accesses to the address Base 0 Transmit Data Buffer The buffer is arranged in FIFO logic 16 bit wide After any writing operation the user is recommended to read the content of the Status Register A No valid operation means that the Transmit Data Buffer is not available for data storage This may occur in these cases if the H S CAENET Node is active it is transmitting a previous data packet or it is receiving the SLAVE response data packet if the Transmit Data Buffer is full the maximum number of 16 bit data stored is 256 18 12 92 V288 User Manual 3 4 4 START TRANSMISSION An access in writing to the VME address Base 4 Transmission Register enables the Control logic to transmit on the cable the data packet stored in the Transmit Data Buffer The logic first check ifthe Buffer is empty if not the logic sets the H S CAENET Node in the Transmit mode and the data packet is transmitted on the cable f the Buffer is empty the control logic does not activate the transmission and write an error code in the Receive data buffer error FFFD see Tab 5 3 The content of the Status register indicates if the Start Transmission command has been recognized by the Control logic a No valid operation means that the H S CAENET Node is not able to transmit data This may happen if the H S CAENET Node is active it is transmitting a previous data packet or it is receiving
27. on operation the user reads the content of the Receive Data Buffer address Base 0 and successively the Status Register address Base 2 this two read operations must be repeated until a Valid Operation is contained in the Status Register this means that the data read is the first data of the Response VME interrupt The generation of the VME interrupt means that valid data are present in the Receive Data Buffer Then the reading of the Receive Data buffer and the Status Register must be repeated until a No valid operation is obtained 18 12 92 V288 User Manual 3 5 V288 SLAVE COMMUNICATION SEQUENCE The operations previously described are summarized in the following report write the data packet in the Transmit Data Buffer in the packet is contained the H S CAENET address of the SLAVE see Tab 5 1 for the data structure for each data write the data in the Transmit Data Buffer read the Status Register if Status Register Valid operation the data is stored in the buffer error else Transmit the data packet Access in write the Transmission Register read the Status Register if Status Register Valid Operation the V288 H S CAENET Node enters in the transmit mode and the data packet stored is transmitted on the cable error Wait for the SLAVE response if the Interrupt is enabled else wait for V288 interrupt else read th
28. r FFFD see Table 5 3 4 7 RESET REGISTER Base address 6 write only An access in writing to this location causes the V288 to enter in restart mode this causes the following operations the buffers are cleared every interrupt pending is cleared every data transfer is aborted the V288 does not accept any command It remains in this status for about 3 4 8 INTERRUPT VECTOR REGISTER Base address 8 write only The value written in this 8 bit register is the STATUS ID that the V288 INTERRUPTER places on the VME data bus during the Interrupt Acknowledge Cycle 4 9 V288 INTERRUPTER CAPABILITY The V288 module houses ROAK INTERRUPTER type 1 This means that it responds to 8 bit 16 bit and 32 bit interrupt acknowledge cycles providing an 8 bit STATUS ID on the VME data lines 000 007 it removes its interrupt request when the VME Master reads the V288 STATUS ID during the Interrupt Acknowledge Cycle ROAK Release On Acknowledge 4 10 V288 INTERRUPT LEVEL The interrupt level corresponds to the value set on the two dip switches SW4 SW3 as described in Fig 4 1 13 18 12 92 V288 User Manual 1 COMPONENTS SIDE ad 21 v6 8 All 19 LEYO I RRUPTLEVZL LEVI m LI SWITCHES Ad TAI OFF SWS A 2T2AI9 IFE IN 0 SAS 2 IQ AUS CH 1 ON U SW4 IH RRLPTLENELC TO 1 CIT OH 0 DIP SWITCHES A
29. rdwn ch set i trip 10 0 ch read i status chs i Test the keyboard if gs rdy 0 1 A key has been pressed if caratt toupper getch P They want to change page highvideo page page clrscr if page 0 puts Channel Vmon Imon VOset IOset Vlset Ilset Flag ch else puts Channel Vmax Rup Rdwn Trip Status Ch normvideo gotoxy 1 23 puts Press P to change page any other key to exit End while set void par set float input_value scale static float powlO 1 0 10 0 100 0 ushort channel value int y response par 0 char choiced_param 10 static char param vOset vlset i0set ilset vmax rup rdwn trip B 11 18 12 92 elrsck printf n n Channel scanf d amp i channel uchar i puts Allowed parameters for 1 0 1 lt 8 1 puts param i while par printf n Parameter to set lowercase only scanf 5 param for 1 0 1 lt 8 1 288 User Manual Choice the channel are Choic if stremp paramli choiced param par 1 break i 8 puts if Sorry printf New value Scanf f amp input value switch i case VOSET code MAKE_CO DE channel 16 this parameter is not allowed Cho
30. the SLAVE response If a valid operation is contained in the Status register the user will receive the SLAVE Response or a Control logic message within a maximum period of 500 msec SLAVE Response Time out The Response is available at the address Base 0 Receive Data Buffer 3 4 5 WAITING FOR THE SLAVE RESPONSE The Control logic waits for the SLAVE Response for about 500 msec if no data packet is received within this period the Control logic stores an error code in the Receive Data Buffer error FFFF see table 5 3 If a data packet is received from the cable within the SLAVE Response Time out the Control logic checks if it has the correct header if not clears the Receive Data Buffer and stores in it an error code error 96 FFFE see table 5 3 After these operation the Receive Data Buffer contains valid data an error code or the SLAVE response for the VME Master that has initiated the H S CAENET communication At this point the Control logic enables the VME reading and if the interrupt level selected on the dip switches is different from 0 a VME Interrupt on the corresponding IRQ line 1 is generated 18 12 92 V288 User Manual 3 4 6 READING THE RESPONSE The User after the transmission of the data packet expects a response in the Receive Data Buffer the presence of valid data can be recognized in two different ways In polling mode or by the use of the VME interrupt Polling mode After the Start Transmissi
31. uffers are cleared every VME interrupt pending is cleared every data transfer is aborted the V288 does not accept any command It remains in this status for about 3 msec 2 3 INTERNAL COMPONENTS SWITCHES No 3dip switches SW2 SW5 SW6 These dip switches allow the selection of the VME Base address No 2 dip switches SW3 SW4 These dip switches allow the selection of the VME interrupt level 2 4 POWER REQUIREMENTS SV 2A 18 12 92 V288 User Manual on Fig 2 1 Mod V288 Front Panel 18 12 92 V288 User Manual 3 OPERATING MODES 3 1 H S CAENET NETWORK OPERATION H S CAENET Network is a send and receive half duplex system It permits asynchronous serial transmission of data packet along simple 50 ohm coaxial cable Several devices H S CAENET Nodes are able to share the same media to transmit and receive data Each Node is able to receive the serial data packet and store it automatically in the RX FIFO and to transmit the data contained in the TX FIFO Both FIFOs are 512 byte deep The H S CAENET Node listen for clear coax before transmitting but it is not able to detect collisions on the cable for this reason it is important to avoid line contention i e the Nodes should not attempt to transmit at the same time Usually transfers between H S CAENET Nodes take place according to the typical MASTER SLAVES communication there is a single H S CAENET MASTER that initiates the transmission all the SLA
Download Pdf Manuals
Related Search
Related Contents
MKN SpaceCombi Classic Junior und GS2-Display 1800 - stellarsupport global Istruzioni Combi - Systec Therm AG SIEIDrive ADV20 - Bonita International General Trading Co Beckett 7600 Boiler User Manual Document technique intext:Bedienungsanleitung filetype:pdf ET1215L con pantalla LCD de 12 Copyright © All rights reserved.
Failed to retrieve file