フィルターのクリア

How can I use the internal clock of a NI-DAQ (USB 6211) data acquisition board?

10 ビュー (過去 30 日間)
Adriana
Adriana 2022 年 6 月 17 日
回答済み: Manikanta Aditya 2024 年 1 月 11 日
Hello,
I am trying to connect a Single Photon Counting Module that gives a TTL signal to a NI-DAQ model USB 6211 and I would like to use the internal base clock with MATLAB. In the manual of the NI-DAQ says it has of 80 MHz, 20 MHz, 0.1 MHz, so I am sure for this model it has an internal clock. My question is if there is a code to use this internal clock.
Thank you,
Kind regards.
  1 件のコメント
Julien GATEAU
Julien GATEAU 2023 年 3 月 2 日
Dear Adriana,
We have the same question here, did you get any answer?
Thanks,
Julien

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

回答 (1 件)

Manikanta Aditya
Manikanta Aditya 2024 年 1 月 11 日
Hi Adriana,
I think you are trying to connect a Single Photon Counting Module that gives a TTL signal to a NI-DAQ model USB 6211 and you would like to use the internal base clock with MATLAB. You are not sure whether NI-DAQ has a internal clock and wants to know if there is a code to check the same.
Here is a possible workaround example of how you can do it:
% Create a data acquisition session
s = daq.createSession('ni');
% Add a Counter Input Channel
% You need to replace 'Dev1' with the actual ID of your device
% 'ctr0' is typically the ID for the first counter channel
% 'EdgeCount' is to count the rising or falling edges of a TTL signal
ch = addCounterInputChannel(s, 'Dev1', 'ctr0', 'EdgeCount');
% Set the input terminal for the clock
% This will use the device's internal clock
s.Channels(1).Terminal = 'PFI0'; % or another PFI terminal if required
% Configure the clock
s.Rate = 1000000; % Set the clock rate to 1 MHz (adjust as needed up to 20 MHz for USB 6211)
s.DurationInSeconds = 1; % Set how long the counter will run
% Start the session
[data, time] = s.startForeground();
% Calculate the frequency
frequency = data(end) / time(end);
Here, in the example you can check the ‘Rate’ property sets the frequency of the internal clock. You can adjust this to one of the frequencies supported by your device. The ‘startForeground’ function then starts the acquisition, which will run for the duration specified by ‘DurationInSeconds’
Please refer to the following references to know more about:
Hope it helps.

カテゴリ

Help Center および File ExchangeClocks and Timers についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by