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

Can't save the UserDefinedName to the camera #801

Closed
alon-ba opened this issue Dec 19, 2024 · 6 comments
Closed

Can't save the UserDefinedName to the camera #801

alon-ba opened this issue Dec 19, 2024 · 6 comments

Comments

@alon-ba
Copy link

alon-ba commented Dec 19, 2024

Describe what you want to implement and what the issue & the steps to reproduce it are:

I try to set a custom name to the camera, using SetUserDefinedName():

from pypylon import pylon  # version 4.1.0

baslers = pylon.TlFactory.GetInstance().EnumerateDevices()
first_basler = baslers[0]
first_basler.GetUserDefinedName()       # returns an empty string
first_basler.SetUserDefinedName("My_Basler")
first_basler.GetUserDefinedName()       # returns "My_Basler"

But it has nothing to do with the real camera!
It only modifies the python object.
How do I commit this name to the camera?

Is your camera operational in Basler pylon viewer on your platform

Yes

Hardware setup used

MacOS 14.6.1 (23G93)

MacBook Air M3

Camera(s) used

you snippet doesn't work:

tl_factory = py.TlFactory.GetInstance() for dev in tl_factory.EnumerateDevices():
                                            ^^^
SyntaxError: invalid syntax

Runtime information:

python: 3.10.8 (v3.10.8:aaaf517424, Oct 11 2022, 10:14:40) [Clang 13.0.0 (clang-1300.0.29.30)]
platform: darwin/arm64/23.6.0
pypylon: 4.1.0 / 7.3.2.1
@SMA2016a
Copy link
Collaborator

you need to open the camera object and then set the userdefine name to the camera object.

@alon-ba
Copy link
Author

alon-ba commented Dec 19, 2024

@SMA2016a
Could you please write a snippet, how would you do that?
Because i have tried it, and it didn't work for me.

@SMA2016a
Copy link
Collaborator

SMA2016a commented Dec 19, 2024

sure,

camera = pylon.InstantCamera(pylon.TlFactory.GetInstance().CreateFirstDevice())
camera.Open()
camera.DeviceUserID.Value="mycamea"
camera.DeviceReset.Execute()

@alon-ba
Copy link
Author

alon-ba commented Dec 22, 2024

@SMA2016a
Thank you very much 🙏🏼

It actually raises two questions for me -

  1. Is the reset mandatory? or just to make a point, to show that the property persists?
  2. What is the different between DeviceUserId and UserDefinedName?

@SMA2016a
Copy link
Collaborator

  1. a USB camera requires a reset to take over the new setting but not the GigE. Since I do not know which camera you have, I reset the camera.
  2. The GeniCam Node name is DeviceUserId. Cameras parameter names are defined according to GeniCam naming conversion. UserDefinedName is just used in device object in pylon only.

@SMA2016a
Copy link
Collaborator

problem solved

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

2 participants