w w w . u q d e v i c e s . c o m
L o g i c 1 6 U s e r M a n u a l
| 53
4.3.4
Sample Codes
Visual Basic
Minimal implementations of Logic functions
These implementations consist of a small but useful script that opens the Coincidence Logic Unit, sets
some parameters, and reads once the single and coincidence counts on channels one and two.
Imports TimeTag
Public Class Form1
Dim myTagger As TTInterface
Dim mylogic As Logic
Dim Resolution As Double
Dim Errors As Integer
Private Sub Form1_Load(sender As Object, e As EventArgs) Handles
MyBase.Load
Dim Singles1, Singles2, Coincidences As Integer
Dim FPGA_v, TimerCounter As Double
'open connection to device
myTagger = New TTInterface
myTagger.Open()
'get some basic info and display
Resolution = myTagger.GetResolution()
FPGA_v = myTagger.GetFpgaVersion()
MsgBox("FPGA Version: " & FPGA_v.ToString & vbCrLf & _
"Timing Resolution: " & Resolution.ToString & " s" &
vbCrLf & vbCrLf & vbCrLf & _
vbTab & vbTab & "Start Measurment Now?")
'set input thresholds for channel 1 and 2
myTagger.SetInputThreshold(1, 0.3)
myTagger.SetInputThreshold(2, 0.3)
'initiate logic mode
mylogic = New
Logic(myTagger)
mylogic.SwitchLogicMode()
'conicidence window (in units of 156ps)
mylogic.SetWindowWidth(20)