06-11-2012 06:49 PM
Hi Nathan,
Please see attached screenshot (sampleclock.png). I've changed the Sample Clock VI source terminal to the 4331 Sample Clock (which is on ai4 in my setup). This gives the error:
Error -200414 occurred at DAQmx Start Task.vi:9
Possible reason(s):
Requested sample clock source is invalid.
Property: SampClk.Src
Corresponding Value: /PXI1Slot4/ai/SampleClock
Task Name: _unnamedTask<1B>
I've also tried putting the 4331 SampleClock as the source terminal for the Sample Clock on the 6361 task line (sampleclock2.png). In this case, one "block" of signal appears on the upper and lower graphs (derived from the 4331 task and the digital-in task on the 6361 device), then the system waits for the trigger, after which the signal from the analog-in task on the 6361 begins collection. This results in unsynchronised signals (unsynchronised by the delay between the initial start of the VI, and the eventual external trigger.)
I have also tried removing the master-slave synchronising block (masterslave removed. png), but this doesn't affect the outcome.
Am I implementing your idea correctly?
Thanks,
Claire.
06-12-2012 09:12 AM
Yeah, masterslave removed.png and sampleclk2.png are correct. Would you mind attaching your .vi if you can? I'm not sure where the extra block of data comes from, and I might need to try running your code to find out.
06-12-2012 06:29 PM
Hi Nathan,
VI is attached as requested. Any ideas most welcome!
Cheers,
Claire.
06-13-2012 09:26 AM
Oh wow, I should have noticed ealier - the ai/StartTrigger terminal is not wired in masterslave_removed.png. I ran your VI with that wired and got perfect sync. Without it, the two slave tasks are set to no trigger, so they just start as soon as you run the VI.
06-13-2012 09:59 PM
Hi Nathan,
Thanks for picking up my stupid mistake...embarrassing.
I've run the VI with the start trigger connected...both with and without the external trigger (see attached text files). When I don't use the trigger, there is only about 2 milliseconds spread in the first timestamp across the channels. However, when I use the trigger, there is around 150ms spread in the first timestamp across the channels.
Do you see this with your setup?
Thanks,
Claire
06-14-2012 09:19 AM
I didn't really notice, I was graphing the data on one graph with ignore timestamp on (so I could see if my boards were in sync). One thing to be aware of is that timestamps are computed in software - it does not take external triggers in to account. This is because the device handles the start trigger on it's own, and starts sending data only after the trigger occurs.
I would use the timestamps from one task for all the data, since all three tasks should be in sync.