Skip to content

Commit f812cee

Browse files
committed
minor
1 parent f0ec268 commit f812cee

File tree

1 file changed

+14
-3
lines changed

1 file changed

+14
-3
lines changed

code/+vidrio/+sync/readme.md

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,28 @@
1+
# Synchronising DAQ operations across devices
2+
13
The examples in this folder relate to synchronising tasks.
24
It's assumed you're already familiar with the information in vidrio.mixed
35
Also see ContinuousAI.c in the DAQmx_ANSI_C_examples directory
46

57
### One
68
Let's start two tasks at the same time on different DAQs from the command line.
79
Hook up the AO0 lines of each DAQ to a scope then run:
10+
11+
```
812
>> B=vidrio.sync.sine_AO_AI('Dev1');
913
>> R=vidrio.sync.sine_AO_AI('Dev2');
1014
>> B.startAcquisition;R.startAcquisition;
15+
```
1116

1217
Where 'Dev1' and 'Dev2' are your DAQ names.
1318
You should see two waveforms with a phase shift.
1419
Trigger off the waveform on channel 1 of the scope and change the time scale to show about one cycle of the waveform.
1520
Watch for a while. What do you notice?
1621

1722
Stop the acquisition:
23+
```
1824
>> B.stopAcquisition;R.stopAcquisition;
19-
25+
```
2026

2127
### Two
2228
Will this problem go away if start the two waveforms at exactly the same time?
@@ -27,17 +33,20 @@ Set up triggers so nothing happens until 5V goes into PFI0
2733
2834
Now wire up the rack so that the two PFI0 ports are connected. If using BNC, attach a T-piece to one.
2935

36+
```
3037
>> B.startAcquisition;R.startAcquisition;
38+
```
3139

3240
Nothing happens on the scope until you hook up PFI0 (e.g. with your T connector) to +5 (the breakout box provides this)
33-
You can un-plug the 5V line right away, it's only needed transiently for the trigger.
41+
You can unplug the 5V line right away, it's only needed transiently for the trigger.
3442

3543
What do you see on the scope? The waveforms should be in phase perfectly. Nice, huh?
3644
Keep watching. Ah.....
3745

3846
Stop the acquisition:
47+
```
3948
>> B.stopAcquisition;R.stopAcquisition;
40-
49+
```
4150

4251
### Three
4352
Clearly we need a shared clock between the boards.
@@ -48,8 +57,10 @@ Ensure the stopAcquisition methods have been run.
4857

4958
If your cards are in a PXI chassis or linked by an RTSI cable then just do:
5059

60+
```
5161
>> B.hAOTask.cfgSampClkTiming(B.sampleRate,'DAQmx_Val_ContSamps', size(B.waveform,1), ['/',R.DAQdevice,'/ao/SampleClock'])
5262
>> B.startAcquisition;R.startAcquisition;
63+
```
5364

5465
Then trigger.
5566
Easy: no more phase delay!

0 commit comments

Comments
 (0)