Synchronizing Video and Sound Acquisition with National Instruments Products

Publish Date: Aug 23, 2013 | 1 Ratings | 5.00 out of 5 | Print

Dynamic Signal Acquisition (DSA) devices are widely used to acquire sound and vibration signals. Meanwhile, because of the ease of use and standard interface, IEEE 1394 cameras, also known as Firewire cameras, are rapidly adopted in the machine vision industry. Sometimes, you may want to acquire sound and image signals simultaneously, and then you need to synchronize the DSA acquisition with the IEEE 1394 image acquisition. This article introduces a solution to achieving this task on the National Instruments PXI platform.

National Instruments Products: NI-DAQmxNI VisionNI-IMAQ for IEEE 1394 CamerasNI PXI-8252, NI PXI-6070E, NI PXI-4472

This solution uses one PXI-4472 module to acquire the sound signal and one PXI-8252 module to acquire the video signal from the BASLER A602f camera, which is a typical IEEE 1394 camera.  Figure 1 shows the hardware configuration of the whole system.

Hardware Configuration

Figure 1. Hardware Configuration

In the previous figure, the PXI 4472, PXI 6070E, and PXI 8252 modules are on the same PXI chassis. When the PXI 4472 module starts to acquire data, the analog input sample clock of the module is routed to a trigger line on the PXI chassis backplane. This analog input sample clock of the PXI 4472 module is a pulse train signal. Through the PXI chassis backplane, the pulse train signal is routed to the source of a counter on the PXI-6070E module. The counter divides the clock signal and exports another pulse train signal as the external trigger signal for the camera.

The camera interfaces with the PXI system via an IEEE 1394 socket and an RJ-45 jack located on the back of the housing. A 1394 cable connects the camera to the PXI-8252 module to transfer the video signal. The 6070E module controls the camera by sending the external trigger signal to the RJ-45 jack of the camera through a 1450 Basler Trigger Cable (Part number: 190264-01) that National Instruments provides. Figure 2 shows the back of a camera.

Back of the Camera Housing

Figure 2. Back of the Camera Housing

The Instrumentation & Industrial Digital Camera (IIDC) 1.31 specification provides several external triggering modes for IEEE 1394 cameras. A typical IEEE 1394 camera supports one or more of the triggering modes. In this article, the camera works in the external triggering mode 0. NI-IMAQ for IEEE 1394 Cameras provides the IMAQ1394 Configure Trigger VI that you can use to set the camera to work in mode 0. In this mode, the camera starts to capture the video signal when the external trigger signal changes to an active HIGH value, which you specify when configuring the camera. Figure 3 illustrates the timing diagram of trigger mode 0.

Timing Diagram of Trigger Mode 0

Figure 3. Timing Diagram of Trigger Mode 0

In the previous figure, you can see that after the value of the trigger signal changes to an active HIGH value, the camera starts to capture a frame of the video signal and then transmits the captured frame to the PXI module before starting to capture the next frame. The frequency of the trigger signal determines the actual frame rate of the camera. You can calculate the actual frame rate of the camera using the following equation:

where ⌈x⌉ is the minimum integer value greater than x.

In the previous equation, if the sampling frequency cannot be divided exactly by the expected frame rate, the actual frame rate is slightly smaller than the expected value.

The sample clock of the PXI-4472 module is not available on the PXI chassis backplane until the module starts data acquisition, which ensures that sound acquisition and video acquisition start at the same time. Using the sample clock of the PXI-4472 module as a timebase for the trigger signal of the camera guarantees that the sound and video signals do not drift apart over time.

After you guarantee synchronization on the hardware configuration, you also need to ensure that you conform to the appropriate order to start or stop acquisition, as shown in Figure 4.

Recommended Flowchart of the Acquisition Process

Figure 4. Recommened Flowchart of the Acquisition Process

Figure 5 shows the front panel of the VI that you can use to perform the synchronized acquisition.

Front Panel

Figure 5. Front Panel

Figure 6 shows the corresponding block diagram of the VI.

Block Diagram

Figure 6. Block Diagram

To summarize, the basic concept of achieving synchronization between DSA sound acquisition and IEEE 1394 image acquisition is to generate an external triggering signal for the camera from the sound acquisition sample clock. This can be done by routing the master DSA sample clock to the source of a counter through the PXI chassis backplane.

Click the link in the DOWNLOADS section to download the VI discussed above. You must install the following software to your computer to run this VI properly.

  • LabVIEW Full or Professioal Development System 8.2
  • NI-DAQmx 8.5
  • NI Vision Acquisition Software 8.2.3


Back to Top

Bookmark & Share



Rate this document

Answered Your Question?
Yes No