roboception / rc_genicam_api

Roboception convenience layer around GenICam and GigE Vision.
Other
113 stars 45 forks source link

Read/write for custom registers not in XML camera configuration file #51

Open AndreaFrau opened 2 weeks ago

AndreaFrau commented 2 weeks ago

I have a custom register in an Allied Vision Prosilica camera at address 0x16104, which is not defined as a node in the XML file. I am able to read and write in that register using proprietary SDK (Vimba). However, I am not able to do so via rc_genicam_api. I tried with:

or

I got the following error messages:

terminate called after throwing an instance of 'rcg::GenTLException' what(): CPort::Read(address=0x16104, length=28): ReadMem failed. failed. (-1015)

or

terminate called after throwing an instance of 'std::invalid_argument' what(): Feature not found: 0x16104

I also tried to load an amended xml config file with the new node but it didn't work and the following exception is thrown

terminate called after throwing an instance of 'GenICam_3_4::RuntimeException'

Is it possible to read/write such registers with the current rc_genicam?

heikohimu commented 1 week ago

The cport read/write functions of the rc_genicam_api just call the corresponding GenTL functions. Are you sure that it is legal to read 28 bytes at that address? Maybe it is only allowed to read when some other parameter is set to a certain value? You may also try to use the GenTL Producer that comes with the camera by setting the GENICAM_GENTL64_PATH to the corresponding directory.

AndreaFrau commented 1 week ago

You're right, it is only 4 bytes, but nothing changes. With Vimba there is no other value to set in order to read that register. Do you mean using the GenTL Producer provided by Vimba together with the rc_genicam library? I have just tried and I get "undefined symbol" errors which actually is not unexpected for me.

heikohimu commented 1 week ago

Ok, so reading four bytes at 0x16104 with the cport read method does not work, but it works with the library of the manufacturer? I do not see a reason why it does not work with rc_genicam_api as the cport read / write functions are also used all the time when reading / writing parameters through the XML nodemap and we use this all the time with cameras from different manufacturers.

Yes, in general you can use the rc_genicam_api with different GenTL producers as long as they comply to the GenTL standard. We are using the rc_genicam_api ourselves with producers from Basler, Balluff, Baumer, ...

I do not know how to support you here. My guess is still that reading from that address is only possible if the camera is in a certain "mode".

AndreaFrau commented 1 week ago

Yes, it works with Vimba library. However I would like to make it work via rc_genicam_api library since I use it successfully with several cameras from different manufacturers. This is the first time I am not able to do something with your library. I'll try something more in the next days and let you know in case I find anything new