Skip to content

External trigger not incrementing frame number / returning on falling edge #62

@kmcgrathgenerate

Description

@kmcgrathgenerate

Edit:

when using external trigger mode in "Sub-Electron Mode" it takes about 9 seconds for a 700 ms exposure signal to read back the image. I was hitting the timeout beforehand and likely grabbing a stale image. things work normally in other read out modes, its specifically sub electron mode

LOGS: READOUT_PORT = 3

Parameters:
Shutter pulse: 750.0 ms

[INIT] Connecting to Kinetix camera...
[CAMERA] Found camera: PMUSBCam00
[CAMERA] Started in Internal Trigger mode
[CAMERA] Live mode started (binning=(4, 4), readout_port=3)

[STEP 1] Live mode + external trigger (baseline)...
[CAMERA] Switched to EXT_TRIG_LEVEL (value=2560)

[TIMING] ========== SEND_PULSE ==========
[TIMING] Shutter: 750 ms
[TIMING] Pulse train completed in 0.910s
[TIMING] ==========================================

Live external trigger: success=True, elapsed_ms=8090.3


I am using an external trigger, which I can confirm through an oscilloscope is being sent to the cameras trigger in. I am setting the camera into trigger mode and despite sending the pulse, when I am in LEVEL mode, the function just goes on to timeout. The image is new and from the pulse, but i have to wait for the poll_frame function to timeout to get the frame each time.

import time
from pyvcam import pvc, constants as const
from pyvcam.camera import Camera

# Initialize and configure camera
pvc.init_pvcam()
cam = next(Camera.detect_camera())
cam.open()
cam.exp_mode = const.EXT_TRIG_LEVEL  # Level trigger mode
cam.start_live()

# Get baseline frame_count
frame, fps, initial_count = cam.poll_frame(timeout_ms=100, oldestFrame=True)
print(f"Initial frame_count: {initial_count}")

# I send pulse here

# Single poll with 10 second timeout - should return when falling edge occurs
frame, fps, new_count = cam.poll_frame(timeout_ms=10000, oldestFrame=True)

print(f"After trigger frame_count: {new_count}")
print(f"Frame count incremented: {new_count > initial_count}")

which prints false for the count increase. but the frame is correct.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions