Hi Mark,
It works out perfectly with the master branch.
Thanks a lot.
Wanming
-----Original Message-----
From: Mark Rivers <rivers at cars.uchicago.edu>
Sent: Monday, September 27, 2021 11:38 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?
Hi Wanming,
Note that what you are trying to do with switching cameras inside the driver should also be possible. You are getting these errors:
(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
Those errors are coming because the arvFeature needs to created when the camera re-connects. I have already added the code to do that in the master branch of ADAravis. This is from the release notes for the future R2-3 release.
### R2-3 (July XXX, 2021)
----
* Improvements to allow reconnecting to the camera and downloading all settings to the camera without restarting the IOC.
* Added arvFeature::initialize() and an std::vector of arvFeatures to allow re-initializing when the camera reconnects.
* Require C++11 so auto iterators can be used.
* Add autosave command create_manual_set(ADAutoSaveMenu.req, ...) to iocBoot/iocAravis/st.cmd.base.
This can be used to save and load the camera and plugin PV when the camera reconnects.
It can also be used to save and load different configurations for different setups.
So if you use the master branch then I think the errors you got will go away.
Mark
________________________________
From: Tech-talk <tech-talk-bounces at aps.anl.gov> on behalf of Liu, Wanming via Tech-talk <tech-talk at aps.anl.gov>
Sent: Monday, September 27, 2021 9:54 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
- References:
- Is it possible to switch to different camera for ADAravis without launching multiple IOC or restart the same IOC with different script? Liu, Wanming via Tech-talk
- Re: Is it possible to switch to different camera for ADAravis without launching multiple IOC or restart the same IOC with different script? Mark Rivers via Tech-talk
- Navigate by Date:
- Prev:
RE: Is it possible to switch to different camera for ADAravis without launching multiple IOC or restart the same IOC with different script? Liu, Wanming via Tech-talk
- Next:
Monitoring with deadband defined a-ch.mezger--- via Tech-talk
- Index:
1994
1995
1996
1997
1998
1999
2000
2001
2002
2003
2004
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
<2021>
2022
2023
2024
- Navigate by Thread:
- Prev:
RE: Is it possible to switch to different camera for ADAravis without launching multiple IOC or restart the same IOC with different script? Liu, Wanming via Tech-talk
- Next:
Monitoring with deadband defined a-ch.mezger--- via Tech-talk
- Index:
1994
1995
1996
1997
1998
1999
2000
2001
2002
2003
2004
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
<2021>
2022
2023
2024
|