Hi Mark,
Thanks for the comments.
Now I see what was missing, a call to asynSetTraceIOMask after switch the camera.
Thanks,
Wanming
From: Engbretson, Mark S. <engbretson at anl.gov>
Sent: Monday, September 27, 2021 10:10 AM
To: Liu, Wanming <wmliu at anl.gov>
Cc: tech-talk at aps.anl.gov
Subject: RE: Is it possible to switch to different camera for ADAravis without launching multiple IOC or restart the same IOC with different script?
I would think that what one would do is something similar to this.
# The port name for the detector
epicsEnvSet("PORT1", "ARV1")
# aravisConfig(const char *portName, const char *cameraName, int enableCaching, size_t maxMemory, int priority, int stackSize)
aravisConfig("$(PORT1)", "$(CAMERA_NAME1)", $(ENABLE_CACHING), 0, 0, 0)
asynSetTraceIOMask($(PORT1), 0, 2)
# The port name for the detector
epicsEnvSet("PORT2", "ARV2")
# aravisConfig(const char *portName, const char *cameraName, int enableCaching, size_t maxMemory, int priority, int stackSize)
aravisConfig("$(PORT2)", "$(CAMERA_NAME2)", $(ENABLE_CACHING), 0, 0, 0)
asynSetTraceIOMask($(PORT2), 0, 2)
# The port name for the detector
epicsEnvSet("PORT3", "ARV3")
# aravisConfig(const char *portName, const char *cameraName, int enableCaching, size_t maxMemory, int priority, int stackSize)
aravisConfig("$(PORT3)", "$(CAMERA_NAME3)", $(ENABLE_CACHING), 0, 0, 0)
asynSetTraceIOMask($(PORT3), 0, 2)
and install all the standard support and plugins for each one, and just flip the PV’s to whatever hardware that you are interested in. No?
That is how Mark Rivers does multiple ADSimDetectors.
From: Tech-talk <tech-talk-bounces at aps.anl.gov>
On Behalf Of Liu, Wanming via Tech-talk
Sent: Monday, September 27, 2021 9:55 AM
To: tech-talk at aps.anl.gov
Subject: Is it possible to switch to different camera for ADAravis without launching multiple IOC or restart the same IOC with different script?
Hi,
We have multiple PointGrey BlkFly cameras of the same model on our beamline. We only take image data from one camera at any time.
We could launch multiple ADAravis IOCs with one for each camera and switching PV names in GUI/OPI. But is it possible to launch just one IOC and switch to different cameras as needed?
I added stringout device support to ADAravis and created a record to change the camera name. So far, It seems like I can get the IOC connect to a different camera with pvput. But a lots of errors message will popup when I try to use the
camera.
Here is what I did when the camera name stringout record is being processed.
I added a member function ChangeCamera to ADAravis as
void ADAravis::ChangeCamera(const char *cameraName)
{
delete this->cameraName;
this->cameraName = epicsStrDup(cameraName);
// printf("%s\n",this->cameraName);
connectToCamera();
}
When the CameraName record is processed, it will call this CahngeCamera function.
From the printout of IOC shell as response to the ChangeCamera call,
CameraName 192.168.2.98
ADAravis: Looking for camera '192.168.2.98'...
2021/09/27 09:13:01.493 13ARV1:cam1:ARConnectCamera devAsynInt32::processCallbackOutput process write error
ADAravis: Your tick frequency is 125000000
So your timestamp resolution is 8.000000 ns
It looks like that the camera was successfully switched in aravis, but asyn driver seems to have some troubles.
When I tried to use the camera, lots of error or warning like the following pops up which seems that the other part of the IOC is still using the old camera instance which is no longer exist.
(process:2490): GLib-GObject-WARNING **: 09:20:01.768: invalid uninstantiatable type '<invalid>' in cast to 'ArvGcFeatureNode'
** (process:2490): CRITICAL **: 09:20:01.769: arv_gc_feature_node_is_available: assertion 'ARV_IS_GC_FEATURE_NODE (gc_feature_node)' failed
(process:2490): GLib-GObject-WARNING **: 09:20:01.769: invalid unclassed pointer in cast to 'ArvGcFeatureNode'
** (process:2490): CRITICAL **: 09:20:01.769: arv_gc_feature_node_is_available: assertion 'ARV_IS_GC_FEATURE_NODE (gc_feature_node)' failed
(process:2490): GLib-GObject-WARNING **: 09:20:01.769: invalid unclassed pointer in cast to 'ArvGcFeatureNode'
** (process:2490): CRITICAL **: 09:20:01.769: arv_gc_feature_node_is_available: assertion 'ARV_IS_GC_FEATURE_NODE (gc_feature_node)' failed
(process:2490): GLib-GObject-WARNING **: 09:20:01.769: invalid unclassed pointer in cast to 'ArvGcFeatureNode'
So it will take more than just ADAravis::ConnectToCamera() to make the switching work. But I don’t know what to add to ChangeCamera yet.
Any comments and suggestions will be greatly appreciated.
Thanks,
Wanming Liu
L120B, Bldg 360
HEP,ANL