Measurement Studio for VC++

cancel
Showing results for 
Search instead for 
Did you mean: 

Interfacing a Scientific Camera to a M series card with DAQmx

I am trying to upgrade a scientific CCD camera interface [having a Hamamatsu C-7041 detector head].  We have been using an ISA bus AT-MIO-16XE-10 card with Measurement Studio ver 6 ActiveX components, [2 pulsers and 1 AD ActiveX icons] programmed with Visual Studio 6 and in Visual C++.  We would like to switch to a PCI-6221 M-series card using Ni-DAQmx and Measurement Studio ver 8.1 running on Visual Studio.Net C++ or VB.net, but I am not sure that the new card can do the job as I am having trouble with the card.  Measurement Studio keeps telling me resources are already in use.  

 

The original application used one of the counters on the ISA card as a master clock pulse running continuously at 100 KHz.  A second counter was used as a start pulse generator that was synch to the master clock.  The camera returns a triggering pulse for each pixel or column of video data as they are pushed out after starting the master clock.  This triggering pulse was used to synch a single channel of analog data conversion.  Data was stored as a cwSafearray and when data was acquired, we fired a data-acquired-event.  The On-data acquired handler captured, stored, and display the data as we desired.    We were able to use this system with several different types and sizes of CCD camera chips for emission and fluorescent detection schemes. Unfortunately, we need to move off of ISA bus and would like to get away from ActiveX components and switch to a PCI bus and Ni class libraries.

 

The m-Series manual implied that their cards would do this job faster and easier, so we bought one.  However I need help making it work.  I can easily create the master clock signal using the Ni-DAQmx task assistant to program the M-series card counter ctr0.  Similarly, I can create a start pulse generation signal of fixed length using counter ctr1.  However, it appears I can not use these signals together.   If I start the master clock and then try to start the StartPulse class object, I get an error message that the resource is already in use. I have tried to work the counters into a single task but have been unsuccessful.   I have been able to manually trigger the start pulse using a Port 0 DIO line but I prefer to use the counter or a PFI line.  The analog input options do not let me set a trigger using a direct DIO line but I can use any of PFI ones. 

 

I am also not sure exactly how best to set up the ADC triggering pulse from the camera.  I had the camera return trigger pulse going to the PFI 2 input and then set the ai0 to use the output of the master clock and trigger off the start pulse.  If I tried to reference trigger to PFI2 the conversion seemed to hang.  The ai0 was set to acquire a fixed N data points.  This was either the number of columns on the CCD or the total number of pixels on the CCD depending on if we were collecting a line spectrum [binning on mode] or an image [binning off mode].  The camera also provides a EOS line that uses negative logic.  I did not use that option in my original code.   The binning mode was set using a single DO line.

 

To summarize, the camera needs

  • A start pulse

  • A master clock

 

The camera returns

  • A trigger pulse

  • A video analog signal

  • A EOS negative logic line

The M-series analog-in must capture the video signal in synch with the camera master clock and the trigger pulse.

FYI - my signals are currently routed via a BNC-2120 interface box.

 

0 Kudos
Message 1 of 2
(5,862 Views)
Please refer to a duplicate post here.
0 Kudos
Message 2 of 2
(5,849 Views)