11
Command Description
TRIG? Returns the value of the trigger setting: 0 = Continuous, 1 = Start/Stop
:WIND N Sets the coincidence window length to N nanoseconds. N must be between 1 and
8.
WIND? Returns the coincidence window length in nanoseconds
3.3 Sample Serial Program
The following sample program (written in Visual Basic 6.0) provides a very simple example of
how serial commands can be used through third-party programs to control the CC1:
MSComm3.PortOpen = True ‘Open COM Port
'-- Prepare Coincidence Counter for Measurements --
MSComm3.Output = ":GATE 0" & Chr$(13) ‘Disable GATE Channel
Sleep 300 'Wait 0.3 seconds for command to transfer
MSComm3.Output = ":SUBT 0" & Chr$(13) 'Turn off Subtract Accidentals option
Sleep 300 'Wait 0.3 seconds for command to transfer
MSComm3.Output = ":TRIG 1" & Chr$(13) 'Set Trigger Option to Start/Stop
Sleep 300 'Wait 0.3 seconds for command to transfer
MSComm3.Output = ":DWEL 20000" & Chr$(13) 'Set Dwell Time to 20 seconds
Sleep 300 'Wait 0.3 seconds for command to transfer
MSComm3.Output = ":DELA 2" & Chr$(13) 'Set Delay Time on Channel 1 to 2ns
Sleep 300 'Wait 0.3 seconds for command to transfer
MSComm3.Output = ":WIND 3" & Chr$(13) ‘Set Coincidence Window to 3 ns
Sleep 300 'Wait 0.3 seconds for command to transfer
'-- Take Measurement --
MSComm3.Output = ":COUN:ON" & Chr$(13)
dt = Now ' Wait for Dwell Time (plus 1 second)
Do While DateDiff("s", dt, Now) < 21
DoEvents()
Sleep 50 'Put app to sleep in small increments
Loop
'--Transfer Measurements --
MSComm3.Output = "COUN:C1?" & Chr$(13) ‘Query Channel 1 Counts
Sleep 300 'Wait 0.3 seconds for command to transfer
Textbox1.text = MSComm3.Input ‘Display counts in a textbox
MSComm3.Output = "COUN:C2?" & Chr$(13) ‘Query Channel 2 Counts
Sleep 300 'Wait 0.3 seconds for command to transfer
Textbox2.text = MSComm3.Input ‘Display counts in a textbox
MSComm3.Output = "COUN:CO?" & Chr$(13) ‘Query Coincidence Counts
Sleep 300 'Wait 0.3 seconds for command to transfer
Textbox3.text = MSComm3.Input ‘Display counts in a textbox
MSComm3.PortOpen = False ‘Close COM Port