Spinnaker Camera

684 views
Skip to first unread message

Lufter Reis

unread,
Oct 27, 2023, 7:44:18 PM10/27/23
to the labscript suite
Hi All,
I am trying to TTL, external triggering the Blackly camera using the SpinnakerCamera class in runnmanager. Basically reproduces the connection table mentioned here.

I am triggering the camera through 6-pin GPIO (black-input, blue-ground). But I am getting this error message:
"Traceback (most recent call last):

  File "C:\Users\labadmin\AppData\Local\Programs\Python\Python310\lib\threading.py", line 953, in run

    self._target(*self._args, **self._kwargs)

  File "C:\$PATH$\SpinnakerCamera\blacs_workers.py", line 171, in grab_multiple

  File "C:\$PATH$\SpinnakerCamera\blacs_workers.py", line 157, in grab

    image_result = self.camera.GetNextImage(self.timeout)

  File "C:\$PATH$\PySpin\PySpin.py", line 34318, in GetNextImage

    return _PySpin._SWIG_CamPtr_GetNextImage(self, *args)

_PySpin.SpinnakerException: Spinnaker: Failed waiting for EventData on NEW_BUFFER_DATA event. [-1011]"

I did some research, and this error message means that there is no data inside the buffer. But I could figure out why. Does anybody know what happened?

dihm....@gmail.com

unread,
Nov 2, 2023, 9:19:55 AM11/2/23
to the labscript suite
This is almost certainly an issue with the triggering itself (ie the camera is not seeing the trigger). Could be a lot of issues unfortunately. Could be a configuration error (ie you have to enable a hardware trigger during buffered shots, and switch back to a software trigger in manual mode). Could be a wiring issue on the hirose cable. Could just be that the pulses aren't being generated correctly. This is less likely, but could even be an issue with using a CMOS to drive the TTL and not having enough current due to impedance issues.

Hopefully that is mildly helpful and you get up and running soon.
-David

dsb...@gmail.com

unread,
Nov 2, 2023, 5:16:45 PM11/2/23
to the labscript suite
All of David's suggestions are good. As an author of the SpinnakerCamera (and frequent user), I have three additional thoughts:

1. We often see this error when the timeout is set too short between frames. On our local install, we have the camera dynamically adjust the timeout to 100 ms longer than the maximum time between frames automatically, but I don't know if we pushed this change to the main branch from our fork. I'll check and try to get a pull request set up if we have not.

2. The error can also occur if a frame has not been fully read out before the next trigger occurs. If the error is only thrown at the very end of a "shot" and you have one fewer image in the data file than you expect, then this is likely. Try increasing the time between frames or reducing the readout area of the CCD/CMOS. 

2. Another potential issue is that I believe the SpinnakerCamera is hardcoded to trigger on the falling edge. I recall this causing other users issues on the old PyCaptureCamera and I think that newer labscript cameras with all control in blacs (like SpinnakerCamera) should get everything working automatically, but it might be worth checking.

Daniel

Lufter Reis

unread,
Nov 7, 2023, 5:44:54 PM11/7/23
to the labscript suite
Hi David and Daniel,
Thank you for your suggestions. I am still trying to solve this. I am now back to using SpinView to see if the TTL trigger can work.
The answer is not.

I am following the pin configuration as follows: blue to digital ground and black to source (P0.0 on BNC2100)
image-0.png
image-1.jpeg
image-2.jpeg

And I can verify the TTL trigger by looking at the output on the Oscilloscope. It's a square pulse with low and high (0V/5V) with a duration of 1 second.
Screenshot 2023-11-07 at 5.38.03 PM.png

I've set the camera on SpinView to be the following.
image-2.png

Sorry, I made this to be unrelated to Labscript. But please feel free to make any comment if you have an idea.

Best,
Chun-Wei
dsb...@gmail.com 在 2023年11月2日 星期四下午5:16:45 [UTC-4] 的信中寫道:

Daniel Barker

unread,
Nov 8, 2023, 9:46:20 AM11/8/23
to labscri...@googlegroups.com
I'd suggest configuring the camera to capture a single frame and manually change the trigger channel state in blacs (rather than using a repetitive waveform). I usually use "bulb" trigger mode for testing as it (more or less) ensures that a successful trigger will white out the sensor (I think this setting is "trigger width" in the spinnaker dropdown). I also suggest turning off all the "auto" features (i.e. fix the frame rate, exposure time, gain, etc.).

The only other thing to keep in mind is that the camera trigger is opto-isolated, so it's sensitive to current, not voltage. It's possible that your NI card cannot source the current to drive the opto-isolator. I've never seen this actually happen, but it's possible. I would check if your NI card has a push-pull digital output. If it has an open emitter or open collector output, then it only sources current for one logic state. Therefore, you may only be able to trigger the camera for one of the two trigger polarities.

--
You received this message because you are subscribed to a topic in the Google Groups "the labscript suite" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/labscriptsuite/wEs3B1T1UZg/unsubscribe.
To unsubscribe from this group and all its topics, send an email to labscriptsuit...@googlegroups.com.
To view this discussion on the web, visit https://groups.google.com/d/msgid/labscriptsuite/2ea198ca-0d1d-487c-a35c-c5b54331027cn%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages