LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

pop up message immediatly after digital triggering

Hi I am using LabVIEW 8.6. In my experiment I would like to initiate the data acquisition using an external trigger through PFIO/AI start trigger. Same trigger also triggers two high speed video cameras. I would like to see how much time lag is there between the LabVIEW data acuisition and the cameras.

For that I would trigger all three while the cameras focussed on the monitor. As soon as I press the trigger, A message should pop up on the screen which is captured by the cameras.

I tried to insert message generating vi after the "DAQmx Start Trigger.vi" in the attached code by JohnP.

My problem is that the message immeditley pops up. It doesn't wait for the trigger. I moved the message generating vi inside the while loop but the same happens.

 

Could any one please solve this problem. I want message to pop up only after the trigger.

Thanks

Rajeev

 

0 Kudos
Message 1 of 9
(2,978 Views)

The whole idea of a hardware trigger is to isolate the data acquistion from software latencies.  The Start Trigger VI just enables the board to look for the specified signal on the trigger input line.  The software has no clue as to when the trigger occurred until you look at the timestamp on the waveform after you read all the data.

 

My suggestion is to create a signal which can be read as an analog input and an optical input simultaneously.  In a parallel loop create a series of digital outputs which drive physical LEDs (not front panel indicators) in a known pattern with known timing.  Read the DO voltages with AI channels and observe the LEDs on the cameras to see what the correlation is.

 

Lynn

0 Kudos
Message 2 of 9
(2,975 Views)

Hi Rajeev,

 

I think that the test Lynn is proposing would work more effectively for what you're trying to achieve.  Out of curiosity, what signal are you supplying to the PFI line? I'm also curious what hardware you're using for this experiment?

 

Regards,

 

-Dave C

Applications Engineer
National Instruments
0 Kudos
Message 3 of 9
(2,956 Views)

Hi Lynn, thanks for responding.

We are trying to do something similar. We are triggering SCXI through TTL pulse and this signal goes to the PC through USB cable. We are thinking of splitting the USB cable using a USB Y-adapter and moniter/videograph the voltage signal parallely. The videographing cameras are also triggered by the same pulse.

Rajeev

 

0 Kudos
Message 4 of 9
(2,942 Views)

Hi Dave,

The trigger pulse coming to PFIO line is a TTL pulse. I am using SCXI 1600 on SCXI 1000 Chassis. The trigger pulse is supposed to trigger two high speed video cameras and SCXI 1600 simultaneously.

Thanks

Rajeev 

0 Kudos
Message 5 of 9
(2,941 Views)

Rajeev,

 

What do you intend to do with the split USB?  I do not see how that helps.  USB passes messages along with some overhead.  The trigger pulse will not be on that cable as an easily identifiable signal.

 

The OS latency in writing to the monitor may be larger and more variable than what you are trying to measure.

 

What is your ultimate measurement? What is being digitized by the SCXI-1600 and what are the cameras watching?

 

Lynn

0 Kudos
Message 6 of 9
(2,936 Views)

Hi Lynn,

We are measuring forces generated by insects. The aerodynamic forces generated by insects depends a lot on positions and deflections of its wings. Therefore along with measuring forces (using strain gauge balance thriough SCXI 1600 and LabVIEW etc.) we are also simultaneously videographing its flappint wings using two high speed video cameras. The wing deflections will be correlated with the forces and moments generated by the insect. Therefore it is important that the cameras and the force measurement system are syncronized.

 

I tried by continuously acquiring strain gauge date at very high sampling rate (10KS/s) and plotting them on screen (using very low samples to read value of 2).

It works but we got minimum time lag of 1/10 s between the cameras and the DAQ system. and this lag some times goes as high as half a second.

I think OS latency you mentioned is coming into play. 

 

Using USB splitter I plan to parallely moniter the voltage jump associated with the ttrigger pulse by connecting a Voltmeter and videographing the voltmeter screen.

Rajeev

0 Kudos
Message 7 of 9
(2,930 Views)

Rajeev,

 

Sounds like an interesting project.

 

I am no expert in USB, but I do not think your trigger pulse will show up on the USB lines as an easily identifiable signal.  Even USB 1 in Low Speed mode is transmitting at 1.5 Mbit/s.  Your voltmeter cannot track that.

 

My recomendation is to go back to what I suggested earlier.  Put one or more LEDs in the field of view of the cameras. Pulse them in a well defined pattern.  Monitor the drive voltage to the LEDs with an AI channel and record the optical output on your cameras. You have recorded the same signal with both the camera and AI timing so you can determine the delays.

 

Lynn

0 Kudos
Message 8 of 9
(2,917 Views)

Hi Rajeev,

 

I'm working on the presumption that you've also got the SCXI 1520 for strain?  I'd also be interested to see what would happen to the time lag if we took a bigger chunk of samples at once.  A good rule of thumb is to take ~10% of the samples being collected, so in this case 1000 samples to keep from overworking the processor for this task.  I'd suspect we might be able to lessen the load on the processor that way and maybe reduce the lag.

 

I also want to check on what you're planning to use to process and analyze the data you're collecting.  Are you familiar with the NI program DIAdem?  It can be used to synch video with data, which it sounds like is the end goal of your experiment.

 

Keep us posted with the tracking steps regarding the voltage.

 

Regards,

 

-Dave C

Applications Engineer
National Instruments
0 Kudos
Message 9 of 9
(2,912 Views)