basler / pypylon

The official python wrapper for the pylon Camera Software Suite
http://www.baslerweb.com
BSD 3-Clause "New" or "Revised" License
575 stars 208 forks source link

Pypylon - unable to set Width or Height #753

Closed bbartol68 closed 6 months ago

bbartol68 commented 6 months ago

Hello. I'm learning to use Pypylon and am generally pleased with how it's going. However, I noticed a couple parameters (so far) that Pypylon will not allow me to set: Width and Height (for both, I get an exception telling me "Node is not writable"). Here is the code:

def SetImageArea (Width = 4112, Height = 2176, OffsetX = 0, OffsetY = 0):

    cam.Width.Value = Width
    cam.Height.Value = Height
    cam.OffsetX.Value = OffsetX
    cam.OffsetY.Value = OffsetY

I have no problems setting OffsetX and OffsetY per the above code. However, for Width (and Height) I get this exception:

Exception has occurred: AccessException Node is not writable. : AccessException thrown in node 'Width' while calling 'Width.SetValue()' (file 'integert.h', line 77) File "C:\Darkbox\Devices\Specific\Basler\acA4096.py", line 195, in SetImageArea cam.Width.Value = Width ^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Darkbox\Application\DIO_Sandbox.py", line 45, in Camera.SetImageArea (Width = 4112, Height = 2176, OffsetX = 0, OffsetY = 0) _genicam.AccessException: Node is not writable. : AccessException thrown in node 'Width' while calling 'Width.SetValue()' (file 'integert.h', line 77)

Why are those nodes (Width and Height) not writeable? I've tried different values, but I always get the same exception. Please advise.

Thanks, Bill Bartol

Is your camera operational in Basler pylon viewer on your platform

Yes

Hardware setup & camera model(s) used

Model No.: ac4096-11gc Serial No.: 40487748 O/S: Windows 10 Environment: VS Code Connection: POE network switch

Runtime information:

python: 3.11.8 (tags/v3.11.8:db85d51, Feb  6 2024, 22:03:32) [MSC v.1937 64 bit (AMD64)]
platform: win32/AMD64/10
pypylon: 3.0.1 / 7.4.0.38864
bbartol68 commented 6 months ago

Nevermind... I was trying to set the width and height after calling StartGrabbing. This post set me straight:

https://github.com/basler/pypylon/issues/192#issuecomment-573701134

Thanks! : o)

bbartol68 commented 6 months ago

Closed per my last comment.