As an aid to developing your own custom imaging applications using the Probe for EPMA Remote Server interface, I have attached below a zip file with a very simple but powerful example of a Remote Server imaging application (remember to login to see attachments). This application and the Remote interface are of course free to all PFE customers. Please let us know if you have any questions on using this for your own custom applications.
To demonstrate how simple it is to develop a custom imaging application for your EPMA instrument, see the "get image" routine code inserted below which was written in VB6. The complete VB6 project is in the attached zip file.
Sub TestRemoteImageGet()
' Get analog signal image
ierror = False
On Error GoTo TestRemoteImageGetError
' Send the image channel
Remote.RemoteImageSetImageMode ImageChannel%
Dim done% ' returned, true (-1) if image complete
Dim ntype As Integer ' passed (1 = analog signal, 2 = x-ray)
Dim sxmin As Single, symin As Single ' returned (stage coordinates of corners)
Dim sxmax As Single, symax As Single ' returned (stage ccordinates of corners)
Dim zmin As Long, zmax As Long ' returned (intensity min/max)
ReDim iarray(1 To ImageIx%, 1 To ImageIy%) As Byte ' returned (0-255 normalized intensity data)
ReDim darray(1 To ImageIx%, 1 To ImageIy%) As Long ' returned (raw intensity data)
' Set beam mode to analog or digital spot (comment out other line)
'Remote.RemoteImageSetBeamMode 1 ' set to analog scan mode for SX100 mapping or SX100 video or Bruker or Thermo imaging
Remote.RemoteImageSetBeamMode 2 ' set to digital spot mode for JEOL 8200/8900/8500
' Remove faraday cup
Remote.RemoteFaraday 2
' Start the acquisition
Remote.RemoteImageStart
' Call image get in a loop until complete
Do Until done
Remote.RemoteImageGet done%, ntype%, ImageChannel%, AnalogAverages%, ImageIx%, ImageIy%, sxmin!, symin!, sxmax!, symax!, iarray(), darray&(), zmin&, zmax&
Sleep 100
DoEvents
If ierror Then Exit Do
Loop
' Convert long values to byte array
ReDim barray(1 To ImageIx%, 1 To ImageIy%) As Byte
Screen.MousePointer = vbHourglass
Call BMPConvertLongArrayToByteArray(ImageIx%, ImageIy%, darray&(), barray())
Screen.MousePointer = vbDefault
If ierror Then Exit Sub
' Display intensity data
Call TestRemoteImagingConvertImage(ImageIx%, ImageIy%, barray(), FormMAIN)
If ierror Then Exit Sub
msg$ = "Sxmin=" & Format$(sxmin!) & ", Sxmax=" & Format$(sxmax!) & vbCrLf
msg$ = msg$ & "Symin=" & Format$(symin!) & ", Symax=" & Format$(symax!)
FormMAIN.TextLog.Text = msg$
' Insert faraday cup
Remote.RemoteFaraday 1
' Set beam mode to analog scan mode
'Remote.RemoteImageSetBeamMode 1 ' set to analog scan mode for SX100 mapping or SX100 video or Bruker or Thermo imaging
Exit Sub
' Errors
TestRemoteImageGetError:
MsgBox Error$, vbOKOnly + vbCritical, "TestRemoteImageGet"
ierror = True
Exit Sub
End Sub
Note that your custom code can be developed in any application development environment which supports the active-X interface. This also includes Excel, Matlab, LabView and many other environments that support OLE containers.