in our project we do intracellular recordings, controlled with the USB-6363-NI device. We want to synchronise these recordings with camera images (Prime 95B). So far, the camera is only connected directly to the computer and sends its images to the computer.
My question now is about the wiring of the camera to the NI device and the commands in matlab. We connected 3 BCN cables to the camera ('Trigger in', 'Read Out', 'Expose Out 1'). We want to trigger the start of the camera with the 'Trigger In' cable. The cable descriptions can be find here at page 20.
What we already tried:
I'd appreciate any comment or helpful link 😉
I believe you realize that you need to connect the data lines to their special PCIe card to read the captured image.
How are you synchronizing the three signals Read Out, Trigger In and Expose Out 1 for generation or acquisition?
What is your overall requirement in terms of triggering?
Thank you for your answer and the hint to use DO and DI!
Regarding your first comment - the camera is connected to a PCIe card and the computer receives the images properly. I also have access to the time points each frame was taken.
My overall goal is to start the intracellular recordings and the camera at the same time. Thus, the camera needs a start trigger which initiates frame acquisition. I believe I need a hardware trigger from the I/O connector. The trigger just initiates the start of a sequence of acquisitions. Then each frame is controlled by the internal timing generators of the camera.
I assume the 'Trigger In' cable should initiate frame acquisition. 'Read Out' and 'Expose Out 1' should just be an output.
If you would need to synchronize only this camera or any additional triggers to some other equipment?
If it were only this camera, then the easy way would be to export the start trigger of the DO task to a PFI line. Connect the PFI line to 'Trigger In' terminal of the camera.
Camera is looking for only a rising edge, so the typical trigger exported by the instrument will work.
I am not a MATLAB guy, I can provide examples in LabVIEW and you would have to write equivalent in MATLAB.
Use the Digital - Finite Input example, add the code to export the Start Trigger to the required PFI line.
In this implementation, when it starts to acquire samples on the 'Read Out' and 'Expose Out 1' a Start Trigger is sent on the PFI line configured. This way you can still see the time correlation between the moment the trigger was sent and you see signals on the Read Out and Expose Out. Choose an appropriate sampling rate and a number of samples to get finer resolution and longer duration.
To your first question if we only need to synchronize this camera - yes, only intracellular recordings (controlled by the NI board) and the Camera.
As you suggested we connected the start trigger to a PFI line (PFI2/P1.1). Since you suggested that 'Expose Out' and 'Read Out' are digital signals, we put them into PFI0/P1.0 and PFI1/P1.1. You can see the pinout in the picture below:
In Matlab we tried to initialize these channels by
The problem we faced then was that the function to start the intracellular recordings ('startForeground(adconverter)') did not work anymore when both analog and digital channel were activated in one single daq session. Thus, we created another session for the adconverter to initiate only the 'trigger in' digital channel.
We then tried in several ways this:
but faced an error was telling us that no clocked operations are possible.
What we tried apart from that is to connect the 'trigger in' cable again into the analog output plug as you can see in the picture below:
We tried to send a TTL pulse to the camera by sending a vector into this channel with 5 Volt for a certain amount of time (we tried max. 10ms) followed by a zerovector. This did not make the camera start recording.
The first part you did was correct except that you should not define 'Trigger In' as a DO.
Do the following,
what do you use the AOs for in terms of intracellular recording?
Where do those intracellular recordings highlight connections wire to?
How do those intracellular recording signals look against the timing of the three signals highlighted in red?
- What is a PFI line for? We know that a digital PFI is for "Static digital input, static digital output, timing input, timing output", but how does a timing output signal look like? Who gives this signal?
- What are the principles we need to know for triggering? How do we tell the NI board to send a trigger signal to the camera?
- What is a clock connection? Do we need this for our goal?
- Do you know if this approach could be correct?
- How long should a TTL pulse be applied to trigger the start? Is 10ms enough?
You would have to refer to the camera datasheet to know the minimum pulse width required for the rising edge to be detected properly. BTW, are you sure you configured the camera into trigger mode?
Similar to what you suggested we did:
However, then we faced a problem when we queued the stimulus for the intracellular recordings with
The error message was "Unable to accept data because not all channels support clocked operations".
The adconverter object looked like this:
When we don't initialize these digital i/o channels, we don't have that problem of not being able to use startForeground or startBackground.
Thus, we tried to only add the trigger, but the camera still did not start recording. We connected a scope and saw a trigger signal which looked like a sinusoidal curve and did not have the 5Volt amplitude which we assume that we need to trigger the camera.
We had a similar problem before when we plugged the 'trigger in' cable into analog output. When we sent a 5Volt signal for 0.01 ms, we did not see a 5Volt pulse on the scope. However, when we increased the duration of the 5Volt to 1ms, we could see a proper 5Volt signal. Nevertheless the camera did not start recording.
To your question regarding the intracellular recordings: