alliedvision / VmbPy

Python API of the Vimba X SDK
BSD 2-Clause "Simplified" License
23 stars 8 forks source link

configuracion de las varias cameras utilizando un archivo de configuracion #8

Closed adri994 closed 1 year ago

adri994 commented 1 year ago

Hello, I have a question.

Is it possible to use a configuration file to be loaded in different cameras? I visualize that each configuration file is unique for each camera since it has a unique ID.

Teresa-AlliedVision commented 1 year ago

Yes, it is possible for cameras of the same model, if the camera specific features are edited to fit the target camera.

adri994 commented 1 year ago

I understand, but would I have to change all the ids in the configuration file and put the camera thing or is there a way to omit that and just put the configuration itself?

And another question if it's not too much trouble, I'm trying to access the DeviceID values but it doesn't allow me, the code I use is this cam.get_feature_by_name('DeviceId')

Teresa-AlliedVision commented 1 year ago

The feature needs to be returned to a feature object (a feature pointer in the other APIs), that can be used to read out the feture. Please also note, that the feature name is case sensitive, so the lower case "d" in DeviceId could also be the issue,

feat = cam.get_feature_by_name("DeviceID")
feat.get(value) #for reading the feature value
adri994 commented 1 year ago

I had just used that same code but the following appears Traceback (most recent call last): File "c:/Users/aduran/Desktop/camaras2/script/synchronous.py", line 23, in <module> print_camera(cam) File "c:/Users/aduran/Desktop/camaras2/script/synchronous.py", line 14, in print_camera feat = cam.get_feature_by_name("DeviceID") File "C:\Users\aduran\AppData\Local\anaconda3\envs\prueba\lib\site-packages\vmbpy\util\context_decorator.py", line 101, in wrapper return func(*args, **kwargs) File "C:\Users\aduran\AppData\Local\anaconda3\envs\prueba\lib\site-packages\vmbpy\util\tracer.py", line 131, in wrapper result = func(*args, **kwargs) File "C:\Users\aduran\AppData\Local\anaconda3\envs\prueba\lib\site-packages\vmbpy\util\runtime_type_check.py", line 58, in wrapper return func(*args, **kwargs) File "C:\Users\aduran\AppData\Local\anaconda3\envs\prueba\lib\site-packages\vmbpy\featurecontainer.py", line 163, in get_feature_by_name raise VmbFeatureError('Feature \'{}\' not found.'.format(feat_name)) vmbpy.error.VmbFeatureError: Feature 'DeviceID' not found.

Teresa-AlliedVision commented 1 year ago

What happens when you run the list_features.py example?

adri994 commented 1 year ago

I was able to find the solution. This was my solution cam.get_local_device().get_feature_by_name('DeviceID') with this it allows me to obtain the information of the Device.

thank you very much for your time and help