All,
I had to make a small mod of the RemoteGetCountStatus call to deal with an issue on JEOL 8230/8530 instruments.
An example of calling the spectrometer counting functions are shown here:
Sub TestRemoteCountTest()
' Performs a counter test using the remote counter interface
ierror = False
On Error GoTo TestRemoteCountTestError
Dim maxtunable As Integer
Dim scaler As Integer
Dim alldone As Boolean
Dim done() As Boolean
Dim counts() As Single
Dim counttime As Single, maxcounts As Long
Dim outputfile As String, astring As String
' Define output file
outputfile$ = App.Path & "\TESTREMOTE.DAT"
' Get number of scalers
maxtunable% = Remote.RemoteNumberofTunableSpecs
' Dimension array for counts
ReDim done(1 To maxtunable%) As Boolean
ReDim counts(1 To maxtunable%) As Single
' Unblank beam
Remote.RemoteFaraday Int(2)
' Start counters
counttime! = 10#
maxcounts& = 100000000
alldone = False
For scaler% = 1 To maxtunable%
Remote.RemoteStartCounts scaler%, counttime!, maxcounts&
Next scaler%
' Wait for counts
Do Until alldone
alldone = True
For scaler% = 1 To maxtunable%
If Not done(scaler%) Then done(scaler%) = Remote.RemoteGetCountStatus(scaler%)
DoEvents
If ierror Then GoTo TestRemoteCountTestCancel
If Not done(scaler%) Then alldone = False
Next scaler%
Loop
' Get counts
astring$ = ""
For scaler% = 1 To maxtunable%
counts!(scaler%) = Remote.RemoteGetCountCount(scaler%)
astring$ = astring$ & Format$(counts!(scaler%)) & vbTab
Next scaler%
FormMAIN.TextGetPHADistributionDistribution.Text = astring$
' Stop counters
Remote.RemoteStopAllCounters
' Blank beam
Remote.RemoteFaraday Int(1)
' Write data to file
Open outputfile$ For Append As #1
Print #1, astring$
Close #1
Exit Sub
' Errors
TestRemoteCountTestError:
MsgBox Error$, vbOKOnly + vbCritical, "TestRemoteCountTest"
ierror = True
Exit Sub
TestRemoteCountTestCancel:
MsgBox "Test canceled", vbOKOnly + vbExclamation, "TestRemoteCountTest"
Remote.RemoteStopAllCounters
ierror = True
Exit Sub
End Sub
Thanks to Dan Ruscitto and Owen Neill for catching this.
john