LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Synchronization of Measurement Instruments with Waveform Generator

Nathan

 

For the cameras that I am using, there are 3 synch modes. 1. No synch (simply takes pictures when the trigger enters). 2. Synch on camera (the camera creates a synch pulse every time it takes a picture. You can link each camera together this way). 3. Synch on others (the camera takes a picture every time it receives a synch pulse). In order to enter mode 3, a pulse has to be generating already and entering the camera. I discovered this only after the code was built. 

 

Thanks for point out the error of the extra iterations. 

 

I do not know why everything is not synched up still. Both devices start off the same trigger and the sample rates are the same and the synch pulse goes to the cameras at the same rate as the sample rate of the cameras. I think there has to be some intrinsic delay in the system that is screwing everything up. 

 

I will update with further progress/problems,

 

Thanks

 

Greg

0 Kudos
Message 41 of 45
(780 Views)

Hey Greg,

 

Another thing to try is setting the start trigger signal (the digital line) to be triggered off the counter as shown below: 

 

Trigger off Counter.JPG

 

Basically I just changed the "Start Digital Edge.VI" trigger line input to be the Ctr0InternalOutput, instead of the ai/StartTrigger. Since the analog input doesn't actually start until the counter pulses start, this may synch everything better if the cameras start with the counter. You can also try playing around with the delay when you generate pulses. Also, If you use an additional counter to send out the pulses, just make sure it has the same frequency as the counter being used as your analog input timebase.

 

If your cameras have the ability to generate a pulse, you may want to try using that pulse as your timebase instead. So you would wire the output pulse coming from the cameras into a PFI line on your card. Then, set the analog input Timing.vi to use that PFI line as it's sample clock. However, your cameras would be controlling your sampling frequency and not your VI, but it should still be synced. 

 

-Nathan H

Software Developer
National Instruments
0 Kudos
Message 42 of 45
(777 Views)

Nathan

 

Thanks for the input again. You have been a lifesaver. 

I will try the various solutions and probably be back with more questions. 

 

Thanks

 

Greg

0 Kudos
Message 43 of 45
(773 Views)

Nathan

 

I like the idea of synchronizing everything off the cameras after the intial trigger goes in. 

 

Basically, i would trigger via labview, generate pulses in the camera, send the pulses to the lab view and have the force sensor take data as the pulse arrived. The force sensor box, made by Dytran, however, has no "synch in" port for bnc cables. Would the labview be able to synch the force sensor or is it stuck just continuously taking data at the rate I tell it once it receives the trigger?  

 

In order to do this, you said "So you would wire the output pulse coming from the cameras into a PFI line on your card." i understand that I would physically wire the cameras from their synch out wire to the pfi line. But how would i alter the labview that you previously attached to do this?

 

Would i just change the counter from CO pulse frequency to counter in since it would be receiving the signal?Would there need be to additional changes? The code as currently built sends out synch pulses to the camera. I would not want that to happen, but would only want the force sensor to be synchronized of the pulses that were generated by the cameras if this is possible. 

 

 

Any help regarding this matter would be greatly appreciated. 

 

Thanks

 

Greg

 

0 Kudos
Message 44 of 45
(758 Views)

Hey Greg,

 

In order to alter the LabVIEW code to use the PFI line as your sample clock, all you need to do is set whatever PFI line you use as the "source" input on your DAQmx Timing VI. Also, since you are generating pulses from your camera now, you no longer need the counter code, so you can remove that. The "sample rate" for the DAQmx Timing VI just needs to be the maximum sample rate that will be coming from the cameras (the "sample rate" doesn't really determine true sampling rate anymore since the rate will be determined by the cameras. Note that the sample rate will determine how long your "Run Time" is though, so I would set it to the same rate that you expect to see from your camera).

 

You also need to make the analog input task start before the trigger task now. This is so the analog task is already ready and waiting by the time the trigger is sent out, so that it is ready to take samples when it starts receiving pulses from the camera. See the example code attached for more detail.    

 

-Nathan H 

Software Developer
National Instruments
0 Kudos
Message 45 of 45
(743 Views)