addclock generates Error "Timeout expired before operation could be completed."

3 views (last 30 days)
Perry Robertson
Perry Robertson on 3 Aug 2020
Answered: Aman Vyas on 12 Aug 2020
I am writing data to an NI PXIe-6536 (supported by data acquisition toolbox). Having trouble connecting the clock and get various errors upon write(). I have tried three different ways to addclock(), the most promising gave the error "Timeout expired before operation could complete." I have tried to connect to two different clock sources. Is there anyway to understand what is going on inside the hardware. I can't find an example where anyone has used this card.
clc
clear all
close all
daq = daq('ni');
% set the scan rate for the card, 1 MHz
daq.Rate = 1000000;
ch0 = addoutput(daq,"PXI1Slot13","port0/line0","Digital"); % Digital I/O
% Attempting to add the clock, get different errors for these attempts
%ck1 = addclock(daq,"ScanClock","PXI1Slot13/PXI_Star","External"); % Cannot start because the clock for digital output channel 'port0/line0' from 'PXI1Slot13' is not configured.
% Add a clock imported from an external source.
ck1 = addclock(daq,"ScanClock","External","PXI1Slot13/PXI_Star"); % Timeout expired before operation could complete.
% Add a clock imported from an external source.
%ck1 = addclock(daq,"ScanClock","External","PXI1Slot13/200MhzTimebase"); % Hardware does not support the specified connection.
scanData = zeros(64,1);
write(daq,scanData);

Answers (1)

Aman Vyas
Aman Vyas on 12 Aug 2020
Hi,
You can check if you have added wrong clock connection with wrong port. You can try running command terminals and use other terminal to clock connection and see if error still persists.
After this code part :
ck1 = addclock(daq,"ScanClock","External","PXI1Slot13/PXI_Star");
Try running this:
data = startForeground(s);
You can also take a look at this question

Community Treasure Hunt

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

Start Hunting!

Translated by