Skip to content

Commit 4432469

Browse files
committed
Start docs for exporting a signal.
1 parent f812cee commit 4432469

File tree

1 file changed

+14
-4
lines changed

1 file changed

+14
-4
lines changed

code/+vidrio/+sync/readme.md

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ Trigger off the waveform on channel 1 of the scope and change the time scale to
2020
Watch for a while. What do you notice?
2121

2222
Stop the acquisition:
23+
2324
```
2425
>> B.stopAcquisition;R.stopAcquisition;
2526
```
@@ -29,7 +30,10 @@ Will this problem go away if start the two waveforms at exactly the same time?
2930
vidrio.sync.sine_AO_AI triggers the AO task from the AI task so we need to set this up to wait for a trigger:
3031

3132
Set up triggers so nothing happens until 5V goes into PFI0
33+
34+
```
3235
>> B.hAITask.cfgDigEdgeStartTrig('PFI0','DAQmx_Val_Rising'); R.hAITask.cfgDigEdgeStartTrig('PFI0','DAQmx_Val_Rising');
36+
```
3337

3438
Now wire up the rack so that the two PFI0 ports are connected. If using BNC, attach a T-piece to one.
3539

@@ -49,18 +53,24 @@ Stop the acquisition:
4953
```
5054

5155
### Three
52-
Clearly we need a shared clock between the boards.
53-
Each class is set up such that the AI task uses the AO clock.
56+
The clocks are drifting!
57+
Clearly we need a *shared clock* between the boards.
58+
Each class is set up such that the AI task on that device uses the AO clock of the same device.
5459
So all we need to do is have the AO clock of the DAQ in one class use the AO clock of the DAQ in the other class.
5560

56-
Ensure the stopAcquisition methods have been run.
5761

58-
If your cards are in a PXI chassis or linked by an RTSI cable then just do:
62+
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:
63+
64+
5965

6066
```
67+
% Ensure the stopAcquisition methods have been run.
6168
>> B.hAOTask.cfgSampClkTiming(B.sampleRate,'DAQmx_Val_ContSamps', size(B.waveform,1), ['/',R.DAQdevice,'/ao/SampleClock'])
6269
>> B.startAcquisition;R.startAcquisition;
6370
```
6471

6572
Then trigger.
6673
Easy: no more phase delay!
74+
75+
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/).

0 commit comments

Comments
 (0)