Skip to content

Topic/update to pypylon 26.7 - #23

Merged
angelbakardzhiev merged 6 commits into
basler:mainfrom
BslrStickelMichael:topic/update_to_pypylon_26.7
Oct 29, 2026
Merged

angelbakardzhiev merged 6 commits into
basler:mainfrom
BslrStickelMichael:topic/update_to_pypylon_26.7

Conversation

@BslrStickelMichael

Copy link
Copy Markdown
Contributor

Updated samples to work with 26.7 release of pypylon.
Added missing image of camera backside.

"info.SetDeviceClass(\"BaslerUsb\")\n",
"cam = py.InstantCamera(py.TlFactory.GetInstance().CreateFirstDevice(info))"
"device_info = pylon.DeviceInfo()\n",
"# Optionally filter for USB3 cameras only. But ACE2 ethernet cameras do also work.\n",

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ace 2

"source": [
"# open the first USB device\n",
"info = py.DeviceInfo()\n",
"info.SetDeviceClass(\"BaslerUsb\")\n",

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

info.DeviceClass =

"device_info = pylon.DeviceInfo()\n",
"# Optionally filter for USB3 cameras only. But ACE2 ethernet cameras do also work.\n",
"# device_info.SetDeviceClass(\"BaslerUsb\")\n",
"camera = pylon.InstantCamera(device_info, pylon.FirstFound)"

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Dictionary verwenden

"source": [
"# use the Basler Pylon SDK to access the camera\n",
"camera = py.InstantCamera(py.TlFactory.GetInstance().CreateFirstDevice())\n",
"camera.Open()"
"camera = py.InstantCamera(py.FirstFound)\n",

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Abkürzung

"camera = pylon.InstantCamera(pylon.FirstFound)\n",
"camera.Open()\n",
"\n",
"print(camera.GetDeviceInfo().GetModelName())\n",

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

DeviceInfo

" while camera.IsGrabbing():\n",
" with camera.RetrieveResult(1000) as result:\n",
" if result.GrabSucceeded():\n",
" image = result.Array\n",

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Components verwenden, wie die anderen Samples

"info.SetDeviceClass(\"BaslerUsb\")\n",
"cam = py.InstantCamera(py.TlFactory.GetInstance().CreateFirstDevice(info))"
"device_info = pylon.DeviceInfo()\n",
"device_info.SetDeviceClass(\"BaslerUsb\")\n",

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

properties verwenden

"if not cam.GetDeviceInfo().GetModelName().startswith(\"acA\"):\n",
" print(\"_This_ sequencer configuration only works to basler ace USB\")\n",
" "
"if not camera.GetDeviceInfo().GetModelName().startswith(\"acA\"):\n",

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

properties

"for idx, cam in enumerate(cam_array):\n",
" cam.Attach(tlf.CreateDevice(devs[idx]))"
"for index, camera in enumerate(camera_array):\n",
" camera.Attach(tlf.CreateDevice(devices[index]))"

@angelbakardzhiev angelbakardzhiev Sep 22, 2026 •

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
" camera.Attach(tlf.CreateDevice(devices[index]))"
" camera.Attach(tlfactory.CreateDevice(devices[index]))"

"for index, camera in enumerate(camera_array):\n",
" camera_serial = camera.DeviceInfo.GetSerialNumber()\n",
" print(f\"set context {index} for camera {camera_serial}\")\n",
" cam.SetCameraContext(index)"

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
" cam.SetCameraContext(index)"
" camera.SetCameraContext(index)"

"for index, camera in enumerate(camera_array):\n",
" camera_serial = camera.DeviceInfo.GetSerialNumber()\n",
" print(f\"set Exposuretime {index} for camera {camera_serial}\")\n",
" cam.ExposureTimeRaw.Value = 10000"

@angelbakardzhiev angelbakardzhiev Sep 22, 2026 •

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
" cam.ExposureTimeRaw.Value = 10000"
" camera.ExposureTimeRaw.Value = 10000"

" handler = ImageHandler()\n",
" # register with the pylon loop\n",
" cam.RegisterImageEventHandler( handler , py.RegistrationMode_ReplaceAll, py.Cleanup_None)\n",
" camera.RegisterImageEventHandler( handler , py.RegistrationMode_ReplaceAll, py.Cleanup_None)\n",

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
" camera.RegisterImageEventHandler( handler , py.RegistrationMode_ReplaceAll, py.Cleanup_None)\n",
" camera.RegisterImageEventHandler( handler , py.RegistrationMode_ReplaceAll, pylon.Cleanup_None)\n",

Comment on lines +332 to +376
" while cam.IsGrabbing():\n",
" camera.StartGrabbingMax( 100, py.GrabStrategy_LatestImages, py.GrabLoop_ProvidedByInstantCamera)\n",

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
" while cam.IsGrabbing():\n",
" camera.StartGrabbingMax( 100, py.GrabStrategy_LatestImages, py.GrabLoop_ProvidedByInstantCamera)\n",
" camera.StartGrabbingMax( 100, py.GrabStrategy_LatestImages, pylon.GrabLoop_ProvidedByInstantCamera)\n",

@angelbakardzhiev angelbakardzhiev left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

suggestions

@angelbakardzhiev
angelbakardzhiev merged commit adf7387 into basler:main Oct 29, 2026
3 of 7 checks passed
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

Successfully merging this pull request may close these issues.

3 participants