Home
Ethernet CAMAC Crate Controller User`s Manual
Contents
1. Ver Date ZP Engineering srl JENET Ethernet based CAMAC controller Ethernet CAMAC Crate Controller I N P u s ETHERNET we CAMACCRATE Z CONTROLLER WWW zpeng com jenet User s Manual JNTO1 2 2 0b December 27 2007 APPLIES TO FIRMWARE VERSION FROM 2 07 via Ardito Desio 60 00131 Rome ITALY www zpeng com ZP ENGINEERING srl JENET User s Manual v 2 2 0 1 43 JENET Ethernet based controller INDEX 1 General information 4 Tol EU 4 1 2 System OVERVIEWS uev 5 1 3 Summary of features 2 4 1 sea sea sea sua sea sea sea seas nnn n nnn 5 Pag 6 3 Serial port control ii secretes LIPS UA auqa qaqquskuqq awa 7 4 Startup ODLIO IS cesiceiisseesee tenis cles 8 4 1 Startup flags s deiecti ADO GSS AY 8 4 2 Jumper Settings emer ex x runc ime eure ute ER ane PLUR PRI UL EE EU DU MR Loc 9 5 Remote controls et eh ber ce tae rt ee e aa Epi AERE DA eee 10 521 TCP ASCIE Control socket niei saya ap vil ees xu ubi VI wa k Va 11 5 2 TCP binary control SOCket re reine gue e e Exe sue eR aa Ene gu E 12 5 3 Interrupt handling correr m rer EE aT Re E
2. ASCII read Notes 24 bit operation HOST BLKFA lt F gt lt Nstart gt lt Nwords gt F 0 7 JENET gt reply JENET gt hdr datal data2 data3 datak JENET gt hdr datal data2 data3 dataK JENET gt 000 datal data2 data3 dataK 16 bit operation HOST BLKSA F Nstart Nwords F 0 7 same as above ASCII write Notes 24 bit operation HOST BLKFA F Nstart Nwords F 16 27 JENET gt reply HOST gt hdr 1 2 data3 datak HOST gt hdr datal data2 data3 dataK HOST hdr datal dataK JENET 0 actual datasize 16 bit operation HOST BLKSA F lt Nstart gt lt Nwords gt F 16 27 Ec same as above BINARY read Notes HOST BLKFA lt F gt lt Nstart gt lt Nwords gt bin JENET reply JENET binary data JENET binary data JENET binary data 24 bit operation F 0 7 HOST gt BLKSA lt F gt lt Nstart gt lt Nwords gt bin same as above 16 bit operation F 0 7 ZP ENGINEERING srl JENET User s Manual v 2 2 0 37 43 JENET Ethernet based CAMAC controller 12 Binary commands reference In general the binary command has the following format byte 0 STX byte 1 CMD CODE byte 2 databyte 0 byte 3 databyte 1 byte n databyte k byte n 1 REQ_RESPONSE byte n 2 ETX where STX is the hexdecimal value 0x02 ETX is the h
3. lua geterr It returns the error message if any returned by the script interpreter being a multi line string it follows the same protocol of lua getfile lua getlog It returns the stdout log file returned by the script interpreter it s useful as a debugging aid as print messages are sent to the log Being a multi line output it follows the same protocol of lua getfile WARNING using print on Lua may crash the system if the log file gets too long Please use it only for debug You can review the JSM source code to gain more insight into script file transfers Please note that JSM is provided in source code form as is without support or guarantee ZP ENGINEERING srl JENET User s Manual v 2 2 0 25 43 JENET Ethernet based CAMAC controller 7 2 3 Jenet Script Manager jsm It is a dedicated application available for Windows and Linux that allows full control over all operations related to script management all operations are specified with command line parameters The following syntax is implemented version 1 0 jsm h displays program version and a list of allowed parameters jsm ip IP addr gt u lt filename ext gt uploads script text from specified file on host to Jenet jsm ip lt IP addr gt run starts execution of current script jsm ip lt IP addr gt stop halts execution of current script jsm ip IP addr gt s stores current script on non volatile memory
4. 24 V 100 mA 6V 100 mA 6V 700 mA Settings 10 100 Mbit autonegotiating Default configuration IP address 192 168 0 98 subnet mask 255 255 255 0 default gateway 0 0 0 0 DHCP client 0 disabled default configuration can be changed through serial port Serial port Default settings 38400 baud 8 N 1 no flow control Function for configuration changes CAMAC bus interface system settings startup options Compliance to ANSI IEEE std 583 1982 NIM interface i Connectors SUHNER type CPU section Processor ARM7TDMI running at 44 MHz Operating System uClinux ver 2 4 17 FLASH 4 Mbytes SDRAM 16 Mbytes ZP ENGINEERING srl JENET User s Manual v 2 2 0 43 43
5. where hdr datai data2 dataK K is the current buffer size in ASCII mode hdr is formatted as 03X in ASCII mode dataj is formatted as 06 for both 16 bit and 24 bit access types in ASCII mode the data block is terminated by a WM character in binary mode hdr and dataj are all 32 bit values in binary mode the data block is K 1 4 bytes if there are non significant data values if hdr or hdr 0 data block size is always the same as above hdr is a header that can assume one of the following values hdr notes datal actual datasize 0 End of block transfer as data2 dataK non significant gt 0 Number of data words being If N K then dataN dataN 1 datakK non transferred significant datal actual datasize 3 Timeout error WES data2 dataK non significant datal actual datasize 4 Abort error S data2 dataK non significant A complete reference of block transfer commands is available in section 11 ZP ENGINEERING srl JENET User s Manual v 2 2 0 15 43 JENET Ethernet based CAMAC controller 5 5 C library Although the host programs can be written in any language a C library is available to simplify code generation host clients IRQ handling and binary commands can be handled in a very easy and transparent way that releases the programmer from taking care of low level details The C library is an ANSI C library delivered in
6. in ms a b bor a b Binary operators bxor a b bmod a b AND a amp b OR a b bsl a b bsr a b XOR a b MOD a b BSL a lt lt b BSR a gt gt b ZP ENGINEERING srl JENET User s Manual v 2 2 0 31 43 JENET Ethernet based CAMAC controller CAMAC bus control TCP control socket Lua Description CCCZ CCCZ Generate Dataway Init CCEC CCee Generate Crate Clear CFSA lt function gt lt slot gt lt addr gt lt data gt CFSA function slot addr data Sod e command returns CSSA function slot addr data CSSA function slot addr data 2 22 command returns CCCI value CCCI value Change Dataway Inhibit to specified value 0 or 1 CTCI CTCI aids test Inhibit returns 0 or CTLM slot CTIM slot Eo LAM on specified slot CCLWT slot CCLWT s1ot CAMAC wait for LAM on specified slot only for Lua CLMR Returns current LAM register in hex LACK LACK LAM acknowledge CTSTAT CTSTAT Returns Q and X values from last access on bus Executes a Crate scan and returns a bit CSCAN mask with bitn 1 if in the slot n a CAMAC board is detected DIAGNOSTIC SECTION TCP control socket Lua Description vn24 vn24 Returns the measured voltage on 24V power supply in float format 12 12 Returns the measured voltage on 12V power supply in float format vn6 vn6 Returns the
7. xu en ele Y ER ele 27 9 NIM SUDSSCEIQE a aya dette eta a dead cre aree 27 27 9 1 Defa lt DUttON entr 27 aE i se IEEE 28 EE 29 9 4 COMBO AY Os N Ea 30 10 ASCII commands reference 20 sa saa 31 11 Block transfer reference 2 E REN RO E 34 12 Binary commands reference n ene Re Re x rada 38 13 System Specificatio NS s kai ud pd I ERAN Rd erat 43 ZP ENGINEERING srl JENET User s Manual v 2 2 0 2 43 JENET Ethernet based CAMAC controller This log identifies those portions of this document which have been revised since the original issue and the date of each revision Rev Summary of changes to previous version Date 1 0 First version 15 01 04 1 0 1 Notes added to sections 3 5 1 and 8 11 02 04 Lua binary operators added section 7 2 1 and section 10 1 0 2 Control socket commands for Lua control added section 7 2 2 24 02 04 Revised jsm description section 7 2 3 Specified maximum no of connections section 5 Detailed interrupt management section 5 2 Removed obsolete reference to CNAME section 5 1 section 10 1 0 3 Added reference to usage terms of the ESONE library section 5 3 23 09 04 Added reference to JSM at the end of section 7 2 2 Corre
8. 4 outputs 4 inputs event counters 2 COMBO I O trigger busy modules programmable pulse generators Section o input event counters o default settings be reloaded with front panel button Remote o ANSI C remote control library derived from the ESONE standard with Control extensions to control local resources Library o Remote control of all functions through TCP socket Local need to install dedicated software perfect for crate setup and maintenance Web Server o User page with results from script Advanced o Embedded script interpreter allows local execution of C like code with full Scripting control on CAMAC and NIM functions Engine o No need to install cross compilation toolchains F o X and Q signals on last access ron 4 user LEDs controllable from script Indicators t o Fault connection status and NIM default indicators o Dynamic local web server allows advanced monitoring and control without the ZP ENGINEERING srl JENET User s Manual v 2 2 0 5 43 JENET Ethernet based CAMAC controller 2 Starting up 1 Please insert the controller into slots 24 and 25 ONLY of a standard CAMAC crate rightmost when looking the crate from the front side 2 if default network settings are compatible with your setup connect a LAN cable to the front panel RJ45 socket 3 Power up the CAMAC crate 4 Wait about 20 seconds to allow completion of operating system boot It might require a longer tim
9. RESET LO to HI trigger vv INPUTS NIM EVENT COUNTER NIMin4 HI to LO trigger INPUTS EXAMPLES Read from inputs Notes TCP socket commands Lua code snippet Baic readind ori teval asic readl or Input values nim getin A nim getin 321 2 3 p P nim getin j B nim getins j Set event counter IN 3 to falling edge TCP socket commands Lua code snippet nim setievcnt 3 11 0 nim setievcnt 3 1 1 0 Enable async reset for counter on IN 1 TCP socket commands Lua code snippet nim setievcnt 111 0 getievcnt 1 nim setievcnt 1 a b 1 ZP ENGINEERING srl JENET User s Manual v 2 2 0 28 43 JENET Ethernet based CAMAC controller 9 3 Outputs The OUTPUT subsection on the first output implements four independent NIM output that can be independently set and reset in addition a programmable pulse generator that can be enabled PULSE GENERATOR Period 186 2 us to 95325 2 us 93 1 us steps 10791 Hz base clock Width 88 ns to 616 ns HI Direct LO Output polarity HI Reverse LO Please note that duty cycle is never higher than 0 05 with reversed polarity flag disabled therefore it may be difficult in certain cases to see the pattern on a scope EXAMPLES Write to outputs Notes TCP socket commands Lua code snippet
10. cards it is thus possible to disable the Crate Scan function Note that Crate Scan is executed only at startup in order to avoid possible interaction with ongoing script or actions from host if the feature is disabled it will not be possible even from socket A description in pseudo code of the Crate Scan function follows for slot 1 slot lt 23 slott t end slot 0 for fun 0 fun lt sizeof SCAN FUNCTION fun for addr 0 addr lt 32 addr X CSSA slot SCAN FUNCTION fun addr 0 if X 1 slot status slot 1 end slot 1 if end slot slot status slot 0 where SCAN_FUNCTION is the following array 0 1 2 3 8 9 10 11 24 25 26 27 16 17 18 19 ZP ENGINEERING srl JENET User s Manual v 2 2 0 8 43 JENET Ethernet based CAMAC controller 4 2 Jumper settings It is possible to force some startup options by placing or removing internal jumpers Only experienced personnel should perform this operation The operation is described in steps as follows switch off power from the crate remove the controller from the crate remove the lateral cover left side when looking on the front panel of the controller you should see the internal boards with components facing your side locate the jumper block right behind the serial port connector note that if all jumpers are removed default condition then the unit will perform in the standard mode insert jumpers o
11. dataK Jenet hdr 3 HOST BLKSR F lt N gt A maxsize timeout 16 bit operation sesso same as above F 0 7 Notes JENET gt HOST gt HOST gt HOST gt JENET gt ASCII write BLKFR lt F gt lt N gt lt A gt lt maxsize gt lt timeout gt reply hdr datal data2 data3 dataK hdr datal data2 data3 dataK hdr datal data2 data3 dataK 0 actual datasize 24 bit operation F 16 27 Check for timeout possible reply from Jenet hdr 3 BLKSR lt F gt lt N gt lt A gt lt maxsize gt lt timeout gt ae EE same as above 16 bit operation F 16 27 BINARY read Notes HOST gt JENET gt JENET gt JENET gt JENET gt BLKFR lt F gt lt N gt lt A gt lt maxsize gt lt timeout gt bin reply lt binary data gt lt binary data gt lt binary data gt 24 bit operation F 0 7 Check for timeout possible reply from Jenet hdr 3 HOST gt BLKSR lt F gt lt N gt lt A gt lt maxsize gt lt timeout gt bin same as above 16 bit operation F 0 7 ZP ENGINEERING srl JENET User s Manual v 2 2 0 36 43 JENET Ethernet based CAMAC controller reply see table on page 2 K Block Transfer buffer size ADDRESS SCAN mode Nstart station from which address scan begins Nwords maximum size of data block to transfer
12. disables specified COMBO section preventing unwanted triggering which 1 2 lt value gt 0 1 nim waitcombo ch Wait for COMBO interrupt it returns only when COMBO is busy blocking call ch 1 2 or 3 both nim waitdtc ch Wait for DTC interrupt it returns only when DTC has crossed the threshold blocking call ch 1 2 or 3 both nim testcombo ch nim testcombo ch Test COMBO interrupt it immediately returns current values 1 if COMBO busy 0 otherwise ch 1 20r 3 both nim testdtc ch nim_testdtc ch Test DTC interrupt it immediately returns current value 1 if DTC has crossed the threshold 0 otherwise ch 1 2 or 3 both ZP ENGINEERING srl JENET User s Manual v 2 2 0 33 43 JENET Ethernet based CAMAC controller 11 Block transfer reference A brief summary of available commands follows Utilit BLKBUFFS Block transfer buffer size set ili M BLKBUFFG Block transfer buffer size get Q sto BLKSS Block transfer 16 bit Q stop mode 5 P BLKFS Block transfer 24 bit Q stop mode BLKSR Block transfer 16 bit Q stop mode Q repeat BLKFR Block transfer 24 bit Q repeat mode BLKSA Block transfer 16 bit address scan mode Address Scan BLKFA Block transfer 24 bit address scan mode where In general the command is expressed as S S short F full m S Q stop R Q repeat A address s
13. measured voltage on 6V power supply in float format Returns the measured voltage on 6V power supply in float format 12 12 Returns the measured voltage on 12V power supply in float format vp24 vp24 Returns the measured voltage on 24V power supply in float format vp33 vp33 Returns the measured voltage on 3 3V power supply in float format vp5 vp5 Returns the measured voltage on 5V power supply in float format SYSTEM PARAMETERS s tored in EEPROM ee getcomspeed Returns the speed of the RS232 COM port ee setcomspeed lt baudrate gt Sets the speed of the RS232 COM port ee getcscan Returns current Crate Scan flag value 0 or 1 ee getdhcp ee getdhcp Returns 0 if DHCP client is not enabled 1 otherwise ee getdns ee getdns Returns current DNS in dotted notation ee getgw ee getgw Returns current Gateway in dotted notation ee getip ee getip Returns current IP address in dotted notation ee getmac ee getmac Returns current MAC address in hex format with delimiters like in 00 50 C2 26 E0 0A ee getmask ee getmask Returns current IP mask in dotted notation ee getname Returns current Crate Name as it appears in the local web pages ee getrob Returns current Run on Boot flag value 0 or 1 ee getserial Returns Jenet serial number ee setcscan Sets Crate Scan flag to spe
14. time TCP server 2000 TCP control socket for ASCII commands up to 2 different clients are allowed at the same time see TCP ASCII control socket section TCP server 2001 TCP control socket for binary commands only see TCP binary control socket section TCP server 2002 TCP socket server for interrupt management see Interrupt handling section TCP server 2003 TCP socket server for socket to serial link see Jumper settings section Telnet server 23 System telnet server it is used mainly for firmware updates and may be disabled by the user see Startup options section Please note that the telnet connection is unsafe no password protected access no encryption The local web server allows an easy and quick access to CAMAC commands test and monitoring functions Simple CAMAC operations can be easily performed by means of a user friendly web interface with no need of programming or learning manuals This very useful especially when performing quick lab tests on CAMAC modules See section Local Web Server for details The socket connection is the main control method for general applications the host computer opens a TCP connection to the Jenet IP address at port 2000 and then starts sending commands A command is a simple ASCII string Command can be sent by host computers through a specific DAQ application or manually using a terminal program like telnet for Unix Linux or HyperTerminal for Windows For example a socke
15. BIN_CTLM_CMD 0x26 equivalent to the ASCII command ctlm BIN_CCLWT_CMD 0x27 equivalent to the ASCII command cclwt BIN_LACK_CMD 0x28 equivalent to the ASCII command lack BIN_CTSTAT_CMD 0x29 equivalent to the ASCII command ctstat BIN_CLMR_CMD 0 2 equivalent to the ASCII command BIN_CSCAN_CMD 0x2B equivalent to the ASCII command cscan BIN_NIM_SETOUTS_CMD 0x30 equivalent to the ASCII command nim_setouts e databyte 0 databyte k is of variable length according to the command code e REQ RESPONSE may be NO BIN RESPONSE no response requested Any other value response requested If one of the databyte 0 databyte k contains 0x2 0 4 e 0x10 then the databyte must be converted in two bytes accordingly to the following rule if databyte n 0 2 gt converted in gt databyte n 0x10 databyte n 1 0x80 0x02 if databyte n 0 4 gt converted in gt databyte n 0x10 databyte n 1 0x80 0x04 if databyte n 0x10 gt converted in gt databyte n 0x10 databyte n 1 0x80 0x10 A complete reference of binary commands is available in section Binary commands reference ZP ENGINEERING srl JENET User s Manual v 2 2 0 12 43 JENET Ethernet based CAMAC controller 5 3 Interrupt handling On Jenet specific events can generate an interrupt IRQ that is notified to the host Being Socket based the connection method is rather different from a bus based connection t
16. CONTROLLER VAZP Engineering Commands NIM I O Configurations Diagnostics CAMAC Power Supplies Local Power Supplies fener Cd Update Voltages Crate Scan Result JENET has detected cards in the following slots 6 18 This page shows current voltage readouts divided into crate power supplies and local digital only power supplies Note that Jenet requires the following voltages to be present in order to work properly 24V 6V 6V 24V On the bottom of the page results of the Crate Scan performed only at power up if the CSCAN flag is enabled see Startup Options section are shown in textual form Remember that if Crate Scan is problematic depending on which cards are inserted into the crate it can be disabled either by serial or control socket ZP ENGINEERING srl JENET User s Manual v 2 2 0 23 43 JENET Ethernet based CAMAC controller 7 Local scripting 7 1 Lua scripting language An on board script interpreter is available allowing complex interactions with the CAMAC bus and local NIM I O section The scripting language is Lua extended with a TCP IP library V and with specific commands that allow management of the underlying hardware Lua is a powerful lightweight programming language designed for extending applications frequently used as a general purpose stand alone language More information is available at www lua org Please take not that while being free software it is property of Tecgra
17. ESET button Default settings are stored with a Emm neset T specific socket command 8 1 Note that not all interactions OFF 0 reset reset event counter are allowed a fuller control is P s available from socket or scripting as browser access is considered comso 2 unsafe from the remote control point of view reset COMBO 2 period 1024 0 B event counter 7 reset event counter B width 264ns v reverse polarity GJ ZP ENGINEERING srl JENET User s Manual v 2 2 0 19 43 JENET Ethernet based CAMAC controller 6 2 1Input section event counters LO HI 26881 z L l soft reset Read input levels Enable counter amp select edge two event counters can be enabled on inputs 1 and 3 independently by selecting the required triggering transition HI to LO or LO to HI in the drop down box event counter on input 1 can be asynchronously reset by input 2 if the checkbox is flagged there is also a button on the page that allows a software reset of the counter event counter on input 3 can be asynchronously reset by input 4 if the checkbox is flagged there is also a button on the page that allows a software reset of the counter 6 2 2 Output section enable pulse generator period 10240 width 264ns v reverse polarity
18. NIE TRE 13 5 4 Block transfers re pe en ed ee Pede e ee V e e na eR Ex ERE 14 MEME 16 5 6 hye 16 6 Local Web server u uyu aa RE EIU EE 17 6 1 Commands eie her xA Ee Re ree E EU ER E Een ERE EA TERRE RR ERE RATER 18 6 2 NIM T O pages eive etae aiv bea edem obse eut bun Reb GRO Ful Rte 19 622 1 Input SECO uus tuer cbse Eb e ui Ur EE e AE RR MORE UU EU ONU REN UE 20 6 2 2 QULPU SECOM br Er E 20 6 2 3 COMBO SECTION ie ite eren EA ER Ex 21 6 3 System settings page eo yu A ER RE e ee ek ex x EE 22 6 4 Diagnostics t d apuqa q aquqa eee eed as 23 7 Local scripting EET 24 7 4 L a scripting languages e b a ex a n Y RC PUR RR eU Rd 24 7 2 en x Ee re n AER a ee 24 7 2 1 Bit manipulation extension esses mme nenne 25 7 2 2 Socket commands for Lua 25 7 2 3 Jenet Script Manager 26 7 2 4 Scripting on Jenei erre b eH TR ERR I 26 8 Firmware Upgrade ee Pe xax en a ax mex
19. Read current Pulse output state Manual generator output set settings output 1 can be set as a programmable pulse generator for which the period pulse width and polarity can be specified numerical entry of pulse generator period is automatically adjusted to fit the available resolution when the page is reloaded ZP ENGINEERING srl JENET User s Manual v 2 2 0 20 43 JENET Ethernet based CAMAC controller 6 2 3 COMBO section current coMBO state COMBO 1 reset COMBO 1 event 1 counter reset event counter BUSY COMBO input 1 can be reset with the dedicated button the usual way to reset a COMBO input would be from software COMBO input 2 can be reset with the dedicated button the usual way to reset a COMBO input would be from software Dead Time Counter for both COMBO inputs is not shown on web page as it has relevant meaning only immediately before resetting the COMBO input ZP ENGINEERING srl JENET User s Manual v 2 2 0 21 43 JENET Ethernet based controller 6 3 System settings page JENET Microsoft Internet Explorer File Edit View Favorites Tools Help Address http 192 168 0 93 Jenet CAMAC CRATE CONTROLLER 2 Engineering Commands NIM I O Configurations Diagnostics User System Network Parameters MAC address 00 50 2 26 0 00 mans COMME NN System Identification FPGA version 02 03 30 12 2003 This is a read o
20. TCP IP and Note port 2000 on linux hosts you can use the standard telnet client in raw mode by typing telnet lt Jenet IP address gt 2000 ZP ENGINEERING srl JENET User s Manual v 2 2 0 11 43 JENET Ethernet based CAMAC controller 5 2 TCP binary control socket A binary command subset is also available to increase speed and data transfer rate A TCP server for binary commands is available on port 2001 binary commands must be sent through that port only A dedicated C C library has been written to use these commands in a straightforward and transparent way with no need to know all the implementation details described here Users writing their host DAQ applications in C or C can skip this chapter See section C library for details In general the binary command has the following format byte 0 STX byte 1 CMD CODE byte 2 databyte 0 byte 3 databyte 1 byte n databyte k byte n 1 REQ_RESPONSE byte n 2 ETX where e STX is the hexdecimal value 0x02 is the hexdecimal value 0x04 e CMD CODE may be one of the followings value BIN_CFSA_CMD 0x20 equivalent to the ASCII command cfsa BIN_CSSA_CMD 0x21 equivalent to the ASCII command cssa BIN_CCCZ_CMD 0x22 equivalent to the ASCII command cccc BIN_CCCC_CMD 0x23 equivalent to the ASCII command ccci BIN_CCCI_CMD 0x24 equivalent to the ASCII command ctci BIN_CTCI_CMD 0x25 equivalent to the ASCII command ctci
21. Test mode nim cack 1 nim cack 1 jn led 3 1 jn led 4 1 jn led 3 1 end jn_led 41 ZP ENGINEERING srl JENET User s Manual v 2 2 0 30 43 JENET Ethernet based CAMAC controller 10 ASCII commands reference A reference of available commands on both the TCP control socket server and the local Lua scripting language is detailed i n this section Note that whenever possible TCP control commands are as short as possible in order to minimize Ethernet traffic on the other hand Lua commands are more descriptive Some general rules follow Control socket commands ALWAYS return an error code as first parameter it is equal to 0 if the commands executed with success 1 if command parameters are wrong 2 if the command is non existent in the table below this error code is NOT indicated when describing return values as it must be always 0 to yield a correct answer a specific property of the language socket TCP control sockets are not case sensitive while Lua commands are case sensitive this is As much as possible all commands have the same name for Lua and for TCP control Control socket only commands TCP control socket Lua Description lua setfile data gt Lua related command enables direct transfer of script file lua store Lua related command stores transferred filew into non volatile memory lua getfile Lua related command enables direc
22. X ZP ENGINEERING srl JENET User s Manual v 2 2 0 39 43 JENET Ethernet based CAMAC controller Command CCCI Response bin cmd 0 STX resp 0 STX bin cmd 1 BIN CCCI CMD resp 1 BIN CCCI CMD bin cmd 2 DATA IN resp 2 ETX bin cmd 3 RESPONSE bin cmd 4 ETX Command CTCI Response bin cmd 0 STX resp 0 STX bin cmd 1 BIN CTCI resp 1 BIN CMD bin cmd 2 ETX resp 2 test res resp 3 ETX Command CTLM Response bin cmd 0 STX resp 0 STX bin cmd 1 BIN CTLM CMD resp 1 BIN CTLM CMD bin cmd 2 slot resp 2 test res bin cmd 3 delta ETX resp 3 ETX Command CCLWT Response bin cmd 0 STX resp 0 STX bin cmd 1 BIN CCLWT resp 1 BIN CCLWT bin cmd 2 slot resp 2 ETX bin cmd 3 delta ETX Command CTSTAT Response bin cmd 0 STX resp 0 STX bin cmd 1 BIN CTSTAT CMD resp 1 BIN CTSTAT CMD bin cmd 2 ETX resp 2 Q resp 3 X resp 4 ETX ZP ENGINEERING srl JENET User s Manual v 2 2 0 40 43 JENET Ethernet based CAMAC controller Command CLMR Response bin cmd 0 STX resp 0 STX bin cmd 1 BIN resp 1 BIN bin cmd 2 ETX resp 2 reg amp OxFF re
23. can Read or write mode is determined by the Function code passed as a parameter as follows F 0 7 gt READ mode F 16 27 WRITE mode BLKsm All block transfer commands have the same behavior Jenet replies to the command itself immediately after reception before executing the actual block transfer with one of the following possible replies compliant with the standard command response of the TCP control socket protocol NA 0 OK operation in progress 1 error wrong parameters 2 error non existing command The general format of a data block is hdr datai dat where K is the current buffer size in ASCII mode hdr is formatted as 03X a2 dataK in ASCII mode dataj is formatted as 06 for both 16 bit and 24 bit access types in ASCII mode the data block is terminated by a r character in binary mode hdr and dataj are all 32 bit values in binary mode the data block is K 1 4 bytes if there are non significant data values if hdr K or hdr 0 data block size is always the same as above hdr can assume one of the following values hdr notes datal actual datasize 0 End of block transfer ANC data2 dataK non significant gt 0 Number of data words being If N K then dataN dataN 1 datakK non transferred significant datal actual datasize 3 Timeout error EN data2 dataK non sign
24. cified value 0 or 1 ee setname name string Sets the Crate Name shown in the local web pages ee setrob value Sets Run on Boot flag to specified value 0 or 1 ee storeconf Stores current NIM section configuration into EEPROM default settings ZP ENGINEERING srl JENET User s Manual v 2 2 0 32 43 JENET Ethernet based CAMAC controller NIM I O SECTION TCP control socket Lua Description nim getin nim getin Returns NIM input values it returns a 1 a 2 a 3 a 4 where a n Oor 1 nim_getins lt which gt nim_getins which Returns a single NIM input value 0 or 1 lt which gt 1 2 3 or4 nim setievcnt which en pol ext reset nim setievcnt which en po l ext reset Sets Input Event Counter which 1 3 lt gt 0 1 lt pol gt 0 1 ext reset gt 0 1 nim getievcnt which nim getievcnt which Returns Input Event Counter settings nim geticnt which nim geticnt which Returns current Input Event Counter value nim reseticnt which nim reseticnt which Reset specified Input Event Counter which 1 or 3 nim getouts which nim getouts which Returns current value of specified output which 1 4 nim getout nim getout Returns current value of all outputs nim setouts which value nim setouts which value Sets value o
25. control its execution The script is launched and executed directly in case of error the FAULT red LED on the front panel is lit and script execution is halted By issuing a stop command it is possible to restore the script engine to idle state The special function doevents has been added to deal with the single threaded nature of the scripting engine it allows the system to terminate execution of the script itself If this call is missing or called rarely then it may not be possible to halt execution of the current script ZP ENGINEERING srl JENET User s Manual v 2 2 0 24 43 JENET Ethernet based CAMAC controller The ROB Run On Boot dedicated flag is available on the local EEPROM to indicate whether the FLASH script should be executed at startup Note that there is no assumption of the temporal evolution coded into the script therefore many different uses may be made of the scripting capabilities 7 2 1 Bit manipulation extension As the base Lua library does not provide bit manipulation operands ZP Engineering added some commands to allow binary operations an essential feature for any embedded system As an example the CLMR Camac function returns the current LAM mask and a binary AND operator is almost mandatory to allow individual bit testing The following additional functions are provided all with two operators and one result function Description C equivalent band a b 32 bit binary AND a am
26. control socket The green LED located just below the DEFAULT pushbutton is turned on when default settings are applied and turned off whenever any of the relevant settings is altered providing an immediate visual feedback of the validity of default settings The DEFAULT pushbutton can also generate a special interrupt request and notify the host computer through a dedicated socket connection on port 2002 This is a very powerful feature ZP ENGINEERING srl JENET User s Manual v 2 2 0 27 43 JENET Ethernet based CAMAC controller that allows the user to start different programs at each pressure of the button for example different module setups can be activated when the button is pressed and different actions can be performed 9 2 Inputs The NIM INPUT subsection implements four independent NIM inputs that may be read asynchronously to retrieve input status or configured to perform event counting more specifically inputs 1 and 3 can be set as event counter triggering on rising or falling transition Counter reset is performed either with a dedicated control command or with an external reset derived from input 2 for counter on input 1 and from input 4 for counter on input 3 Note that external reset capability must be enabled with the proper commands External reset is active when relevant input is HI while HI counter is kept to zero and will not count further NIM in 1 gt EVENT COUNTER 1 NIM in 2 O gt lt
27. cted description of nim getievcnt nim setpulse nim pulseoff nim cack nim resetcombo lua setrun lua getrun section 10 x 2 0 0 Second firmware version 26 09 05 2 0 1 Minor fixes 27 09 05 2 0 1b Some typos have been fixed 28 09 05 New firmware version 2 07 2 1 0 Global revision of most chapters 26 05 06 Command nim resetcombo has been renamed nim enablecombo New firmware version 2 08 2 2 0 07 11 07 Global revision of several paragraphs ZP ENGINEERING srl JENET User s Manual v 2 2 0 Approval UZ PP MV FP UZ UZ x UZ FP x UZ MV UZ MV 02 92 3 43 JENET Ethernet based CAMAC controller 1 General information This manual is intended to provide a reference for operating and programming JENET an Ethernet based CAMAC crate controller 1 1 Warranty HARDWARE ZP Engineering srl warrants the JENET JNTO1 product to operate within specifications under normal use and service for a period of 2 two years from the date of shipment Component products replacement parts and repairs are warranted for 90 days This warranty extends only to the original purchaser Should the product in ZP Engineering s opinion malfunction within the warranty period ZP Engineering will at its discretion repair or replace the product upon receipt with an equivalent Any replaced parts become property of ZP Engineering This warranty does not ap
28. d near the crate i e a serial LCD display a remote data acquisition or I O expander a local PLC ZP ENGINEERING srl JENET User s Manual v 2 2 0 7 43 JENET Ethernet based CAMAC controller 4 Startup options Jenet startup options can be tuned in order to provide a fine control over performance and connectivity There are some settings stored in nonvolatile memory that can be changed with the control socket or from the serial port and some options that require placement or removal of jumpers inside the unit 4 1 Startup flags Two software flags are available for startup fine tuning Lua script Run On Boot flag Crate Scan Enable flag Both are stored in the local EEPROM and can be modified with dedicated commands on the serial port getrob setrob getcscan setcscan or from the control socket The Lua Run On Boot flag when enabled tells the system to run the stored Lua script after starting up the application its main usage is for automated crate initialization and for unattended control Crate Scan is a function available on Jenet to allow automatic detection of cards inserted into the crate It is a quick way of verifying the presence of cards that may be required by the acquisition code either within the Lua script or on the host application Being a heuristic approach to card detection there is no formal way of detecting a card when inserted into the crate the Crate Scan function may interfere with specific CAMAC
29. datal data2 data3 dataK JENET hdr datal data2 data3 dataK JENET 000 datal data2 data3 dataK HOST BLKSS F N A maxsize 16 bit operation Aem same as above F 0 7 ASCII write Notes HOST gt BLKFS lt F gt lt N gt lt A gt lt maxsize gt 24 bit operation JENET gt reply F 16 27 HOST hdr datal data2 data3 dataK HOST hdr datal data2 data3 dataK HOST hdr datal data2 data3 dataK JENET 0 actual datasize HOST BLKSS F N A maxsize 16 bit operation F 16 27 BINARY read Notes HOST gt BLKFS lt F gt lt N gt lt A gt lt maxsize gt bin 24 bit operation JENET gt reply F 0 7 JENET gt lt binary data gt JENET gt lt binary data gt JENET gt lt binary data gt HOST gt BLKSS lt F gt lt N gt lt A gt lt maxsize gt bin 16 bit operation s same as above F20 7 ZP ENGINEERING srl JENET User s Manual v 2 2 0 35 43 JENET Ethernet based CAMAC controller REPEAT mode reply see table on page 2 K Block Transfer buffer size timeout in seconds range 0 32767 ASCII read Notes HOST BLKFR F lt N gt A maxsize timeout 24 bit operation JENET reply F 0 7 JENET hdr datal data2 datas dataK JENET hdr datal data2 data3 dataK Check for timeout possible reply from JENET 000 datal data2 data3
30. e depending on your network configuration especially DHCP 5 If default network settings are not suitable for your network environment connect a terminal to the front panel serial port and make the necessary variations see Serial port control section Set the IP address and don t forget the IP Network mask After that reboot either by cycling the main power or by pressing the RESET front panel button and wait about 20 seconds 6 For instant gratification please open your favorite browser on a host connected to the same LAN used by Jenet and point to its IP address if default settings apply the default IP address is 192 168 0 98 From the web server pages you already have control over the NIM I O section and the possibility to perform individual commands on the CAMAC bus Note if you connect directly Jenet to a PC i e a point to point connection you MUST use a cross cable this is a typical requirement for LAN devices NIM output 1 can be set as a pulse generator Power supply presence indicators NIM outputs LEDs are ON when output is active Status of X and Q signals on last CAMAC access User LEDs COMBO trigger busy controllable from sections Lua and socket LEDs are ON when output is BUSY FAULT LED Connect status LED ON when a socket connection is active oozoojoozoo NIM inputs Restores default NIM IN 1 and 3 can be set I O configuration and generates an IRQ as event c
31. e only available in ASCII mode Write operations are consumed in streaming mode Jenet does not wait for the whole block data set to begin writing ZP ENGINEERING srl JENET User s Manual v 2 2 0 14 43 JENET Ethernet based CAMAC controller A brief summary of available commands follows Utilit BLKBUFFS Block transfer buffer size set ili T BLKBUFFG Block transfer buffer size get Q st BLKSS Block transfer 16 bit Q stop mode sto j BLKFS Block transfer 24 bit Q stop mode BLKSR Block transfer 16 bit Q stop mode Q repeat BLKFR Block transfer 24 bit Q repeat mode BLKSA Block transfer 16 bit address scan mode Address Scan BLKFA Block transfer 24 bit address scan mode In general the command is expressed as BLKsm where s S short F full m S Q stop R Q repeat A address scan Read or write mode is determined by the Function code passed as a parameter as follows F 0 7 gt READ mode F 16 27 WRITE mode All block transfer commands have the same behavior Jenet replies to the command itself immediately after reception before executing the actual block transfer with one of the following possible replies compliant with the standard command response of the TCP control Socket protocol Reply 0 OK operation in progress 1 error wrong parameters 2 error non existing command The general format of a data block is
32. ent from gt User Lua or socket Read only settings for network and System hardware 17 43 6 1 Commands page The local web server contains a page dedicated to CAMAC commands in order to allow immediate testing of crate functions There is a log capability currently limited to actions performed on the web page A drop down selection box allows the choice of one of 7 CAMAC commands on the entry box the relevant parameters have to be entered when pressing the EXECUTE button the commands will be executed For read functions the result is available on the data field of the log section for testing functions the result is available in the data section with values O or 1 JENET Ethernet based CAMAC controller Please remember that in the current implementation logging is enabled only for commands executed from this web page Logging is ten events deep it is also possible to clear the log directly on the web page Syntax definition Description Notes CSSA function slot subaddr data with 16 bit data execute a CAMAC command response in Q function 0 31 slot 1 23 subaddr 0 15 CFSA lt function gt lt slot gt lt subaddr gt lt data gt with 24 bit data execute a CAMAC command response in Q function 0 31 slot 1 23 subaddr 0 15 generate dataway initialize ecez generate crate clear value set c
33. erformed using a telnet connection to the unit as follows the new binary file a known location on a network disk establish a telnet connection on default port 23 please note that depending on firmware version it may be possible that the internal telnet server must be enabled by means of HW jumpers of course you must know the unit IP address type the following commands cd app or cd www for old firmware versions sh flash host nfs directory jffs2 filename and wait until reprogramming completes reboot the unit either by pressing the RESET button on the front panel by typing reboot from the telnet terminal window An example of a typical fw upgrade command line is the following sh flash 192 168 0 91 home jenet2 fwupgrade jenet2 img 9 NIM subsection Please note that on the present document the following notation is used for NIM signals LO No current flowing into load HI Current flowing into load corresponding to a 0 8 V voltage level across a 50 ohm load This notation is maintained also on the NIM I O web page A command parameter equal to 1 means HI 9 1 Default button A DEFAULT pushbutton located on the front panel above the reset section allows immediate manual reload of a default configuration for the NIM I O subsection thus allowing a quick reconfiguration of the system The same settings are applied at power up and can be set through the
34. exdecimal value 0x04 CMD_CODE may be one of the followings value BIN_CFSA_CMD 0x20 equivalent to the ASCII command cfsa BIN_CSSA_CMD 0x21 equivalent to the ASCII command cssa BIN_CCCZ_CMD 0x22 equivalent to the ASCII command cccc BIN_CCCC_CMD 0x23 equivalent to the ASCII command ccci BIN_CCCI_CMD 0x24 equivalent to the ASCII command ctci BIN_CTCI_CMD 0x25 equivalent to the ASCII command ctci BIN_CTLM_CMD 0x26 equivalent to the ASCII command ctlm BIN_CCLWT_CMD 0x27 equivalent to the ASCII command cclwt BIN_LACK_CMD 0x28 equivalent to the ASCII command lack BIN_CTSTAT_CMD 0x29 equivalent to the ASCII command ctstat BIN_CLMR_CMD 0 2 equivalent to the ASCII command BIN_CSCAN_CMD 0x2B equivalent to the ASCII command cscan BIN_NIM_SETOUTS_CMD 0x30 equivalent to the ASCII command nim_setouts databyte 0 databyte k is of variable length according to the command code REQ_RESPONSE may be NO BIN RESPONSE 0 no response requested Any other value response requested If one of the databyte 0 databyte k contains 0 2 0 4 e 0x10 then the databyte must be converted in two bytes accordingly to the following rule a simple escape sequence to avoid out of sync transmissions if databyte n 0 2 gt converted in gt databyte n 0x10 databyte n 1 0x80 0x02 if databyte n 0 4 gt converted in gt databyte n 0x10 databyte n 1 0x80 0x04 if databyte
35. f http www tecgraf puc rio br of which we acknowledge the excellent work A brief description of the scripting engine and its extensions follows This is the base scripting engine It has been conceived as an efficient Lua Version 4 0 compact add on scripting library for various applications Extension to Lua 4 0 developed by Diego Nehab that adds TCP and UDP Luasocket library Version 1 4 functionality to the Lua scripting language Bit manipulation Added by ZP Engineering srl to offer extension bit wise AND OR XOR functions Added by ZP Engineering srl to offer full control of the local NIM I O section Added by ZP Engineering srl to offer full control of system functions Added by ZP Engineering srl to offer CAMAC extension full control over CAMAC commands and functions NIM I O extension System extension Note that a complete reference of Lua is available on www lua org and on the Jenet support site courtesy of the Lua community at www zpeng jenet 7 2 Lua engine in Jenet One of the desirable features of Lua is that the language can be easily extended with new commands this technique has been applied to allow full control of Jenet from a script A detailed reference of available extension commands is presented in chapter 9 Commands Reference A dedicated application that connects to the control socket server allows the user to load the script and
36. f After a run once initialization section an infinite loop is executed calling as often as possible the doevents function Automatic jn 1 1 1 purn LED Ul on execution of run once init function somewhere else in the script monitoring while 1 do loop doevents run_in_loop function somewher lse in the script pause 100 wait 100 ms end led turn LED Ul on run once init function somewher lse the script while 1 do doevents COMBO if nim tesrint l 1 then Servicing do something function somewhere else in the script nim 1 end end ZP ENGINEERING srl JENET User s Manual v 2 2 0 26 43 JENET Ethernet based CAMAC controller 8 Firmware Upgrade It is possible to upgrade a section of FLASH memory contents in order to allow firmware upgrades on the field either to correct any problems that may show up during usage or to load application specific executables Internal FLASH is structured into two banks one for the operating system and one for the application the application bank includes all the executables related to Jenet When using a NFS mapped disk please remember to add the following line nfs directory IP address JNTO1 gt rw all squash to the etc exports file on the computer where disk is located To restart NFS service on host computer type service nfs restart Note Firmware upgrade limited to the application bank is p
37. f specified output which 1 4 nim setout vl v2 v3 v4 nim setout v1 v2 v3 v4 Sets current value of all output which 1 4 nim setoutp which pulse width Generates a pulse event on a selected output with specified width in multiples of 20 ms See section Outputs for details nim setpulse period width polarity nim setpulse period width polarity Sets Pulse Generator values in decimal lt period gt 1 1023 lt width gt 1 7 lt polarity gt 0 or 1 See section Outputs for details nim_getpulse nim getpulse Returns Pulse Generator settings nim pulseoff nim pulseoff Disables Pulse Generator nim setcthr which value nim setcthr which value Sets threshold value for COMBO section which 10r2 nim getcthr which nim getcthr which Returns current threshold value for COMBO section which 1 2 nim getcdtc which nim getcdtc which Returns current COMBO Dead Time Counter value which 21 2 nim cack which nim cack which Acknowledges COMBO event which 10r2 nim getcev which nim getcev which Returns current COMBO Event Counter value which 1 2 nim resetcev which nim resetcev which Reset specified COMBO Event Counter which 1 or 2 nim enablecombo which value nim enablecombo which val ue Enables or
38. for Run on Boot option jsm ip lt IP addr gt rob lt value gt sets rob Run on Boot flag to specified value 0 or 1 jsm ip lt IP addr gt d lt filename ext gt downloads script text from Jenet to specified file on host jsm ip lt IP addr gt d stdout downloads script text from Jenet to stdout on host jsm ip lt IP addr gt e lt filename ext gt stores error message if any from Jenet to specified file on host jsm ip lt IP addr gt e stdout stores error message if any from Jenet to stdout on host jsm ip lt addr gt lt filename ext gt stores log message if any from Jenet to specified file on host jsm ip IP addr gt stdout stores log message if any from Jenet to stdout on host The jsm application is available in both source and compiled form on the documentation section of the Jenet web site www zpeng com jenet it uses dedicated commands to transfer files Please check periodically for updates 7 2 4 Scripting on Jenet A few usage examples follow Script usage examples In certain cases it may be safe to initialize inserted CAMAC target cards as soon as possible after power up Crate With ROB 1 the FLASH script performs the required initialization initialization terminating after completion jn led l 1 purn LED Ul on once iniri function somewher lse in the script 1 0 turn LED Uli of
39. herefore interrupt are handled in a message based way A dedicated C C library has been written to use this feature in a straightforward and transparent way with no need to know all the implementation details described here See section C library for details There are three possible IRQ sources 1 LAM requests 2 COMBO Triggers see COMBO I O chapter 3 DEFAULT pushbutton pressure When an IRQ event is generated Jenet sends a special string to the host computer through the dedicated TCP server at port 2002 The string format is a upper case letter followed by a 32 bit hex value in ASCII LAM events L_ lt OOhhhhhh gt where lt hhhhhh gt is the ASCII representation of the LAM register content in hex 24 bit COMBO events lt bitmask gt where bitO combol interrupt pending bit1 combo2 interrupt pending bit2 dtc combot interrupt pending bit3 dtc combo2 interrupt pending bit4 31 ignored DEFAULT pushbutton pressure D defadefa On the host an IRQ dedicated client receives the messages and launches the proper IRQ service program For example if a LAM or COMBO generated IRQ is received the host can start a reading sequence of some modules The IRQ generated by a DEFAULT pushbutton pressure is a very powerful feature that allows the user to start different programs at each pressure of the button for example different module setups can be activated when the button is pressed and different actio
40. ificant datal actual datasize 4 Abort error V data2 dataK non significant Block transfer abort ZP ENGINEERING srl JENET User s Manual v 2 2 0 34 43 JENET Ethernet based CAMAC controller Any block read operation can be aborted by sending an arbitrary character to Jenet Jenet will answer with hdr 4 followed by actual datasize the number of datawords effectively transferred Any block write operation can be aborted by sending a data block with hdr 4 taking care to maintain data block formatting and size Jenet will answer always in ASCII as it has returned to ordinary command mode with hdr 4 followed by actual datasize the number of datawords effectively transferred Note please take care to avoid multiple clients connected to the control socket server as any command sent by other clients will abort the data transfer currently ongoing Buffer size get set only for read operations Default buffer size is 16 Buffer size is expressed in terms of data values not in bytes command Reply by Jenet Notes BLKBUFFG 0 buffsize Get current buffer size BLKBUFFS lt buffsize gt Set buffer size valid range is 1 256 STOP mode reply see table on page 2 K Block Transfer buffer size ASCII read Notes HOST BLKFS F N A maxsize 24 bit operation JENET gt reply F 0 7 JENET gt hdr
41. lear dataway inhibit value 0 reset value 1 set crci test dataway inhibit response in Q field CTLM lt which gt test LAM response in Q field which 1 23 LACK LAM acknowledge Must be called to clear lam pending interrupts ZP ENGINEERING srl JENET User s Manual v 2 2 0 18 43 JENET Ethernet based CAMAC controller JENET Microsoft Internet Explorer DAR File Edit Favorites Tools Help 1 Address http j 192 168 0 93 v Go aw CAMAC CRATE CONTROLLER VAZP Engineering Home Commands NIM Configurations Diagnostics ser System command parameters Commands a Mode Date o x Cleerlog quick 8 al 16 0 0 0 test I 0 test L 0 8 4 4 c o 0 0 8 4 4 c 0 0 0 8 4 4 0 0 18 4 4 20 0 0 Clear log 18 4 4 u 22 0 0 entries i8 4 4 wW 30 0 0 clear 6 2 NIM I O page The NIM I O page is arranged JENET Microsoft Internet Explorer DER like a real control panel in order to E IBe 7 allow immediate interaction with the I O section available on the enet CAMAC CRATE CONTROLLER VAZP Engineering front panel of the unit In addition it is possible to retrieve default settings by pushing the DEFAULT front panel button Commands NIM I O Configurations Diagnostics User System just above the R
42. n 0x10 gt converted in gt databyte n 0x10 databyte n 1 0x80 0x10 ZP ENGINEERING srl JENET User s Manual v 2 2 0 38 43 JENET Ethernet based CAMAC controller Command CFSA Response bin cmd 0 STX resp 0 STX bin cmd 1 BIN CFSA CMD resp 1 BIN CFSA CMD bin cmd 2 F resp 2 Q bin cmd 3 N resp 3 X bin cmd 4 A resp 4 DATA amp OxFF bin cmd 5 DATA amp OxFF resp 5 DATA 8 amp OxFF bin cmd 6 DATA gt gt 8 amp OxFF resp 6 DATA gt gt 16 amp OxFF bin cmd 7 DATA gt gt 16 amp OxFF resp 7 delta ETX bin cmd 8 delta RESPONSE bin cmd 9 delta ETX Command CSSA Response bin cmd 0 STX resp 0 STX bin cmd 1 BIN CSSA CMD resp 1 BIN CSSA CMD bin cmd 2 F resp 2 Q bin cmd 3 N resp 3 X bin cmd 4 A resp 4 DATA amp OxFF bin cmd 5 DATA amp OxFF resp 5 DATA gt gt 8 amp OxFF bin cmd 6 DATA 8 amp OxFF resp 6 delta ETX bin cmd 7 delta RESPONSE bin cmd 8 delta ETX Command CCCZ Response bin cmd 0 STX resp 0 STX bin cmd 1 BIN 2 CMD resp 1 BIN CCCZ CMD bin cmd 2 RESPONSE resp 2 ETX bin cmd 3 ETX Command Response bin cmd 0 STX resp 0 STX bin_cmd 1 BIN_CCCC_CMD resp 1 BIN_CCCC_CMD bin_cmd 2 RESPONSE resp 2 ETX bin_cmd 3 ET
43. nd passwords be added modified or deleted by means of the commands user add user del user list See the Command reference section for details 2 JENET Microsoft Internet Explorer File Edi View Favorites Tools Address http 192 168 0 93 Ee aw Commands NIM Web Enabled Jenet CAMAC CRATE CONTROLLER Configurations CAMAC Crate Controller Configuration amp Control Web Server Jenet support site at www zpeng com jenet VAZP Engineering Diagnostics The upper navigation bar allows the user to change the current page Official support site on internet Note in order to trigger update operations in the optimal way it is best to click on the link available on the navigation bar instead of hitting the refresh button of the browser i e F5 on Internet Explorer This is due to the difference in HTTP requests that are sent by various web browsers when refreshing the page ZP ENGINEERING srl JENET User s Manual v 2 2 0 m gt help Web interface to CAMAC commands gt Commands with local log capability Control panel for NIM section inputs HOME gt outputs COMBO 1 0 counters pulse generator Currently not used for future gt Configurations releases Voltage monitoring and Crate Scan Diagnostics result Application controlled cont
44. nim setout 11 1 1 nim setouts out val nim setout 1 1 1 1 nim setouts 2 0 Basic output control out 1 2 3 4 0 1 Single pulse generation nim setoutp out pulse width Lua n a out 1 2 3 4 pulse width is expressed in multiples of 20 ms Set pulse generator to 1 ms period 440 ns width TCP socket commands Lua code snippet nim setpulse 11 5 0 nim setpulse 11 5 0 11 93 1 1 024 ms 5 88 440 ns Turn pulse generator off and activate outputs 1 3 TCP socket commands Lua code snippet nim pulseoff nim setouts 1 1 nim setouts 3 1 nim pulseoff nim setouts 1 1 nim setouts 3 1 ZP ENGINEERING srl JENET User s Manual v 2 2 0 29 43 JENET Ethernet based CAMAC controller 9 4 COMBO I O The COMBO I O subsection implements a commonly requested Trigger Busy functional block The diagram below details one of the two COMBO subsections TRIG in SET BUSY out front panel LED RESET OTC 10 791 kHz COUNT ENABLE gt DEAD TIME COUNTER INTERRUPT REQUEST 4 gt EVENT COUNTER RESET EVG Whenever a LO to HI transition occurs on the TRIG input an internal Flip Flop is set to capture the event the Flip Flop output is connected to the BUSY output and its associated LED The Dead Time Counter starts counting at a 10 791 kHz rate and it is reset when the software application reset
45. nly if you want to modify the standard setup according to the table feature Notes jumper on Disable telnet to avoid system access to local resources used JMP10 TELNET only for performing a firmware upgrade or for debug Disable web server if HTTP access not required in order to JMP9 WEB SERVER obtain maximum performance note that it cannot run if application is also disabled Disable application if the system hangs after powerup i e after failing a firmware upgrade If this jumper is inserted 2 8 APPLICATION only the bare operating system will be launched telnet will be the only way to interact with the unit Please notice that JMP10 presence is ignored and telnet will be activated JMP7 COM SERVER Enable socket to serial link on TCP port 2003 Please notice that on Jenet TELNET is an insecure method to control the unit no password and no encryption are provided Therefore if the application requires it it may be safer to disable telnet access ZP ENGINEERING srl JENET User s Manual v 2 2 0 9 43 JENET Ethernet based CAMAC controller 5 Remote control The unit has been designed to allow full control from a remote location taking advantage of the available high speed Ethernet interface A summary of the implemented TCP IP services is detailed Service Port Notes HTTP server 80 Dynamic Web Server it serves up to 2 client browsers at the same
46. nly page that displays relevant network settings and local ID details please always check that your documentation is referring to the same firmware version release date is NOT relevant The MAC address is a read only property that cannot be changed in any way it may be useful in certain network environments the local IP address subnet mask default gateway and DHCP enable flag can be modified from the serial port console see Serial Port Control section or form the control socket take into account that these settings are effective only after rebooting If DHCP 1 then the local DHCP client is enabled Please refer to your system administrator for additional information relevant to these settings Note that wrong or conflicting IP address settings are the most typical issue that creates connection problem when first using the system Before connecting a board with static IP DHCP 0 you can perform an additional check by issuing a PING command to verify that the IP address on the unit is really available If another system is answering at the same address you may experience intermittent failure i e the web page sometimes does not reload and all other communications will fail ZP ENGINEERING srl JENET User s Manual v 2 2 0 22 43 JENET Ethernet based CAMAC controller 6 4 Diagnostics page JENET Microsoft Internet Explorer Eie Edit View Favorites Tools 1 Address http 192 168 0 113 Jenet CAMAC CRATE
47. ns can be performed Please refer to the C library documentation for further details In the following diagram a typical scenario with 2 separate crates is shown JENET CAMAC CRATE CONTROLLER 192 168 0 98 H ST 1 TCP binary 2001 TCP binary socket socket client gt server CRATE 1 D TCP IRQ 2002 TCP IRQ socket 70 socket client U server CRATE 1 3 r lt JENET CONTROLLER 192 168 0 99 5 gt Se 5 ty 2 2 binary 2001 binary socket Socket client server CRATE 2 TCP IRQ 2002 TCP IRQ socket socket clien server CRATE 2 ZP ENGINEERING srl JENET User s Manual v 2 2 0 13 43 JENET Ethernet based CAMAC controller 5 4 Block transfers The JENET TCP protocol includes block transfer commands Care has been put in optimizing performance while the whole protocol on TCP has been designed to be as simple and intuitive as possible block transfer commands are not following this approach However a dedicated C C library has been written to use these commands in a straightforward and transparent way See section C library for details The following block transfer modes are implemented Address Scan mode Repeat mode Stop mode Following the IEEE standard the Q line assumes different meanings depending on the
48. ontrol is organized as follows the local firmware opens a TCP socket server on port 2000 waits for connection from a remote client when a client connection is detected front panel LED status lights up it will remain on until there are active connection to the socket server the server accepts ASCII commands from the remote client see section Commands Reference return string is always in the following format 1 Command exists but parameter format or number is wrong 2 Command does not exist 0 return value Command returns correctly the return value it may also be null note that more than one remote client can connect to the socket server it is up to the programmer to avoid conflicts when accessing the same resources as there is no built in protection for access conflicts in other words stick to one remote client only unless you really know what your are doing Multi client usage is useful especially during development and debug The socket server NEVER generates data autonomously in the special case when Jenet needs to communicate to the host that a specific event has occurred analogously to an interrupt request it works through a separate communication channel IRQ port 2002 A complete reference of ASCII commands is available in section 10 On Windows 2000 it is possible to perform a quick test with the HyperTerminal application by specifying connection with
49. ounters IN 2 and 4 can be enabled as external reset for event counter and or COMBO sections Pushbutton and external SYSTEM RESET ZP ENGINEERING srl JENET User s Manual v 2 2 0 6 43 JENET Ethernet based CAMAC controller 3 Serial port control A serial port connector located on the front panel allows the user to modify system settings this procedure is required if current network parameters are incompatible with the local network It is also possible to modify startup options Default connection parameters are the following 38400 baud 8 N 1 no flow control Please notice that the baud rate can be modified by a dedicated command Echo is not enabled on the serial port so please enable character echo on your serial terminal The following commands are available help Provides a quick list of commands on terminal setip new IP addr sets a new IP address be written in the format aaa bbb ccc ddd setmask new mask sets a new IP mask setgw new gw addr gt sets a new gateway IP address setdhcp lt 0 1 gt if set to 1 enables the local DHCP client getip getmask getgw Allows retrieval of current network settings and of the internal MAC address getdhcp getmac setrob lt 0 1 gt if set to 1 enables the Lua Run On Boot option setcscan lt 0 1 gt if set to 1 enables the Crate Scan function executed at startup only du Allows retrieval of current s
50. p b bor 32 bit binary OR a b bxor 32 bit binary XOR exclusive OR a b bmod binary module a 9o b bsl binary shift left a b bsr binary shift right a gt gt b 7 2 2 Socket commands for Lua control A subset of control socket commands is dedicated to management of the local Lua interpreter engine these commands are used by the jsm application Jenet Script Manager see below Note that these socket commands are the only messages to violate the principle to have one command per line The following commands are available lua setfile It transfers a script from host to Jenet the file is placed in RAM and can be saved on FLASH with the lua store command The following procedure is required e host sends to control socket the following command lua setfile lt filesize gt where filesize is expressed in bytes e control sockets answers with OK e hostsends the file directly e control socket answers with OK lua getfile It transfers a script from Jenet to host the following procedure is required e host sends to control socket the following command lua getfile e control sockets answers with filesize expressed in bytes e host sends OK e control socket sends the file directly store It saves the current script on FLASH lua getrun It returns the current execution state of the script interpreter lua setrun It changes the executionstate lua setrun value where 1 run 0 stop
51. ply to a product that has been damaged due to accident misuse abuse improper installation usage not in accordance with product specifications and instructions natural or personal disaster or unauthorized alterations repairs or modifications Please note the following The warranty applies only to defects in workmanship The warranty makes no claims regarding suitability of the product for a particular use or environment serial number is required for any warranty service Proof of purchase may be required ZP Engineering srl accepts originals photocopies and faxes as proof of purchase when required Unauthorized repairs to a ZP Engineering board level product will void the warranty offered by ZP Engineering srl ZP Engineering srl reserves the right to refuse to service any product that has been altered modified or repaired by non ZP service personnel Standard warranty service consists of repair upon receipt You are responsible for the cost of shipping the product to ZP ZP pays the cost of returning a product to you ZP Engineering srl reserves the right to replace the product with a service product at their sole discretion at any time This warranty does not apply to the software component of a product Components and schematics are property of ZP Engineering srl and are not available to end users SOFTWARE Software included in the unit has been carefully tested but is supplied as is wi
52. s the Flip Flop therefore the Dead Time Counter provides an indication of the service time of the TRIG input It is automatically reset when BUSY is reset therefore it must be read before the BUSY reset command An independent Event Counter is incremented at each LO to HI transition of the BUSY output providing an indication of the number of pulses The Event Counter can be reset by means of an explicit command through control socket or from the NIM I O web page Please note that in order to be ready to accept new events the COMBO section must be explicitly served by the user in one of the following ways with a script section that resets the relevant COMBO FF within the application running on host with a routine that in response to the COMBO event resets the relevant COMBO FF by clicking on the RESET button on the NIM I O web page COMBO I O Event Counter Incremented on BUSY output rising edge Trigger event TRIG input rising edge Dead Time Counter 1 92 67 usec to 65535 6 7 sec TRIG to BUSY response 35 ns Acknowledge COMBO 1 trigger Notes TCP socket commands Lua code snippet nim cack 1 nim cack 1 Wait for TRIG on 1 and then turn NIM outs 3 4 ON TCP socket commands Lua code snippet nim waitint 1 cack 1 Blocking mode wait not jn_led 3 1 led 4 1 available on socket nim testint 1 repeat then if nim waitint 1 1 then
53. selected type of block transfer Reply Address Scan mode Repeat mode Stop mode Q 1 Register is present Register is ready Continue block transfer 0 0 Register is missing Register is not ready End block transfer Some remarks follow on our solution to block transfer Block data is transferred on the same TCP socket connection used for commands During a block transfer no other commands can be sent over the socket connection therefore block transfer must be completed before other commands can be sent The user must take care of this limit as any command can cause a block transfer abort If multiple clients connect to the same TCP control socket server on Jenet they might violate the condition detailed above As already mentioned on the User s Manual don t use multiple clients unless you are debugging or you really know what you re doing allow transfer of large block data in read operations local buffering is implemented Read data are transferred to the host in buffers every time the local buffer is filled Buffer size is programmable to adapt different requirements and calibrate the tradeoff between optimal transfer efficiency and response time Read operations are available in ASCII and binary mode ASCII mode is perfect for quick debugging and verification while binary mode offers higher performance at the cost of increased protocol complexity being a mixed ASCII binary protocol Write operations ar
54. source form providing an ESONE like abstraction to the socket protocol including multiple crate support Documentation specific to the C library is on a separate document available on the Jenet support web site The C library is compatible with C compilers like g Please note that the C library on host is provided as is in source code form without any form of warranty of support You are allowed to modify it freely but under any circumstance you are responsible for its use misuse 5 6 Remote Reset An hardware reset can be given either by pressing the RESET pushbutton on the front panel or by remote closing an external switch connected to the RESET input on the front panel A remote reset can also be sent from the network e From a socket connection on port 2000 send the command reset If working from a terminal window just type reset e From a telnet connection port 23 type reboot ZP ENGINEERING srl JENET User s Manual v 2 2 0 16 43 JENET Ethernet based controller 6 Local web server The local web server is a dynamic server in the sense that gathers relevant data and information directly from the machine therefore depending on page contents page refresh may be slower than expected if compared to a fully static web site A username and a password are required to access the local web server Default values are jenet jenet Other usernames a
55. sp 3 gt gt 8 amp OxFF resp 4 reg gt gt 16 amp OxFF resp 5 gt gt 24 amp OxFF resp 6 delta ETX Command CSCAN Response bin cmd 0 STX resp 0 STX bin cmd 1 BIN 5 CMD resp 1 BIN 5 CMD bin cmd 2 ETX resp 2 bitmask amp OxFF resp 3 bitmask 8 amp OxFF resp 4 bitmask 16 amp OxFF resp 5 bitmask gt gt 24 amp OxFF resp 6 delta ETX Command LACK Response bin_cmd 0 STX resp 0 STX bin cmd 1 BIN LACK CMD resp 1 BIN LACK CMD bin cmd 2 RESPONSE resp 2 ETX bin cmd 3 ETX Command NIM SETOUTS Response bin cmd 0 STX resp 0 STX bin cmd 1 BIN NIM SETOUTS CMD resp 1 BIN NIM SETOUTS CMD bin cmd 2 nimo resp 2 ETX bin cmd 3 value bin cmd 4 delta RESPONSE bin cmd 5 delta ETX ZP ENGINEERING srl JENET User s Manual v 2 2 0 41 43 JENET Ethernet based controller The server response to a non existing command is the following resp 0 STX resp 1 ERROR OxCE resp 2 ETX If the command has the wrong number of parameters or the wrong length the server response is the following resp 0 STX resp 1 PAR ERROR OxCF resp 2 ETX ZP ENGINEERING srl JENET User s Manual v 2 2 0 42 43 JENET Ethernet based CAMAC controller 13 System Specifications Power Supply Required voltages on crate Ethernet interface 24 V 100 mA
56. t connection can be manually opened from a Linux host by typing te net jenet IP addr 2000 As soon as the connection is established Jenet is ready to accept commands from the host keyboard See section TCP ASCII control socket for details and section ASCII commands reference for a complete list of the ASCII commands The command set of Jenet is composed of simple ASCII strings Moreover a command subset is also available in binary format to improve speed performances Port 2001 is dedicated to this function See section TCP binary control socket for details A telnet server is also available on port 23 Typing te net jenet IP addr the user can access the Jenet internal filesystem It is recommended for expert users only Jenet can also notify the host computer that some asynchronous external events LAM COMBO trigger and DEFAULT button pressure have occurred The TCP port 2002 is dedicated to this function See section Interrupt handling for details The internal software architecture is designed to allow control of multiple crates It must be considered that when using an Ethernet based CAMAC controller the distinction between crates is implicit as every crate is identified by a different IP address Therefore the crate number is typically not a parameter in many command definitions ZP ENGINEERING srl JENET User s Manual v 2 2 0 10 43 JENET Ethernet based controller 5 1 TCP ASCII control socket Remote c
57. t retrieval of script file lua getrun Lua related command returns 0 if script is stopped 1 if running lua setrun value Lua related command value 1 runs the script lt value gt 0 stops the script lua geterr Lua related command returns last Lua error message lua_getlog Lua related command returns log file in place of stdout SYSTEM IDENTFICATION and VARIOUS TCP control socket Lua Description jn fpgaver jn fpgaver Returns a string containing FPGA details read only information from FPGA registers jn fwver jn fwver Returns a string containing the current firmware version running on the system jn led which value jn led which value Set front panels LEDs U1 U2 U3 U4 which value 0or 1 1 to 4 reset Perform a board reset user add lt username gt lt password gt Add a new user to the local web server user del lt username gt lt password gt Delete a user from the local web server user list List all users of the local web server ver Returns a string containing firmware and FPGA versions web getuser web getuser Returns text appearing in User page see web server section web setuser text web setuser text Sets text that appears in User page see web server section Lua only commands doevents Enable system control of Lua loop pause ms Wait for specified interval
58. tartup settings Lua Run On Boot and Crate Scan gerseria Allows retrieval of current board serial number Sets gets current COM speed getcspeed Allowed speeds 50 75 110 134 150 200 300 600 1200 1800 2400 4800 9600 19200 38400 57600 115200 230400 if the baudrate value is not allowed speed defaults to 38400 baud setcspeed lt baudarate gt getname Sets gets current name displayed on the web server index page setname lt name string gt string name can be up to 16 characters listuser Manage current authorized web users list adduser lt username pwd gt deluser lt username pwd gt username and pwd are ASCII string of any length Note The front panel connector requires a straight serial cable pin 2 to pin 2 3 to pin 3 only RX TX GND are required The new firmware release 2 05 or greater provides an additional feature that when enabled takes control over the serial port and allocates a TCP socket to serial converter A TCP socket server is activated on port 2003 any terminal like application can connect as a TCP client and interact remotely with the serial port To enable the TCP socket server see par 4 2 To modify serial port settings when in TCP server mode see within the System Parameters ch 10 Please notice that when the TCP server is enabled the above protocol is not implemented This feature is extremely useful if a serial controlled device is locate
59. th no warranty covering detailed performance Critical problems are covered by a software warranty for a period of 3 three months from the date of shipment Within this period software upgrades will be provided customers can apply software upgrades by using the available tools DOCUMENTATION The documentation included with the unit represents the latest version document and is continually refined end edited Please refer to the support web site at www zpeng com jenet for the latest version ZP ENGINEERING srl JENET User s Manual v 2 2 0 4 43 JENET Ethernet based CAMAC controller 1 2 System overview JENET is a complete CAMAC controller that allows advanced interaction by means of standard Ethernet services such as a local web server and TCP socket based communication protocol The basic hardware architecture of JENET is illustrated below CAMAC bus CAMAC LAN 10 100 bus Front panel control RJ45 RISC PROCESSOR uClinux OS 4 NIM in NIM Front panel input output serial port control 4 NIM i Voltage CRATE power monitoring supplies COMBO 1 COMBO 2 A local processor runs a version of Linux optimized for low memory footprint a CAMAC bus control subsection handles all bus access operations and interactions and a separate NIM subsection manages I O signals located on the front panel 1 3 Summary of features CAMAC o Full CAMAC bus control including LAM detection bus access o Plugs into slots 24 and 25 o
Download Pdf Manuals
Related Search
Related Contents
SVERKER 750 and 780 Commencez par lire ce document! FW-2590S JVC AA V15EG User's Manual Samsung NV9 User Manual 仕様書 L`immeuble, mode d`emploi. Habitat, propriété et usages sociaux d Leica Digicat xf-Series Brochure Wentronic DVB-T d Bedienungsanleitung cn Operating instructions Notice d'emploi z Copyright © All rights reserved.
Failed to retrieve file