Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Finds device, but throws AccessException (no XML parser error) #446

Open
3 of 5 tasks
SartorL opened this issue Feb 26, 2024 · 2 comments
Open
3 of 5 tasks

Finds device, but throws AccessException (no XML parser error) #446

SartorL opened this issue Feb 26, 2024 · 2 comments

Comments

@SartorL
Copy link

SartorL commented Feb 26, 2024

Describe the Issue
Device and GenTL producer were found without a problem.
Could not get ownership of device.

This error is similar to previously reported issue "Python & Critical Link GenTL (XML parser error) #368"
AccessException thrown (file 'NodeMapRef.h', line 497) is the same
However, I did not get a runtime exception thrown for XmlParser.cpp

To Reproduce
Steps to reproduce the behavior:
Followed harvesters install: https://github.com/genicam/harvesters/blob/master/docs/INSTALL.rst
And tutorial: https://github.com/genicam/harvesters/blob/master/docs/TUTORIAL.rst
up to ia = h.create()

Sample Code
I can show a piece of code that demonstrates the reported phenomenon:

  • Yes
  • No
(base) C:\Users\.......>conda activate genicam

(genicam) C:\Users\.......>python
Python 3.11.7 | packaged by Anaconda, Inc. | (main, Dec 15 2023, 18:05:47) [MSC v.1916 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.

>>> from harvesters.core import Harvester
>>> h = Harvester()
>>> h.files
[]
>>> h.add_file('C:\\Program Files\\Balluff\\ImpactAcquire\\bin\\x64\\mvGenTLProducer.cti')
>>> h.files
['C:\\Program Files\\Balluff\\ImpactAcquire\\bin\\x64\\mvGenTLProducer.cti']
>>> h.update()

>>> print(h.device_info_list)
[{'access_status': 1, 'display_name': 'Xenics Gobi+ 640 GigE(00:1b:aa:01:19:42)', 'id_': 'Gobi+ 640 GigE(00:1b:aa:01:19:42)', 'model': 'Gobi+ 640 GigE', 'parent': <genicam.gentl.Interface; proxy of <Swig Object of type 'std::shared_ptr< GenTLCpp::TLInterface > *' at 0x0000014E920A2A60> >, 'serial_number': '13136', 'thisown': True, 'tl_type': 'GEV', 'user_defined_name': '', 'vendor': 'Xenics', 'version': '1.0.2'}]

>>> ia = h.create({'serial_number': '13136'})

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "C:\Users\.......\anaconda3a\envs\genicam\Lib\site-packages\harvesters\core.py", line 3082, in create
    return self._create_acquirer(device_proxy=device_proxy, config=config)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\.......\anaconda3a\envs\genicam\Lib\site-packages\harvesters\core.py", line 3112, in _create_acquirer
    ia = ImageAcquirer(device_proxy=device_proxy_, config=config,
         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\.......\anaconda3a\envs\genicam\Lib\site-packages\harvesters\core.py", line 1631, in __init__
    self._remote_device = RemoteDevice(
                          ^^^^^^^^^^^^^
  File "C:\Users\.......\anaconda3a\envs\genicam\Lib\site-packages\harvesters\core.py", line 485, in __init__
    super().__init__(
  File "C:\Users\.......\anaconda3a\envs\genicam\Lib\site-packages\harvesters\core.py", line 281, in __init__
    self._node_map = self._create_node_map(
                     ^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\.......\anaconda3a\envs\genicam\Lib\site-packages\harvesters\core.py", line 355, in _create_node_map
    node_map.connect(concrete_port, port.name)
  File "C:\Users\.......\anaconda3a\envs\genicam\Lib\site-packages\genicam\genapi.py", line 1950, in connect
    return self._connect(*args)
           ^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\.......\anaconda3a\envs\genicam\Lib\site-packages\genicam\genapi.py", line 1860, in _connect
    return _genapi.NodeMap__connect(self, *args)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
_genapi.AccessException: Feature not present (reference not valid) : AccessException thrown (file 'NodeMapRef.h', line 497)
>>>

Configuration

  • OS: Windows 10
  • Python: 3.11.7
  • Harvester: 1.4.2
  • GenTL Producer: Impact Acquire, mvGenTLProducer.cti
  • Camera: Xenics Gobi+ 640 GigE

Reproducibility

This phenomenon can be stably reproduced:

  • Yes
  • No.

Actions You Have Taken

  • Tried "ia = h.create()" as well as "ia = h.create({'serial_number': '13136'})"
  • I've read the Harvester FAQ page.
@sunavlis
Copy link
Member

Hi @SartorL

Thanks for your bug report. It looks quite weird. I'm not sure why you get this error message, but maybe something is wrong with the provided XML file.

Could you run your script with enabled debug logging?

import logging
from harvesters.core import Harvester
FORMAT = '%(name)s - %(asctime)s: %(message)s'
logging.basicConfig(level=logging.DEBUG, format=FORMAT)

h = Harvester(logger=logging.getLogger("harvesters"))
....

In the log you will see few temporary path to the XML. Could you try to get that file as well? I just realized, that the do_clean_up flag is not propagated to the Device module. But maybe you have another option to read the camera XML...?

@ArivCR7
Copy link

ArivCR7 commented Sep 19, 2024

@SartorL , Were you able to fix this? If so, kindly share the resolution.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants