Skip to content

Commit 6dad2fa

Browse files
committed
Complete instructions for DAQ sync with exported clock.
1 parent 4432469 commit 6dad2fa

File tree

1 file changed

+16
-2
lines changed

1 file changed

+16
-2
lines changed

code/+vidrio/+sync/readme.md

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,6 @@ So all we need to do is have the AO clock of the DAQ in one class use the AO clo
6262
If your cards are in a PXI chassis or linked by an RTSI cable then you simply tell DAQmx that one device should use the other's clock:
6363

6464

65-
6665
```
6766
% Ensure the stopAcquisition methods have been run.
6867
>> B.hAOTask.cfgSampClkTiming(B.sampleRate,'DAQmx_Val_ContSamps', size(B.waveform,1), ['/',R.DAQdevice,'/ao/SampleClock'])
@@ -73,4 +72,19 @@ Then trigger.
7372
Easy: no more phase delay!
7473

7574
In other situations (e.g. mixed PCI, PXI, or USB; or even devices on different PCs) you will need to [export the clock](http://digital.ni.com/public.nsf/allkb/3A7F1402B2A1CE7686256E93007E66C0).
76-
So look at the device routes and find on which PFI ports the AO sample clock can be is broadcast then we can use [DAQmxExportSignal](http://zone.ni.com/reference/en-XX/help/370471AE-01/daqmxcfunc/daqmxexportsignal/).
75+
So look at the device routes and find on which PFI ports the AO sample clock can be is broadcast then we can use [DAQmxExportSignal](http://zone.ni.com/reference/en-XX/help/370471AE-01/daqmxcfunc/daqmxexportsignal/).
76+
77+
For example, we can export the AO sample clock from one device to PFI10:
78+
```
79+
>> R.hAOTask.exportSignal('DAQmx_Val_SampleClock', 'PFI10')
80+
```
81+
82+
You'll be able to see the pulses on a scope, but they are short: 40 ns or so FWHM.
83+
Next we set the other DAQ to import a clock on PFI1 (we're using PFI0 for the start trigger).
84+
Wire up your DAQ remembering to use PF1 not digital port 1 on line 0.
85+
```
86+
>> B.hAOTask.cfgSampClkTiming(B.sampleRate,'DAQmx_Val_ContSamps', size(B.waveform,1), 'PFI1')
87+
>> B.startAcquisition;R.startAcquisition;
88+
```
89+
90+
Nice synchronised waveforms!

0 commit comments

Comments
 (0)