Assigning different sample rates in single session (session-based interface)

2 views (last 30 days)
Hi,
I am writing code to output and input some signals using the session based interface in Matlab. My configuration is as follows:
Data acquisition session using National Instruments hardware:
No data queued. Will run at 1000 scans/second.
Number of channels: 4
index Type Device Channel MeasurementType Range Name
----- ---- ------ ------- ------------------- ------------------ ----
1 ao Dev2 ao0 Voltage (SingleEnd) -10 to +10 Volts
2 ai Dev1 ai0 Voltage (SingleEnd) -1.0 to +1.0 Volts
3 ai Dev2 ai1 Voltage (Diff) -5.0 to +5.0 Volts
4 ai Dev2 ai2 Voltage (Diff) -10 to +10 Volts
Dev1 has a max sampling rate of 2 MS/s while Dev2 is at 250 kS/s. I would like to be able to run no.1 at 100 kS/S, no. 2 at 2 MS/s, no. 3 at 100 kS/s and no.4 at 100 kS/s.
When I create a session object and add all the above channels to it, I can only set a global rate that applies to all devices and channels in that session. I would like to assign sampling rates separately.
My thoughts on that are the following: Is it possible to create different session objects (so that I can assign individual sampling rates) and then execute startForeground() for each one of them? Note that I want the channels to be synchronized with each other. My existing trigger is as follows:
AO_AI1.addTriggerConnection('Dev1/PXI_Trig0','Dev2/PXI_Trig0','StartTrigger');
Thank you so much for your time. I will be looking forward to your replies!
Kind regards, Orpheus

Answers (1)

Walter Roberson
Walter Roberson on 31 May 2012

Categories

Find more on Simultaneous and Synchronized Operations in Help Center and File Exchange

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!