Skip to content

A python library to configure and readout the SIS3316 16-ch sampling ADC (struck.de)

License

Notifications You must be signed in to change notification settings

InfoProjekt19/SIS3316-1

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

SIS3316 VME 16 channel ADC

The python library implements a simple RESTful interface to a Struck SIS3316 VME ADC board and allows to configure it and to perform readout. VME interface is to be implemented one day, now only Ethernet interface is supported.

The library was created by enthusiast and has no official support from the Struck company. For the representatives of the Struck: if you are interested in cooperation, please contact me by email sergey-inform@ya.ru.

Installation

Download and unpack the code.

Or you can run this command in linux terminal: git clone https://github.com/sergey-inform/SIS3316

Library Usage

At first set up a network connection with your SIS3316 module. Since sis3316 doesn't support ARP protocol, you must tell it's mac address to your system by hand. Read details in SIS3316 Ethernet Manual.

For example: add a line 00:00:56:31:60:XX NN.NN.NN.NN (XX -- serial No. of your device in hex, NN.NN.NN.NN -- the device IP address) to your /etc/ethers file and run:

arp -f

Then run python SIS3316/tools/check_connection.py NN.NN.NN.NN 1234 to check SIS3316 is accessible via network.

To try out the library interactivlely just run a python interpreter in SIS3316 directory.

python -B

Example:

>>>import sis3316
>>>dev = sis3316.Sis3316_udp('NN.NN.NN.NN', 1234)  #NN.NN.NN.NN -- device IP address
>>>dev.open() #enable access via Ethernet
>>>print(dev.id, dev.serno, dev.temp)
('0x33162003', 80, 44.75)
...
>>>dev.close() #enable access via VME

Tools

The tools directory contains some ready-to-use scripts for sis3316 to perform configuration, readout and some basic data analysis. They were made for the cosmics tests of the PANDA "Shaslik" calorimeter prototype (the work was supported by a grant from the “FAIR-Russia Research Centre” in 2015).

check_connection.py -- Basic socket communication, not dependent on sis3316 library, to see if the sis3316 is online

conf.py -- Outputs/loads in config file for the struck daq. config.in is a sample file. Run with the --documentation flag to see possible config file options

readout.py -- perform a device readout, write raw data to the binary files (a file per channel). Make sure your jumbo frame size is set correctly in sis3316/sis3316_udp.py

Each readout operation preceeded by a header:

| AAA<a>    |  nSpill(8) |
| x(4)| size in words(28)|

a=1 -- header format 
nSpill -- sequential number of readout
size in words -- a size of data in the bank
x -- reserved

A stack of tools: The next one use the previous ones.

  • readout
  • readout-pack
  • parse (data-> ts+features+waveforms) order by ts, ts rollover.
  • +parse-unpack -- read a packed ADC data stream, parse events and order them by ts
  • integrate --ped= --len= -> events (text) ts, ch, val, ped, dped
  • scope <dev/file> -> gui with waveforms and histogram

  • coinc -> coinc stats
  • trig -> events (text)
  • hist --bins --range --bin-count => histogram.txt
  • fit --gauss --kern --landau => val, err, khi2

VME FPGA Version

Ethernet UDP protocol has changed with VME FPGA Version V3316-2008 and it is not compatible with previous versions. There is now a 1-byte identifier in all communication packets. If you are on VME FPGA 2007 or earlier, change the variable VME_FPGA_VERSION_IS_0008_OR_HIGHER to False in /sis3316/sis3316_udp.py.

Notes

You can forward UDP traffic from one network to another with: stone -n 10.0.0.1:3333/udp 2222/udp -- 192.168.100.1:2222/udp 3333/udp # forwards requests from 192.168.100.1:2222 (PC) to 10.0.0.1:3333 (ADC Node)

Scope

The Scope contains a GUI to use SIS3316 as a 16-channel digital oscilloscope. This requires the wxPython module. For dependencies check here

About

A python library to configure and readout the SIS3316 16-ch sampling ADC (struck.de)

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Python 100.0%