areaDetector / ADPvCam

An EPICS areaDetector driver for the Roper Scientific detectors, which includes all cameras from Photometrics and most but not all cameras from Princeton Instruments. The driver is based upon the PVCAM library from Photometrics, and runs on Microsoft Windows and Linux.
http://cars.uchicago.edu/software/epics/pvcamDoc.html
1 stars 6 forks source link

support for windows-x64 #6

Open LeeYangLBLBCS opened 3 months ago

LeeYangLBLBCS commented 3 months ago

the latest PVCamSDK contains both 64 bit and 32 bit dlls. (https://www.photometrics.com/support/software-and-drivers). Will this IOC work with 64 bit dlls?

MarkRivers commented 3 months ago

Yes, I think it should as long as you build with the windows-x64 or windows-x64-static architectures.

LeeYangLBLBCS commented 3 months ago

I tried windows-x64 build first, and saw there was no executable under bin, so I checked the "support" directory, and noticed there are no 64 bit dlls. Do I need to copy the 64 bit dlls to some directory, and then modify the Makefiles to build 64 bit version?

MarkRivers commented 3 months ago

I just realized that the master branch did not support 64-bit, but there was a large pull request that adds 64-bit support. I just merged that pull request.

I downloaded the new version and tried to build it on Windows and Linux. I am getting some errors linking the example IOC applications on Windows. I am getting some compile errors on Linux, but I think they are minor problems and I will work to get them fixed.

MarkRivers commented 3 months ago

It looks like the pull request only added 64-bit support for Linux, not for Windows. I am getting lots of compile errors on Linux, and it does not even try to build for Windows.

MarkRivers commented 3 months ago

pvcamApp/src/Makefile was not even building for 64-bit Windows. I have fixed that and pushed to Github.

Now I get errors on the Windows builds, and some are the same as on Linux. I am working on fixing them.

MarkRivers commented 3 months ago

I have fixed the Makefiles so that now on Windows it compiles, but it fails to build the library because we don't have the 64-bit pvcam .lib file in the distribution.

It now builds fine on Linux.

LeeYangLBLBCS commented 3 months ago

The 64 bit DLL can be download. Though I suspect the vendor won’t allow us to distribute freely.

I can try to build it with the one I downloaded. Is there specific directory I should copy the files into?

On Wed, Mar 27, 2024 at 3:25 PM Mark Rivers @.***> wrote:

I have fixed the Makefiles so that now on Windows it compiles, but it fails to build the library because we don't have the 64-bit pvcam .lib file in the distribution.

It now builds fine on Linux.

— Reply to this email directly, view it on GitHub https://github.com/areaDetector/ADPvCam/issues/6#issuecomment-2024091301, or unsubscribe https://github.com/notifications/unsubscribe-auth/ADSYGNBH2MVG4HK4BGGEPLDY2NBNNAVCNFSM6AAAAABFLTXVWKVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDAMRUGA4TCMZQGE . You are receiving this because you authored the thread.Message ID: @.***>

MarkRivers commented 3 months ago

You don't need the .dll file to build, you only need the .lib file. You only need the .dll file at run time, and Windows will find that for you in the Windows system directories where the vendor package installs it.

I just downloaded the Windows PVCam SDK and unpacked it. I have updated the .lib files in ADPvCam. I have modified the Makefiles to work with this new file.

I have compiled and linked on windows-x64, windows-x64-static, and linux-x86_64 with no errors.

LeeYangLBLBCS commented 3 months ago

thanks for the help. I succeeded with windows-x64-static build. However, the medm screen for "pvCam.adl" is not working: medm -x -macro "P=BJT:, R=pvcam:" pvCam.adl image

MarkRivers commented 3 months ago

It looks like there is a mismatch between the PV names in the IOC and the ones the medm screen is looking for.

What does the "dbl" command at the IOC prompt show?

It looks like the last real commit to the medm screen is this:

commit c91954c8e561be8aa5979723b7a2e5fe93f51cb4
Author: hammonds <hammonds@dc6c5ff5-0b8b-c028-a01f-ffb33f00fc8b>
Date:   Thu Apr 15 04:58:57 2010 +0000

    Add PVs to provide version information for software and firmware where possible.
    Add PVs to provide serial numbers where possible.

The screen should be replaced by one that uses the standard sub-screens.

LeeYangLBLBCS commented 3 months ago

Looks like I should've used the following parameters: medm -x -macro "P=13PVCAM1:,R=cam1:" pvCam.adl image Does this IOC work with "EPICS_AD_Viewer" pluggin? I noticed "13PVCAM1:image1:" PV does not exist in the IOC. Should I use a different PV name for this viewer?

MarkRivers commented 3 months ago

The fact that the ImageJ widget is green for the PVPrefix means the correct PVs do exist. The problem is probably that the Image plugin is not enabled. I think you also need to start the medm screen ADBase.adl. That will let you open the plugin screens. pvCam.adl just shows you the pvCam-specific PVs, it does not let you start and stop acquisition, etc.

LeeYangLBLBCS commented 3 months ago

sorry, I did start ADBase.adl and could start image acquisition via "start", as usual. As for problem with the EPICS_AD_Viewer, I had to change the PV name to 13PVCAM1:image:, as what it usually is with other IOCs: 13PVCAM1:image1:: image

LeeYangLBLBCS commented 3 months ago

the IOC startup log showing the "image1" entry appears normal:
=======================================================
Camera Firmware version available: YES
Camera Firmware Version 30.45
Head Serial Number available: YES
Head Serial Number A24B723025
PCI Firmware version available: YES
PARAM_PCI_FW_VERSION 1
2024/03/28 10:14:35.521 asynPortDriver:setIntegerParam: port=PVCAM error setting parameter 142 in list 0, wrong type
...all current values retrieved.

dbLoadRecords("C:/epics/modules/synApps_6_1_epics7/support/areaDetector-R3-7/ADPvCam/iocs/pvcamIOC/../../db/pvCam.template", "P=13PVCAM1:,R=cam1:,PORT=PVCAM,ADDR=0,TIMEOUT=1")
# Create a standard arrays plugin, set it to get data from pvCamera driver.
**NDStdArraysConfigure("Image1", 1, 0, "PVCAM", 0, 10000000)**
dbLoadRecords("C:/epics/modules/synApps_6_1_epics7/support/areaDetector-R3-7/ADCore/db/NDStdArrays.template", "P=13PVCAM1:,R=image:,PORT=Image1,ADDR=0,TIMEOUT=1,NDARRAY_PORT=PVCAM,TYPE=Int16,FTVL=SHORT,NELEMENTS=4194304")
# Load all other plugins using commonPlugins.cmd
< C:/epics/modules/synApps_6_1_epics7/support/areaDetector-R3-7/ADCore/iocBoot/commonPlugins.cmd
# This is an example file for creating plugins
# It uses the following environment variable macros
# Many of the parameters defined in this file are also in commonPlugins_settings.req so if autosave is being
# use the autosave value will replace the value passed to this file.
# $(PREFIX)      Prefix for all records
# $(PORT)        The port name for the detector.  In autosave.
# $(QSIZE)       The queue size for all plugins.  In autosave.
# $(XSIZE)       The maximum image width; used to set the maximum size for row profiles in the NDPluginStats plugin and 1-D FFT
#                   profiles in NDPluginFFT.
# $(YSIZE)       The maximum image height; used to set the maximum size for column profiles in the NDPluginStats plugin
# $(NCHANS)      The maximum number of time series points in the NDPluginStats, NDPluginROIStats, and NDPluginAttribute plugins
# $(CBUFFS)      The maximum number of frames buffered in the NDPluginCircularBuff plugin
# $(MAX_THREADS) The maximum number of threads for plugins which can run in multiple threads. Defaults to 5.
# Create a netCDF file saving plugin
MarkRivers commented 3 months ago

I just changed the image PV in st.cmd from R=image: to R=image1: to be consistent with most other drivers.

You are getting this error:

2024/03/28 10:14:35.521 asynPortDriver:setIntegerParam: port=PVCAM error setting parameter 142 in list 0, wrong type

I would like to fix that. Please send the output of the following iocsh command:

asynReport 1 PVCAM

That will let me see what parameter 142 is so I can fix it.

LeeYangLBLBCS commented 3 months ago

here is the result of "asynReport 1 PCCAM".  I also included some error message generated by image acquisition by "Start" button inside ADBase.adl:
===========================================
epics> asynReport 1 PVCAM
PVCAM multiDevice:No canBlock:No autoConnect:Yes
    enabled:Yes connected:Yes numberConnects 1
    nDevices 0 nQueued 0 blocked:No
    asynManagerLock:No synchronousLock:No
    exceptionActive:No exceptionUsers 1 exceptionNotifys 0
    traceMask:0x1 traceIOMask:0x0 traceInfoMask:0x1
PVCam PVCAM
  NX, NY:            2048  2048
  Data type:         3
Port: PVCAM
  Timestamp: 2024/03/28 12:08:33.023
  Input EOS[0]:
  Output EOS[0]:
Parameter list 0
Number of parameters is: 148
Parameter 0 type=string, name=PORT_NAME_SELF, value=PVCAM, status=0
Parameter 1 type=string, name=ADCORE_VERSION, value=3.10.0, status=0
Parameter 2 type=string, name=DRIVER_VERSION, value=3.10.0, status=0
Parameter 3 type=string, name=MANUFACTURER, value=PI/Acton, status=0
Parameter 4 type=string, name=MODEL, value=PVCam Cameras, status=0
Parameter 5 type=string, name=SERIAL_NUMBER, value is undefined
Parameter 6 type=string, name=SDK_VERSION, value is undefined
Parameter 7 type=string, name=FIRMWARE_VERSION, value is undefined
Parameter 8 type=asynInt32, name=ACQUIRE, value=0, status=0
Parameter 9 type=asynInt32, name=ACQUIRE_BUSY, value=0, status=0
Parameter 10 type=asynInt32, name=WAIT_FOR_PLUGINS, value=0, status=0
Parameter 11 type=asynInt32, name=ARRAY_SIZE_X, value=2048, status=0
Parameter 12 type=asynInt32, name=ARRAY_SIZE_Y, value=2048, status=0
Parameter 13 type=asynInt32, name=ARRAY_SIZE_Z, value=0, status=0
Parameter 14 type=asynInt32, name=ARRAY_SIZE, value=8388608, status=0
Parameter 15 type=asynInt32, name=ARRAY_NDIMENSIONS, value=0, status=0
Parameter 16 type=asynInt32, name=ARRAY_DIMENSIONS, value is undefined
Parameter 17 type=asynInt32, name=DATA_TYPE, value=3, status=0
Parameter 18 type=asynInt32, name=COLOR_MODE, value=0, status=0
Parameter 19 type=asynInt32, name=UNIQUE_ID, value=0, status=0
Parameter 20 type=asynFloat64, name=TIME_STAMP, value=0, status=0
Parameter 21 type=asynInt32, name=EPICS_TS_SEC, value=0, status=0
Parameter 22 type=asynInt32, name=EPICS_TS_NSEC, value=0, status=0
Parameter 23 type=asynInt32, name=BAYER_PATTERN, value=0, status=0
Parameter 24 type=string, name=CODEC, value is undefined
Parameter 25 type=asynInt32, name=COMPRESSED_SIZE, value is undefined
Parameter 26 type=asynInt32, name=ARRAY_COUNTER, value=284, status=0
Parameter 27 type=string, name=FILE_PATH, value=, status=0
Parameter 28 type=asynInt32, name=FILE_PATH_EXISTS, value is undefined
Parameter 29 type=string, name=FILE_NAME, value=, status=0
Parameter 30 type=asynInt32, name=FILE_NUMBER, value=0, status=0
Parameter 31 type=string, name=FILE_TEMPLATE, value=%s%s_%3.3d.dat, status=0
Parameter 32 type=asynInt32, name=AUTO_INCREMENT, value=0, status=0
Parameter 33 type=string, name=FULL_FILE_NAME, value is undefined
Parameter 34 type=asynInt32, name=FILE_FORMAT, value is undefined
Parameter 35 type=asynInt32, name=AUTO_SAVE, value is undefined
Parameter 36 type=asynInt32, name=WRITE_FILE, value=0, status=0
Parameter 37 type=asynInt32, name=READ_FILE, value=0, status=0
Parameter 38 type=asynInt32, name=WRITE_MODE, value is undefined
Parameter 39 type=asynInt32, name=WRITE_STATUS, value=0, status=0
Parameter 40 type=string, name=WRITE_MESSAGE, value=, status=0
Parameter 41 type=asynInt32, name=NUM_CAPTURE, value is undefined
Parameter 42 type=asynInt32, name=NUM_CAPTURED, value=0, status=0
Parameter 43 type=asynInt32, name=CAPTURE, value=0, status=0
Parameter 44 type=asynInt32, name=DELETE_DRIVER_FILE, value is undefined
Parameter 45 type=asynInt32, name=FILE_LAZY_OPEN, value is undefined
Parameter 46 type=asynInt32, name=CREATE_DIR, value=0, status=0
Parameter 47 type=string, name=FILE_TEMP_SUFFIX, value=, status=0
Parameter 48 type=string, name=ND_ATTRIBUTES_FILE, value=, status=0
Parameter 49 type=asynInt32, name=ND_ATTRIBUTES_STATUS, value=1, status=0
Parameter 50 type=string, name=ND_ATTRIBUTES_MACROS, value=, status=0
Parameter 51 is undefined, name=ARRAY_DATA
Parameter 52 type=asynInt32, name=ARRAY_CALLBACKS, value=1, status=0
Parameter 53 type=asynInt32, name=POOL_MAX_BUFFERS, value is undefined
Parameter 54 type=asynInt32, name=POOL_ALLOC_BUFFERS, value=2, status=0
Parameter 55 type=asynInt32, name=POOL_FREE_BUFFERS, value=0, status=0
Parameter 56 type=asynFloat64, name=POOL_MAX_MEMORY, value=0, status=0
Parameter 57 type=asynFloat64, name=POOL_USED_MEMORY, value=16, status=0
Parameter 58 type=asynInt32, name=POOL_EMPTY_FREELIST, value is undefined
Parameter 59 type=asynInt32, name=NUM_QUEUED_ARRAYS, value=0, status=0
Parameter 60 type=asynFloat64, name=GAIN, value=1, status=0
Parameter 61 type=asynInt32, name=BIN_X, value=1, status=0
Parameter 62 type=asynInt32, name=BIN_Y, value=1, status=0
Parameter 63 type=asynInt32, name=MIN_X, value=0, status=0
Parameter 64 type=asynInt32, name=MIN_Y, value=0, status=0
Parameter 65 type=asynInt32, name=SIZE_X, value=2048, status=0
Parameter 66 type=asynInt32, name=SIZE_Y, value=2048, status=0
Parameter 67 type=asynInt32, name=MAX_SIZE_X, value=2048, status=0
Parameter 68 type=asynInt32, name=MAX_SIZE_Y, value=2048, status=0
Parameter 69 type=asynInt32, name=REVERSE_X, value=0, status=0
Parameter 70 type=asynInt32, name=REVERSE_Y, value=0, status=0
Parameter 71 type=asynInt32, name=FRAME_TYPE, value=0, status=0
Parameter 72 type=asynInt32, name=IMAGE_MODE, value=2, status=0
Parameter 73 type=asynInt32, name=NEXPOSURES, value=1, status=0
Parameter 74 type=asynInt32, name=NEXPOSURES_COUNTER, value=0, status=0
Parameter 75 type=asynInt32, name=NIMAGES, value=100, status=0
Parameter 76 type=asynInt32, name=NIMAGES_COUNTER, value=0, status=0
Parameter 77 type=asynFloat64, name=ACQ_TIME, value=0.1, status=0
Parameter 78 type=asynFloat64, name=ACQ_PERIOD, value=1, status=0
Parameter 79 type=asynFloat64, name=TIME_REMAINING, value=0, status=0
Parameter 80 type=asynInt32, name=STATUS, value=0, status=0
Parameter 81 type=asynInt32, name=TRIGGER_MODE, value is undefined
Parameter 82 type=asynInt32, name=SHUTTER_CONTROL, value=0, status=0
Parameter 83 type=asynInt32, name=SHUTTER_CONTROL_EPICS, value is undefined
Parameter 84 type=asynInt32, name=SHUTTER_STATUS, value=0, status=0
Parameter 85 type=asynInt32, name=SHUTTER_MODE, value=0, status=0
Parameter 86 type=asynFloat64, name=SHUTTER_OPEN_DELAY, value=0, status=0
Parameter 87 type=asynFloat64, name=SHUTTER_CLOSE_DELAY, value=0, status=0
Parameter 88 type=asynFloat64, name=TEMPERATURE, value=25, status=0
Parameter 89 type=asynFloat64, name=TEMPERATURE_ACTUAL, value is undefined
Parameter 90 type=asynInt32, name=READ_STATUS, value is undefined
Parameter 91 type=string, name=STATUS_MESSAGE, value=, status=0
Parameter 92 type=string, name=STRING_TO_SERVER, value=, status=0
Parameter 93 type=string, name=STRING_FROM_SERVER, value=, status=0
Parameter 94 type=asynInt32, name=PVCAM_INITIALIZE_DETECTOR, value=0, status=0
Parameter 95 type=string, name=PVCAM_SLOT1, value=PMUSBCam00, status=0
Parameter 96 type=string, name=PVCAM_SLOT2, value=Empty, status=0
Parameter 97 type=string, name=PVCAM_SLOT3, value=Empty, status=0
Parameter 98 type=asynInt32, name=PVCAM_DETECTORSELECTED, value=1, status=0
Parameter 99 type=string, name=PVCAM_CHIPNAME, value=TMP-Kinetix, status=0
Parameter 100 type=asynInt32, name=PVCAM_NUMPARALLELPIXELS, value=3200, status=0
Parameter 101 type=asynInt32, name=PVCAM_NUMSERIALPIXELS, value=3200, status=0
Parameter 102 type=asynInt32, name=PVCAM_PIXELPARALLELSIZE, value=6500, status=0
Parameter 103 type=asynInt32, name=PVCAM_PIXELSERIALSIZE, value=6500, status=0
Parameter 104 type=asynFloat64, name=PVCAM_CHIPHEIGHT, value=20.8, status=0
Parameter 105 type=asynFloat64, name=PVCAM_CHIPWIDTH, value=20.8, status=0
Parameter 106 type=asynInt32, name=PVCAM_PIXELPARALLELDIST, value=6500, status=0
Parameter 107 type=asynInt32, name=PVCAM_PIXELSERIALDIST, value=6500, status=0
Parameter 108 type=asynInt32, name=PVCAM_POSTMASK, value=52, status=0
Parameter 109 type=asynInt32, name=PVCAM_PREMASK, value=52, status=0
Parameter 110 type=asynInt32, name=PVCAM_POSTSCAN, value=56, status=0
Parameter 111 type=asynInt32, name=PVCAM_PRESCAN, value=56, status=0
Parameter 112 type=asynInt32, name=PVCAM_NUMPORTS, value=0, status=0
Parameter 113 type=asynInt32, name=PVCAM_FULLWELLCAPACITY, value=0, status=0
Parameter 114 type=asynInt32, name=PVCAM_FRAMETRANSFERCAPABLE, value is undefined
Parameter 115 type=asynInt32, name=PVCAM_NUMSPEEDTABLEENTRIES, value=0, status=0
Parameter 116 type=asynInt32, name=PVCAM_SPEEDTABLEINDEX, value=0, status=0
Parameter 117 type=asynInt32, name=PVCAM_SPEEDTABLEINDEX_RBV, value=0, status=0
Parameter 118 type=asynInt32, name=PVCAM_BITDEPTH, value=12, status=0
Parameter 119 type=asynInt32, name=PVCAM_PIXELTIME, value=10, status=0
Parameter 120 type=asynInt32, name=PVCAM_GAININDEX, value=1, status=0
Parameter 121 type=asynInt32, name=PVCAM_GAININDEX_RBV, value=1, status=0
Parameter 122 type=asynInt32, name=PVCAM_MAXGAININDEX, value=1, status=0
Parameter 123 type=asynInt32, name=PVCAM_MINSHUTTEROPENDELAY, value=0, status=0
Parameter 124 type=asynInt32, name=PVCAM_MAXSHUTTEROPENDELAY, value=65535, status=0
Parameter 125 type=asynInt32, name=PVCAM_MINSHUTTERCLOSEDELAY, value=0, status=0
Parameter 126 type=asynInt32, name=PVCAM_MAXSHUTTERCLOSEDELAY, value=65535, status=0
Parameter 127 type=asynInt32, name=PVCAM_SHUTTEROPENDELAY, value=0, status=0
Parameter 128 type=asynInt32, name=PVCAM_SHUTTEROPENDELAY_RBV, value=0, status=0
Parameter 129 type=asynInt32, name=PVCAM_SHUTTERCLOSEDELAY, value=0, status=0
Parameter 130 type=asynInt32, name=PVCAM_SHUTTERCLOSEDELAY_RBV, value=0, status=0
Parameter 131 type=asynFloat64, name=PVCAM_MEASUREDTEMPERATURE, value=0, status=0
Parameter 132 type=asynFloat64, name=PVCAM_MINTEMPERATURE, value=-327.68, status=0
Parameter 133 type=asynFloat64, name=PVCAM_MAXTEMPERATURE, value=327.67, status=0
Parameter 134 type=asynFloat64, name=PVCAM_SETTEMPERATURE, value=0, status=0
Parameter 135 type=asynFloat64, name=PVCAM_SETTEMPERATURE_RBV, value=0, status=0
Parameter 136 type=asynInt32, name=PVCAM_DETECTORMODE, value=0, status=0
Parameter 137 type=asynInt32, name=PVCAM_DETECTORMODE_RBV, value=0, status=0
Parameter 138 type=asynInt32, name=PVCAM_TRIGGERMODE, value=0, status=0
Parameter 139 type=asynInt32, name=PVCAM_TRIGGERMODE_RBV, value=0, status=0
Parameter 140 type=asynInt32, name=PVCAM_TRIGGEREDGE, value=0, status=0
Parameter 141 type=asynInt32, name=PVCAM_TRIGGEREDGE_RBV, value is undefined
Parameter 142 type=string, name=PVCAM_CAMFIRMWAREVERS_RBV, value=30.45, status=0
Parameter 143 type=asynInt32, name=PVCAM_PCIFWVERS_RBV, value=-1, status=0
Parameter 144 type=string, name=PVCAM_HEADSERNUM_RBV, value=A24B723025, status=0
Parameter 145 type=asynInt32, name=PVCAM_SERIALNUM_RBV, value=0, status=0
Parameter 146 type=string, name=PVCAM_PVCAMVERS_RBV, value=3.10.1, status=0
Parameter 147 type=string, name=PVCAM_DEVDRVVERS_RBV, value=50.65, status=0

PVCAM: pArrays[0] report

NDArray  Array address=0000013D0BBC1720:
  ndims=2 dims=[2048 2048 ]
  dataType=3, dataSize=8388608, pData=0000013D0E38A040
  uniqueId=284, timeStamp=1080500913.007424, epicsTS.secPastEpoch=1080500913, epicsTS.nsec=22737748
  referenceCount=1
  number of attributes=0
epics> save_restore:write_save_file: Backup file (./autosave/auto_settings.savB) bad or not found.  Writing a new one. [240328-120938]
save_restore:write_it - unable to open file './autosave/auto_settings.savB' [240328-120938]
*** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
C:\epics\modules\synApps_6_1_epics7\support\autosave-R5-10\asApp\src\save_restore.c(1797): [0x2]=write_it:No such file or directory
save_restore:write_save_file: Can't write new backup file. [240328-120938]
*** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
**ERROR in pvCamAcquisitionTask()->pl_exp_start_seq: errorCode 185 -- Invalid configuration** (PL_ERR_CONFIGURATION_INVALID)
ERROR in getAcquireStatus->pl_exp_check_status: errorCode 184 -- Invalid internal state (PL_ERR_STATE_INVALID)
ERROR in pvCamAcquisitionTask()->pl_exp_start_seq: errorCode 185 -- Invalid configuration (PL_ERR_CONFIGURATION_INVALID)
ERROR in getAcquireStatus->pl_exp_check_status: errorCode 184 -- Invalid internal state (PL_ERR_STATE_INVALID)
save_restore:write_save_file: Backup file (./autosave/auto_settings.savB) bad or not found.  Writing a new one. [240328-121038]
save_restore:write_it - unable to open file './autosave/auto_settings.savB' [240328-121038]
*** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
save_restore:write_save_file: Can't write new backup file. [240328-121038]
*** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
C:\epics\modules\synApps_6_1_epics7\support\autosave-R5-10\asApp\src\save_restore.c(1797): [0x2]=write_it:No such file or directory
ERROR in pvCamAcquisitionTask()->pl_exp_start_seq: errorCode 185 -- Invalid configuration (PL_ERR_CONFIGURATION_INVALID)
ERROR in getAcquireStatus->pl_exp_check_status: errorCode 184 -- Invalid internal state (PL_ERR_STATE_INVALID)
ERROR in pvCamAcquisitionTask()->pl_exp_start_seq: errorCode 185 -- Invalid configuration (PL_ERR_CONFIGURATION_INVALID)
Got a stop event from somewhere...

epics> save_restore:write_save_file: Backup file (./autosave/auto_settings.savB) 
MarkRivers commented 3 months ago

I found and fixed the problem with parameter 142. I also fixed compiler warnings on Linux and Windows.

I don't know the cause of this error:

ERROR in pvCamAcquisitionTask()->pl_exp_start_seq: errorCode 185 -- Invalid configuration (PL_ERR_CONFIGURATION_INVALID)

The following error looks like it might be because your autosave directory or some file in it does not have write permission for the user running the IOC?

pics> save_restore:write_save_file: Backup file (./autosave/auto_settings.savB)
jwlodek commented 3 months ago

The first error has to do with the image format not being valid when creating an acquisition sequence. What are the values for ADMinX, ADMinY, ADSizeX, ADSizeY, and BinX, and BinY?

LeeYangLBLBCS commented 3 months ago

The image size is shown in a previous MEDM screen, assuming that's the same information you are asking about? X start=0 Y start=0 X size = 2048 Y size=2048 ?

jwlodek commented 3 months ago

If this is a kinetix, then the sensor size is 3200 x 3200 (you can actually see this in the pvCam screen on the right). You are probably passing in 2048x2048 via epicsEnvSet. I suggest changing this to 3200x3200 and trying again.

Check this line: https://github.com/areaDetector/ADPvCam/blob/49d8b0590fdc88253b09f9eb0e5e3d2bf6a06acf/iocs/pvcamIOC/iocBoot/iocPvCam/st.cmd#L15

MarkRivers commented 3 months ago

The driver should be fixed so that the sensor size PVs are read from the camera, not from environment variables. The information already exists in the driver as shown in the pvCam.adl screeen. Similarly the FirmwareVersion, SDKVersion, and SerialNumber, should be set, that information also already exists. The Model should be set to the ChipType. Then ADBase will display more useful information.

MarkRivers commented 3 months ago

I have pushed changes to set ADModel, ADMaxSizeX, ADMaxSizeY, ADFirmwareVersion, ADSDKVersion, and ADSerialNumber from the camera. Please test that ADBase.adl now shows the correct values for these.

The driver needs a re-write so that maxSizeX, maxSizeY, and dataType from the constuctor and Config command. They should come from the camera. I am hesitant to do this without a camera to test with.

This driver was written in 2010, and was heavily modeled on ADSimDetector. The code can be simplified quite a bit.

LeeYangLBLBCS commented 3 months ago

Thanks for the update. I pulled in the latest changes, so my current ADPvCam repo shows the following when I enter "git log": ================output of git log======================= commit a622720bef315226ea5cd935416a1dab244cfa86 (HEAD -> master, origin/master, origin/HEAD) Author: Mark Rivers rivers@cars.uchicago.edu Date: Fri Mar 29 12:45:13 2024 -0500

Remove unneeded comment string

commit 2c743de285711a51a2220fc7a1ac66ff0597a327 Author: Mark Rivers rivers@cars.uchicago.edu Date: Fri Mar 29 12:44:37 2024 -0500

Set ADModel, ADMaxSizeX, ADMaxSizeY, ADFirmwareVersion, ADSDKVersion, ASSerialNumber from camera

commit 49d8b0590fdc88253b09f9eb0e5e3d2bf6a06acf Author: Mark Rivers rivers@cars.uchicago.edu Date: Thu Mar 28 14:35:27 2024 -0500

Fix error setting PVIFWVers; fix compiler warnings

commit 12efcb1f455f9b622ba4021502e8ce30e5e25824 Author: Mark Rivers rivers@cars.uchicago.edu Date: Thu Mar 28 13:55:52 2024 -0500

Change image PV R=image1: to be consistent with other drivers

commit c7bef77c0ca2d1c329bf2983aab5ff8f84da9c2f Author: Mark Rivers rivers@cars.uchicago.edu Date: Wed Mar 27 18:00:16 2024 -0500

Change to new Windows library, 64-bit only

commit c3dd87656650ebb412090255e92c1cbdb65d6164 Author: Mark Rivers rivers@cars.uchicago.edu Date: Wed Mar 27 17:59:58 2024 -0500

Change to new Windows library, 64-bit only

========================================

I can see the "Sensor size" being 3200 upon IOC start up. image I then attempted to change the Region size to 3200, such as in the following screen shot: image IOC shows the following error and crashes afterwards, after I attempted to acquire a single image: save_restore: connect failed for channel '13PVCAM1:image:ArrayCallbacks' save_restore: connect failed for channel '13PVCAM1:image:NDAttributesFile' save_restore: connect failed for channel '13PVCAM1:image:NDAttributesMacros' save_restore: connect failed for channel '13PVCAM1:image:PoolUsedMem.SCAN' save_restore: connect failed for channel '13PVCAM1:image:WaitForPlugins' auto_settings.sav: 1219 of 1275 PV's connected save_restore:write_save_file: Backup file (./autosave/auto_settings.savB) bad or not found. Writing a new one. [240329-114219] save_restore:write_it - unable to open file './autosave/auto_settings.savB' [240329-114219]


save_restore:write_save_file: Can't write new backup file. [240329-114219]


C:\epics\modules\synApps_6_1_epics7\support\autosave-R5-10\asApp\src\save_restore.c(1797): [0x2]=write_it:No such file or directory ERROR in pvCamAcquisitionTask()->pl_exp_start_seq: errorCode 185 -- Invalid configuration (PL_ERR_CONFIGURATION_INVALID) ERROR in getAcquireStatus->pl_exp_check_status: errorCode 184 -- Invalid internal state (PL_ERR_STATE_INVALID)

If I don't change the "region" size, the get similar errors, but the IOC would not crash as above.

MarkRivers commented 3 months ago

These errors are because auto_settings.req did not have the new image1: name. I just fixed that.

save_restore: connect failed for channel '13PVCAM1:image:ArrayCallbacks'
save_restore: connect failed for channel '13PVCAM1:image:NDAttributesFile'
save_restore: connect failed for channel '13PVCAM1:image:NDAttributesMacros'
save_restore: connect failed for channel '13PVCAM1:image:PoolUsedMem.SCAN'
save_restore: connect failed for channel '13PVCAM1:image:WaitForPlugins'

Have you changed your startup script to use 3200 for maxSizeX and maxSizeY? You need to do that, those values are still used by the driver.

LeeYangLBLBCS commented 3 months ago

Thanks for the maxSize fix in st.cmd. The only errors I see now are the following (during acquisition only).
Other than that, the camera seems to be working, i.e. acquiring images, and saving to TIFF files.
===========================================================
ERROR in getAcquireStatus->pl_exp_check_status: errorCode 184 -- Invalid internal state (PL_ERR_STATE_INVALID)
ERROR in pvCamAcquisitionTask()->pl_exp_start_seq: errorCode 185 -- Invalid configuration (PL_ERR_CONFIGURATION_INVALID)
ERROR in getAcquireStatus->pl_exp_check_status: errorCode 184 -- Invalid internal state (PL_ERR_STATE_INVALID)
ERROR in pvCamAcquisitionTask()->pl_exp_start_seq: errorCode 185 -- Invalid configuration (PL_ERR_CONFIGURATION_INVALID)
ERROR in getAcquireStatus->pl_exp_check_status: errorCode 184 -- Invalid internal state (PL_ERR_STATE_INVALID)
ERROR in pvCamAcquisitionTask()->pl_exp_start_seq: errorCode 185 -- Invalid configuration (PL_ERR_CONFIGURATION_INVALID)
ERROR in getAcquireStatus->pl_exp_check_status: errorCode 184 -- Invalid internal state (PL_ERR_STATE_INVALID)
ERROR in pvCamAcquisitionTask()->pl_exp_start_seq: errorCode 185 -- Invalid configuration (PL_ERR_CONFIGURATION_INVALID)
ERROR in getAcquireStatus->pl_exp_check_status: errorCode 184 -- Invalid internal state (PL_ERR_STATE_INVALID)
ERROR in pvCamAcquisitionTask()->pl_exp_start_seq: errorCode 185 -- Invalid configuration (PL_ERR_CONFIGURATION_INVALID)
ERROR in getAcquireStatus->pl_exp_check_status: errorCode 184 -- Invalid internal state (PL_ERR_STATE_INVALID)
LeeYangLBLBCS commented 3 months ago

When I tried to start ADPvCam IOC on linux-x86_64, it couldn't fine some .so. file. I saw a few more so. files in pvcamSupport/os/linux_x86_64, should I copy them to ADPvCam/lib? ============== IOC startup error===================== ../../bin/linux-x86_64/pvCamApp st.cmd ../../bin/linux-x86_64/pvCamApp: error while loading shared libraries: libpvcam.so.2: cannot open shared object file: No such file or directory

MarkRivers commented 3 months ago

pvcamSupport/Makefile installs libpvcam.so. However, I see a problem with /ADPvCam/iocs/pvcamIOC/pvcamApp/src/Makefile when building with SHARED_LIBRARIES=YES. I will fix it.

MarkRivers commented 3 months ago

I have fixed 2 Makefiles so it now builds with libpvam.so with STATIC_BUILD=YES or NO,

LeeYangLBLBCS commented 2 months ago

I moved this camera from the Windows machine to a linux, Ubuntu 22.04. The acquisition does not complete, with the following errors in IOC shell: ERROR in getAcquireStatus->pl_exp_check_status: errorCode 184 -- Invalid internal state (PL_ERR_STATE_INVALID) ERROR in getAcquireStatus->pl_exp_check_status: errorCode 184 -- Invalid internal state (PL_ERR_STATE_INVALID) ERROR in getAcquireStatus->pl_exp_check_status: errorCode 184 -- Invalid internal state (PL_ERR_STATE_INVALID) ERROR in getAcquireStatus->pl_exp_check_status: errorCode 184 -- Invalid internal state (PL_ERR_STATE_INVALID) ERROR in getAcquireStatus->pl_exp_check_status: errorCode 184 -- Invalid internal state (PL_ERR_STATE_INVALID) ERROR in getAcquireStatus->pl_exp_check_status: errorCode 184 -- Invalid internal state (PL_ERR_STATE_INVALID) ERROR in getAcquireStatus->pl_exp_check_status: errorCode 184 -- Invalid internal state (PL_ERR_STATE_INVALID) ERROR in getAcquireStatus->pl_exp_check_status: errorCode 184 -- Invalid internal state (PL_ERR_STATE_INVALID) ERROR in getAcquireStatus->pl_exp_check_status: errorCode 184 -- Invalid internal state (PL_ERR_STATE_INVALID) ERROR in getAcquireStatus->pl_exp_check_status: errorCode 184 -- Invalid internal state (PL_ERR_STATE_INVALID) Got a stop event from somewhere... MEDM screen below: image

LeeYangLBLBCS commented 2 months ago

IOC start up log shows binX:0 and binY:0. 
I'm not sure where they are set.
===================================
[startup.txt](https://github.com/areaDetector/ADPvCam/files/14912677/startup.txt)

Initilizing hardware...
width: 3200, height: 3200
Proposed detector mode: 0
Proposed speed table index: 0
Proposed gain: 1
Temperature Setpoint available: 1
Proposed temperature: 0.000000
Open Shutter delay available: 1
Proposed shutter open delay: 0
Close Shutter delay available: 1
Proposed shutter close delay: 0
binX: 0, binY: 0, minx: 0, miny: 0, sizex: 3200, sizey: 3200, triggerMode: 0, exposureTime: 1
ERROR in initializeDetector->pl_exp_setup_seq: errorCode 181 -- Invalid region (PL_ERR_REGION_INVALID)
LeeYangLBLBCS commented 2 months ago

On linux-x86_64 IOC startup, I see the error regarding "unable to lock memory". I wonder if that means my computer needs more RAM?
==============IOC start up log==============================
13PVCAM1:BadPix1:SortFree devAsynInt32::initCommon connectDevice failed asynManager:connectDevice port BADPIX1 not found
13PVCAM1:BadPix1:DroppedOutputArrays_RBV devAsynInt32::initCommon connectDevice failed asynManager:connectDevice port BADPIX1 not found
13PVCAM1:BadPix1:DisorderedArrays_RBV devAsynInt32::initCommon connectDevice failed asynManager:connectDevice port BADPIX1 not found
reboot_restore: entry for file 'auto_settings.sav'
reboot_restore: Found filename 'auto_settings.sav' in restoreFileList.
*** restoring from './autosave/auto_settings.sav' at initHookState 7 (after record/device init) ***
save_restore: Can't open file './autosave/auto_settings.sav'.
save_restore: Trying backup file './autosave/auto_settings.savB'
save_restore: Can't open file './autosave/auto_settings.savB'.
save_restore: Can't figure out which seq file is most recent,
save_restore: so I'm just going to start with './autosave/auto_settings.sav0'.
save_restore: Trying backup file './autosave/auto_settings.sav0'
save_restore: Can't open file './autosave/auto_settings.sav0'.
save_restore: Trying backup file './autosave/auto_settings.sav1'
save_restore: Can't open file './autosave/auto_settings.sav1'.
save_restore: Trying backup file './autosave/auto_settings.sav2'
save_restore: Can't open file './autosave/auto_settings.sav2'.
save_restore: Can't find a file to restore from...save_restore: ...last tried './autosave/auto_settings.sav2'. I give up.
save_restore: **********************************

**save_restore: Can't open save file.epicsThreadRealtimeLock Warning: unable to lock memory.  RLIMIT_MEMLOCK is too small or missing CAP_IPC_LOCK**
iocRun: All initialization complete
# save things every thirty seconds
create_monitor_set("auto_settings.req", 30,"P=13PVCAM1:")
save_restore:readReqFile: unable to open file commonPlugin_settings.req. Exiting.
epics> save_restore: connect failed for channel '13PVCAM1:pvcam:BinX'
MarkRivers commented 2 months ago

@LeeYangLBLBCS I don't think that message is related to physical memory, it is related to a system setting. I have never seen a message about epicsThreadRealtimeLock.

If you are working with a Kinetics camera then I don't think you should be using ADPvCam. Jakub Wlodek has written a new driver for the Kinetics cameras. I used it last week at the NSLS-II HEX beamline, and it worked very well.

This is what Jakub said about it:

Yes I've written a new driver for this purpose, it is available here: https://github.com/NSLS-II/ADKinetix. At this point it is working well and we are able to hit the speeds advertised by the vendor (unlike with ADPVcam the last time you were at NSLS2).

I suggest you try that driver instead.

LeeYangLBLBCS commented 2 months ago

Thanks.ADKinetix worked well.

On Tue, Apr 9, 2024 at 10:46 AM Mark Rivers @.***> wrote:

@LeeYangLBLBCS https://github.com/LeeYangLBLBCS I don't think that message is related to physical memory, it is related to a system setting. I have never seen a message about epicsThreadRealtimeLock.

If you are working with a Kinetics camera then I don't think you should be using ADPvCam. Jakub Wlodek has written a new driver for the Kinetics cameras. I used it last week at the NSLS-II HEX beamline, and it worked very well.

This is what Jakub said about it:

Yes I've written a new driver for this purpose, it is available here: https://github.com/NSLS-II/ADKinetix. At this point it is working well and we are able to hit the speeds advertised by the vendor (unlike with ADPVcam the last time you were at NSLS2).

I suggest you try that driver instead.

— Reply to this email directly, view it on GitHub https://github.com/areaDetector/ADPvCam/issues/6#issuecomment-2045772436, or unsubscribe https://github.com/notifications/unsubscribe-auth/ADSYGNFOBOKKW3WJHPLWS3DY4QSOZAVCNFSM6AAAAABFLTXVWKVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDANBVG43TENBTGY . You are receiving this because you were mentioned.Message ID: @.***>

LeeYangLBLBCS commented 2 months ago

I'm back to the windows-x64 machine (I have two Kinetix cameras). Now with lights shining on the camera, and realized that all pixel values are 0. Could it be because of the following errors shown in the IOC shell? epics> ERROR in pvCamAcquisitionTask()->pl_exp_start_seq: errorCode 185 -- Invalid configuration (PL_ERR_CONFIGURATION_INVALID) ERROR in getAcquireStatus->pl_exp_check_status: errorCode 184 -- Invalid internal state (PL_ERR_STATE_INVALID)

MarkRivers commented 2 months ago

Are you using ADKinetix or ADPvCam on the Windows machine?

LeeYangLBLBCS commented 2 months ago

I'm using ADPvCam on Windows. (Windows 11). Manufacturer's test program, PVCamTest works on windows 11 without any errors. I'm not sure if epics has been tested on win 11 though.

on Ubuntu 22.0.4, I'm using ADKinetix because ADPVCam had some errors when starting up.

interestingly, I had the same 0-pixel problem with ADKinetix, though it went away after I reduced the ROI to a smaller value (2000x2000 or smaller).

The same problem happens on windows, though reducing ROI did not help. By the way, I have set, EPICS_CA_MAX_ARRAY_BYTES=41000000, just to make sure it's large enough.

MarkRivers commented 2 months ago

I think you should probably use ADKinetix on Windows as well. It uses a newer, more efficient API.

I recommend using the ImageJ pvAccess plugin to view the data. Then you don't need to worry about EPICS_CA_MAX_ARRAY_BYTES. You can also switch from 8 to 16 bit mode without needing to change the waveform data type.