Two Versions of GUI App for Reading via Prologix USB GPIB SR400 Two-Channel Gated Photon Counter and Handling Data
Tho, mind you that this app is only for <= 2000 number of periods. See the manual. You can resolve this buffer problem by attaching an Arduino or any chip of your liking
Git Beginner's Guide
install Git from the official site
git clone https://github.com/kkucc/sr400.gitcd sr400git statusgit pullIf you wanna work on something new, first fork the repo on GitHub, then create a branch,(this keeps your changes separate.):
git checkout -b your_branch_namegit add .git commit -m "Your commit message"git push origin your_branch_nameOpen prologix.exe in app via lib. Which is not my app and definitely works for easy communication setup
-
Libs and Software to Download
Before lib installation, you need to visit NI-VISA for:pip install pyvisa
Actually, I don’t think there are so many (some of them are dependencies), but yk...
pip install numpy tkinter matplotlib datetime csv threading time queue
-
# You need to know your PORT address (mine is 5) rm.open_resource('ASRL5') # Also, you need to know your GPIB address (mine is 23) # I used prologix.exe one time, which is really helpful for first steps, # but it should also work. inst = rm.open_resource('GPIB0::23::INSTR')
main8.py will open this GUI app. Let's go through it a little bit.
# Tset(s): 0.001. If you wanna change it,
# don't forget to use enter (you can check yourself in the terminal).
sr400.write(f"CP2, {self.tset * 10 ** 7 + 1}\n") # CP - set counter time interval for 1 period (N) from 10**(-9) to 100 seconds.# N periods: 2000.
#Don't forget to press enter, same with terminal check.
sr400.write(f"NP {self.num_periods}\n") # (1 - 2000)M = 1, M is the number of experiments/loops by N periods in cycle (start/stop) (no terminal output about this parameter).
Avg - average value from 1 M (on the plot, you see green avg dots).
Caution
Don't press the start on record button 'cause its logic is broken.
# A - last digit in A channel buffer (when the cycle was stopped).
# QA - periodic query with some time.sleep()
# from 1519reader.py
data_source.query("QA").strip('\r\n') # in main8 it's sr4
# Same with B, QB.As you can see here, the start button is pressed, and stop and record are available to press. You should press record by yourself, sorry tho.
You can see how the terminal output corresponds to the GUI (plot, values) output.
Recorded Data
How to handle this output you can see in
voltage set.
used Qt Designer.
all previous(lib and soft) should be download too and
pip install pyside6Quite similar tho, it's .py file + main.ui .
Install PyInstaller: You can use PyInstaller to convert your Python script into an executable. First, install it using pip:
pip install pyinstallerNavigate to the directory containing your Python script and run:
pyinstaller --onefile main8.pyThis will create a dist folder containing the .exe file.
For calibration system (via dark counts and GUI app, get this graph).
Idk what is happening here (175-220mV), but after this, I decided to set the SR400 at DISC lvl=+250 mV (where the limit is -300 -- +300).
sr400
EG&G Photon Counter
gui







