Matlab command to set PFI as Sampleclock on a USB DAQ?

Hi,
How do I declare PFI12 for example as sampleclockterminal when PFI0 is declared as sampleclock.source? What is the Matlab syntax for that?I know Labview or NiMax has that option.
Details:
I have a USB 6218 and USB 6366.
Trigger
I am externally triggering using PFI0 terminals in both i.e., signal from a function generator is input to PFI0 of 6218 and PFI0 of 6366
Output
I am deriving 4 analog outputs, two from each for every clock trigger pulse.
These are waveforms going from -10 to +10 V
Question:
However, I also want to output this clock only when DAQ starts its operations to activate another external instrument i.e., it should be a triggered output. Unfortunately, I am not sure how to do that?
Adding triggered digital output port0/line2 does not work because on these devices clocked digital output isn't possible. addoutput(daqObj_1,'Dev2','ao0','Voltage'); %y-direction mirror control addoutput(daqObj_1,'Dev2','ao1','Voltage'); %x-direction mirror control
addoutput(daqObj_1,'Dev2','Port1/Line0','Digital'); %cannot do this for clocked operations
addoutput(daqObj_2,'Dev1','ao0','Voltage'); %y-direction mirror control addoutput(daqObj_2,'Dev1','ao1','Voltage'); %x-direction mirror control
clk1 = addclock(daqObj_1,"ScanClock","External","Dev1/PFI0");
clk2 = addclock(daqObj_2,"ScanClock","External","Dev2/PFI1");
%This statement also does not work clk3 = addclock(daqObj_2,"ScanClock","Dev2/PFI12","External");
Is there a way that I can send the PFI0 input to PFIx output where x is any of amongst 2 to 15?
I tried outputting the PFI10 to 'external' but got an error saying only one clock is allowed. Or is there any other way besides using a third DAQ? Thanks

1 件のコメント

gujax
gujax 2023 年 2 月 28 日
I found a solution:
The trick was to use a triggered counter output on both DAQ's.
The counter's duty factor can be independently set irrespective of the input trigger rate which is really good.

サインインしてコメントする。

 採用された回答

gujax
gujax 2023 年 2 月 28 日

0 投票

use a triggered counter output on both DAQ's.

その他の回答 (0 件)

カテゴリ

ヘルプ センター および File ExchangeProgramming についてさらに検索

製品

リリース

R2022b

質問済み:

2023 年 2 月 7 日

回答済み:

2023 年 2 月 28 日

Community Treasure Hunt

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

Start Hunting!

Translated by