Files
ADAndor/documentation/prosilicaDoc.html
rivers 9c6f2139a9 New date
git-svn-id: https://subversion.xor.aps.anl.gov/synApps/areaDetector/trunk@15337 dc6c5ff5-0b8b-c028-a01f-ffb33f00fc8b
2012-10-01 19:34:02 +00:00

859 lines
22 KiB
HTML
Executable File

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xml:lang="en" xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>areaDetector Prosilica driver</title>
<meta content="text/html; charset=ISO-8859-1" http-equiv="Content-Type" />
</head>
<body>
<div style="text-align: center">
<h1>
areaDetector Prosilica driver</h1>
<h2>
October 1, 2012</h2>
<h2>
Mark Rivers</h2>
<h2>
University of Chicago</h2>
</div>
<h2>
Contents</h2>
<ul>
<li><a href="#Overview">Overview</a></li>
<li><a href="#StandardNotes">Implementation of standard driver parameters</a></li>
<li><a href="#Driver_parameters">Prosilica specific parameters</a></li>
<li><a href="#Configuration">Configuration</a></li>
<li><a href="#MEDM_screens">MEDM screens</a></li>
<li><a href="#Future">Future enhancements</a></li>
</ul>
<h2 id="Overview">
Overview</h2>
<p>
This is a driver for Gigabit Ethernet and Firewire cameras from <a href="http://www.prosilica.com">
Prosilica</a>. The driver is only supported under Windows (EPICS win32-x86 architecture),
Linux and Mac OS X because the vendor library is provided as a pre-built binary
for those operating systems only. The vendor library provided by Prosilica does
callbacks to a user-supplied function each time there is a new frame. Thus, the
driver does not need to create a thread itself for callbacks."
</p>
<p>
This driver inherits from <a href="areaDetectorDoc.html#ADDriver">ADDriver</a>.
It implements nearly all of the parameters in <a href="areaDetectorDoxygenHTML/asyn_n_d_array_driver_8h.html">
asynNDArrayDriver.h</a> and in <a href="areaDetectorDoxygenHTML/_a_d_driver_8h.html">
ADArrayDriver.h</a>. It also implements a number of parameters that are specific
to the Prosilica cameras. The <a href="areaDetectorDoxygenHTML/classprosilica.html">
prosilica class documentation</a> describes this class in detail.</p>
<h2 id="StandardNotes" style="text-align: left">
Implementation of standard driver parameters</h2>
<p>
The driver redefines the choices for several of the parameters defined in ADDriver.h.
The ADTriggerMode choices for the Prosilica are:
</p>
<ul>
<li>Free Run (collects images as fast as allowed by the camera readout and the exposure
time)</li>
<li>Sync In 1 (external trigger on line 1)</li>
<li>Sync In 2 (external trigger on line 2)</li>
<li>Sync In 3 (external trigger on line 3)</li>
<li>Sync In 4 (external trigger on line 4)</li>
<li>Fixed Rate (collects images at a fixed rate)</li>
<li>Software (single software trigger)</li>
</ul>
<p>
The Prosilica supports hardware timing input and output signals that are supported
in the driver.
</p>
<p>
The NDDataType choices for the Prosilica are:
</p>
<ul>
<li>NDUInt8 (8-bit data)</li>
<li>NDUInt16 (12 or 16 bit data)</li>
</ul>
<p>
The NDColorMode choices for the Prosilica are:
</p>
<ul>
<li>NDColorModeMono (monochromatic data)</li>
<li>NDColorModeBayer (raw Bayer data)</li>
<li>NDColorModeRGB1 (RGB1 data)</li>
</ul>
<p>
The color Prosilica cameras are also capable of various YUV color formats but these
are not supported in the driver. They may be added in a future release.
</p>
<h2 id="Driver_parameters" style="text-align: left">
Prosilica specific parameters</h2>
<p>
The Prosilica driver implements the following parameters in addition to those in
asynNDArrayDriver.h and ADDriver.h:
</p>
<table border="1" cellpadding="2" cellspacing="2" style="text-align: left">
<tbody>
<tr>
<td align="center" colspan="7,">
<b>Parameter Definitions in prosilica.cpp and EPICS Record Definitions in prosilica.template</b>
</td>
</tr>
<tr>
<th>
Parameter index variable</th>
<th>
asyn interface</th>
<th>
Access</th>
<th>
Description</th>
<th>
drvInfo string</th>
<th>
EPICS record name</th>
<th>
EPICS record type</th>
</tr>
<tr>
<td align="center" colspan="7,">
<b>Trigger and I/O Control</b></td>
</tr>
<tr>
<td>
PSTriggerEvent</td>
<td>
asynInt32</td>
<td>
r/w</td>
<td>
The edge or level for the selected trigger signal when ADTriggerMode=Sync In 1 to
SyncIn 4. Allowed values are:<br />
Rising edge<br />
Falling edge<br />
Any edge<br />
High level<br />
Low level </td>
<td>
PS_TRIGGER_EVENT</td>
<td>
$(P)$(R)TriggerEvent<br />
$(P)$(R)TriggerEvent_RBV</td>
<td>
mbbo
<br />
mbbi</td>
</tr>
<tr>
<td>
PSTriggerDelay</td>
<td>
asynFloat64</td>
<td>
r/w</td>
<td>
The delay in seconds between the trigger signal and when the frame is actually acquired.
Minimum value is 1 microsecond. </td>
<td>
PS_TRIGGER_DELAY</td>
<td>
$(P)$(R)TriggerDelay<br />
$(P)$(R)TriggerDelay_RBV</td>
<td>
ao
<br />
ai</td>
</tr>
<tr>
<td>
PSTriggerOverlap</td>
<td>
asynInt32</td>
<td>
r/w</td>
<td>
Controls the behavior when an external trigger signal arrives before the camera
is ready for the next trigger. Allowed values are:<br />
Off - the external trigger is ignored<br />
Previous frame - the external trigger is latched and triggers the next frame when
the current frame completes<br />
</td>
<td>
PS_TRIGGER_OVERLAP</td>
<td>
$(P)$(R)TriggerOverlap<br />
$(P)$(R)TriggerOverlap_RBV</td>
<td>
mbbo
<br />
mbbi</td>
</tr>
<tr>
<td>
PSTriggerSoftware</td>
<td>
asynInt32</td>
<td>
r/w</td>
<td>
Processing this record performs a software trigger if ADTriggerMode=Software.
</td>
<td>
PS_TRIGGER_SOFTWARE</td>
<td>
$(P)$(R)TriggerSoftware</td>
<td>
bo</td>
</tr>
<tr>
<td>
PSSyncIn1Level</td>
<td>
asynInt32</td>
<td>
r/o</td>
<td>
The level of the Sync In 1 signal</td>
<td>
PS_SYNC_IN_1_LEVEL</td>
<td>
$(P)$(R)SyncIn1Level_RBV</td>
<td>
bi</td>
</tr>
<tr>
<td>
PSSyncIn2Level</td>
<td>
asynInt32</td>
<td>
r/o</td>
<td>
The level of the Sync In 2 signal</td>
<td>
PS_SYNC_IN_2_LEVEL</td>
<td>
$(P)$(R)SyncIn2Level_RBV</td>
<td>
bi</td>
</tr>
<tr>
<td>
PSSyncOut1Mode</td>
<td>
asynInt32</td>
<td>
r/w</td>
<td>
The mode of the Sync Out 1 signal. Allowed values are:
<br />
GPO (general purpose output)
<br />
AcqTrigReady
<br />
FrameTrigReady
<br />
FrameTrigger
<br />
Exposing
<br />
FrameReadout
<br />
Imaging
<br />
Acquiring
<br />
SyncIn1
<br />
SyncIn2
<br />
SyncIn3
<br />
SyncIn4
<br />
Strobe1
<br />
Strobe2
<br />
Strobe3
<br />
Strobe4
<br />
</td>
<td>
PS_SYNC_OUT_1_MODE</td>
<td>
$(P)$(R)SyncOut1Mode
<br />
$(P)$(R)SyncOut1Mode_RBV </td>
<td>
mbbo
<br />
mbbi </td>
</tr>
<tr>
<td>
PSSyncOut1Level</td>
<td>
asynInt32</td>
<td>
r/w</td>
<td>
The level of the Sync Out 1 signal. This is only programmable when SyncOut1Mode=GPO.
</td>
<td>
PS_SYNC_OUT_1_LEVEL</td>
<td>
$(P)$(R)SyncOut1Level<br />
$(P)$(R)SyncOut1Level_RBV</td>
<td>
bo<br />
bi</td>
</tr>
<tr>
<td>
PSSyncOut1Invert</td>
<td>
asynInt32</td>
<td>
r/w</td>
<td>
Flag to invert the Sync Out 1 signal.</td>
<td>
PS_SYNC_OUT_1_INVERT</td>
<td>
$(P)$(R)SyncOut1Invert<br />
$(P)$(R)SyncOut1Invert_RBV</td>
<td>
bo<br />
bi</td>
</tr>
<tr>
<td>
PSSyncOut2Mode</td>
<td>
asynInt32</td>
<td>
r/w</td>
<td>
The mode of the Sync Out 2 signal. Allowed values are the same as for PSSyncOut1Mode.
</td>
<td>
PS_SYNC_OUT_2_MODE</td>
<td>
$(P)$(R)SyncOut2Mode
<br />
$(P)$(R)SyncOut2Mode_RBV </td>
<td>
mbbo
<br />
mbbi </td>
</tr>
<tr>
<td>
PSSyncOut2Level</td>
<td>
asynInt32</td>
<td>
r/w</td>
<td>
The level of the Sync Out 2 signal. This is only programmable when SyncOut2Mode=GPO.
</td>
<td>
PS_SYNC_OUT_2_LEVEL</td>
<td>
$(P)$(R)SyncOut2Level<br />
$(P)$(R)SyncOut1Level_RBV</td>
<td>
bo<br />
bi</td>
</tr>
<tr>
<td>
PSSyncOut2Invert</td>
<td>
asynInt32</td>
<td>
r/w</td>
<td>
Flag to invert the Sync Out 2 signal.</td>
<td>
PS_SYNC_OUT_2_INVERT</td>
<td>
$(P)$(R)SyncOut2Invert<br />
$(P)$(R)SyncOut2Invert_RBV</td>
<td>
bo<br />
bi</td>
</tr>
<tr>
<td>
PSSyncOut3Mode</td>
<td>
asynInt32</td>
<td>
r/w</td>
<td>
The mode of the Sync Out 3 signal. Allowed values are the same as for PSSyncOut1Mode.
</td>
<td>
PS_SYNC_OUT_3_MODE</td>
<td>
$(P)$(R)SyncOut3Mode
<br />
$(P)$(R)SyncOut3Mode_RBV </td>
<td>
mbbo
<br />
mbbi </td>
</tr>
<tr>
<td>
PSSyncOut3Level</td>
<td>
asynInt32</td>
<td>
r/w</td>
<td>
The level of the Sync Out 3 signal. This is only programmable when SyncOut3Mode=GPO.
</td>
<td>
PS_SYNC_OUT_3_LEVEL</td>
<td>
$(P)$(R)SyncOut3Level<br />
$(P)$(R)SyncOut3Level_RBV</td>
<td>
bo<br />
bi</td>
</tr>
<tr>
<td>
PSSyncOut3Invert</td>
<td>
asynInt32</td>
<td>
r/w</td>
<td>
Flag to invert the Sync Out 3 signal.</td>
<td>
PS_SYNC_OUT_3_INVERT</td>
<td>
$(P)$(R)SyncOut3Invert<br />
$(P)$(R)SyncOut3Invert_RBV</td>
<td>
bo<br />
bi</td>
</tr>
<tr>
<td>
PSStrobe1Mode</td>
<td>
asynInt32</td>
<td>
r/w</td>
<td>
The mode of the Strobe 1 signal. The Strobe signals are based on the following values,
but allow for changing the delay and width relative to the underlying value. Any
of the outputs can be set to the Stobe1 value, rather than the raw values of these
signals. Allowed values are:
<br />
AcqTrigReady
<br />
FrameTrigReady
<br />
FrameTrigger
<br />
Exposing
<br />
FrameReadout
<br />
Acquiring
<br />
SyncIn1
<br />
SyncIn2
<br />
SyncIn3
<br />
SyncIn4
<br />
</td>
<td>
PS_STROBE_1_MODE</td>
<td>
$(P)$(R)Strobe1Mode
<br />
$(P)$(R)Strobe1Mode_RBV </td>
<td>
mbbo
<br />
mbbi </td>
</tr>
<tr>
<td>
PSStrobe1CtlDuration</td>
<td>
asynInt32</td>
<td>
r/w</td>
<td>
Flag to allow controlling the strobe duration.</td>
<td>
PS_STROBE_1_CTL_DURATION</td>
<td>
$(P)$(R)Strobe1CtlDuration<br />
$(P)$(R)Strobe1CtlDuration_RBV</td>
<td>
bo<br />
bi</td>
</tr>
<tr>
<td>
PSStrobe1Duration</td>
<td>
asynFloat64</td>
<td>
r/w</td>
<td>
The strobe duration if PSStrobe1CtlDuration is On.</td>
<td>
PS_STROBE_1_DURATION</td>
<td>
$(P)$(R)Strobe1Duration<br />
$(P)$(R)Strobe1Duration_RBV</td>
<td>
ao<br />
ai</td>
</tr>
<tr>
<td>
PSStrobe1Delay</td>
<td>
asynFloat64</td>
<td>
r/w</td>
<td>
The strobe delay relative to the underlying signal that the strobe is based on.
</td>
<td>
PS_STROBE_1_DELAY</td>
<td>
$(P)$(R)Strobe1Delay<br />
$(P)$(R)Strobe1Delay_RBV</td>
<td>
ao<br />
ai</td>
</tr>
<tr>
<td align="center" colspan="7,">
<b>Statistics Information</b></td>
</tr>
<tr>
<td>
PSReadStatistics</td>
<td>
asynInt32</td>
<td>
r/w</td>
<td>
Read the Gigabit Ethernet statistics when 1</td>
<td>
PS_READ_STATISTICS</td>
<td>
$(P)$(R)PSReadStatistics</td>
<td>
longout</td>
</tr>
<tr>
<td>
PSStatDriverType</td>
<td>
asynOctet</td>
<td>
r/o</td>
<td>
Driver type</td>
<td>
PS_DRIVER_TYPE</td>
<td>
$(P)$(R)PSDriverType_RBV</td>
<td>
stringin</td>
</tr>
<tr>
<td>
PSStatFilterVersion</td>
<td>
asynOctet</td>
<td>
r/o</td>
<td>
Packet filter version</td>
<td>
PS_FILTER_VERSION</td>
<td>
$(P)$(R)PSFilterVersion_RBV</td>
<td>
stringin</td>
</tr>
<tr>
<td>
PSStatFrameRate</td>
<td>
asynFloat64</td>
<td>
r/o</td>
<td>
Frame rate (Hz)</td>
<td>
PS_FRAME_RATE</td>
<td>
$(P)$(R)PSFrameRate_RBV</td>
<td>
ai</td>
</tr>
<tr>
<td>
PSByteRate</td>
<td>
asynInt32</td>
<td>
r/w</td>
<td>
Stream bytes per second in the PvAPI driver. This allows limiting the bandwidth
that a camera uses. It also allows operation of GigE cameras on non-Gigabit Ethernet
networks by decreasing the value to maximum that the network supports. The default
of 115000000 allows full-speed operation on GigE networks.</td>
<td>
PS_BYTE_RATE</td>
<td>
$(P)$(R)PSByteRate<br />
$(P)$(R)PSByteRate_RBV</td>
<td>
longout<br />
longin</td>
</tr>
<tr>
<td>
PSPacketSize</td>
<td>
asynInt32</td>
<td>
r/o</td>
<td>
Actual packet size of Ethernet packets. When connecting to the camera the driver
always automatically negotiates the largest packet size that the camera and IOC
computer support. </td>
<td>
PS_PACKET_SIZE</td>
<td>
$(P)$(R)PSPacketSize_RBV</td>
<td>
longin</td>
</tr>
<tr>
<td>
PSStatFramesCompleted</td>
<td>
asynInt32</td>
<td>
r/o</td>
<td>
Number of frames completed</td>
<td>
PS_FRAMES_COMPLETED</td>
<td>
$(P)$(R)PSFramesCompleted_RBV</td>
<td>
longin</td>
</tr>
<tr>
<td>
PSStatFramesDropped</td>
<td>
asynInt32</td>
<td>
r/o</td>
<td>
Number of frames dropped</td>
<td>
PS_FRAMES_DROPPED</td>
<td>
$(P)$(R)PSFramesDropped_RBV</td>
<td>
longin</td>
</tr>
<tr>
<td>
PSStatPacketsErroneous</td>
<td>
asynInt32</td>
<td>
r/o</td>
<td>
Number of erroneous packets</td>
<td>
PS_PACKETS_ERRONEOUS</td>
<td>
$(P)$(R)PSPacketsErroneous_RBV</td>
<td>
longin</td>
</tr>
<tr>
<td>
PSStatPacketsMissed</td>
<td>
asynInt32</td>
<td>
r/o</td>
<td>
Number of missed packets</td>
<td>
PS_PACKETS_MISSED</td>
<td>
$(P)$(R)PSPacketsMissed_RBV</td>
<td>
longin</td>
</tr>
<tr>
<td>
PSStatPacketsReceived</td>
<td>
asynInt32</td>
<td>
r/o</td>
<td>
Number of received packets</td>
<td>
PS_PACKETS_RECEIVED</td>
<td>
$(P)$(R)PSPacketsReceived_RBV</td>
<td>
longin</td>
</tr>
<tr>
<td>
PSStatPacketsRequested</td>
<td>
asynInt32</td>
<td>
r/o</td>
<td>
Number of packets requested</td>
<td>
PS_PACKETS_REQUESTED</td>
<td>
$(P)$(R)PSPacketsRequested_RBV</td>
<td>
longin</td>
</tr>
<tr>
<td>
PSStatPacketsResent</td>
<td>
asynInt32</td>
<td>
r/o</td>
<td>
Number of packets resent</td>
<td>
PS_PACKETS_RESENT</td>
<td>
$(P)$(R)PSPacketsResent_RBV</td>
<td>
longin</td>
</tr>
<tr>
<td>
PSBadFrameCounter</td>
<td>
asynInt32</td>
<td>
r/o</td>
<td>
Number of bad frames</td>
<td>
PS_BAD_FRAME_COUNTER</td>
<td>
$(P)$(R)PSBadFrameCounter_RBV</td>
<td>
longin</td>
</tr>
</tbody>
</table>
<h2 id="Configuration">
Configuration</h2>
<p>
The Prosilica driver is created with the prosilicaConfig command, either from C/C++
or from the EPICS IOC shell.</p>
<pre>int prosilicaConfig(char *portName,
const char* cameraId,
int maxBuffers, size_t maxMemory,
int priority, int stackSize, int maxPvAPIFrames)
</pre>
<p>
The <b>cameraId</b> string can be any of the following:</p>
<ul>
<li>The camera's UniqueId, which is a number assigned by the vendor to each Prosilica
camera, e.g. 50110.</li>
<li>The camera's IP address, e.g. 164.54.160.48.</li>
<li>The camera's IP DNS name, e.g. gse-prosilica1.cars.aps.anl.gov.</li>
</ul>
<p>
Using the UniqueId has the advantage that the cameras can be configured to use DHCP,
and hence have non-predictable TCP/IP addresses. However, if the UniqueId is used
then the areaDetector IOC must be on the same subnet as the camera, since cameras
cannot be found by UniqueID through routers. The simplest way to determine the uniqueId
of a camera is to run the Prosilica GigEViewer application, select the camera, and
press the "i" icon on the bottom of the main window to show the camera information
for this camera. The Unique ID will be displayed on the first line in the information
window.</p>
<p>
The IP address or IP DNS name can be used for cameras with fixed IP addresses, and
<b>must</b> be used for cameras that are not on the local subnet.</p>
<p>
The maxPvAPIFrames parameter controls how many frame buffers will be used by the
PvAPI library. This is the last parameter in the prosilicaConfig command, and if
it is absent the default value of 2 is used, which is sufficient in most circumstances.
However, with very high frame rates or busy IOCs increasing this value can reduce
dropped frames.</p>
<p>
For details on the meaning of the other parameters to this function refer to the
detailed documentation on the prosilicaConfig function in the <a href="areaDetectorDoxygenHTML/prosilica_8cpp.html">
prosilica.cpp documentation</a> and in the documentation for the constructor for
the <a href="areaDetectorDoxygenHTML/classprosilica.html">prosilica class</a>.
</p>
<p>
There an example IOC boot directory and startup script (<a href="prosilica_st_cmd.html">iocBoot/iocProsilica/st.cmd)</a>
provided with areaDetector.
</p>
<h2 id="MEDM_screens" style="text-align: left">
MEDM screens</h2>
<p>
The following is the MEDM screen prosilica.adl.
</p>
<div style="text-align: center">
<h3>
prosilica.adl</h3>
<img alt="prosilica.png" src="prosilica.png" /></div>
<p>
The following is the MEDM screen that provides access to the specific parameters
for the Prosilica detector.
</p>
<div style="text-align: center">
<h3>
prosilicaMore.adl</h3>
<img alt="prosilicaMore.png" src="prosilicaMore.png" /></div>
<p>
The following is an IDL <a href="http://cars.uchicago.edu/software/idl/imaging_routines.html#epics_ad_display">
epics_ad_display</a> screen displaying the Prosilica detector images.
</p>
<div style="text-align: center">
<h3>
epics_ad_display.pro</h3>
<img alt="prosilica_tvscl.jpg" src="prosilica_tvscl.jpg" /></div>
<h2 id="Future">
Future enhancements</h2>
<p>
Work is needed on connection management. If the camera is unplugged or powered off
when the areaDetector driver is running it does not gracefully recover.
</p>
</body>
</html>