Clock issue with NI PCIe-6537

Hello,
I am trying to get started with a PCIe-6537 card. To do so, I just want to ensure that I can generate a string of data on one pin, and read that data back in from another. So far, I have been unable to do so, and the problem seems to be the clock setup. Here is the code I am using:
clc; clear all; close all;
daqDig = daq("ni")
daqDig.Rate = 100;
% create channels
in = addinput(daqDig, "Dev2", "port0/line0", "Digital");
out = addoutput(daqDig, "Dev2", "port0/line1", "Digital");
% some test data
outScanData = repmat([0 0 1 1], 1, 100)';
% create clock
ck = addclock(daqDig,'ScanClock','Dev2/200MHzTimebase','External');
% send/receive data
inScanData = readwrite(daqDig,outScanData,"OutputFormat","Matrix");
When I do so, I get the following error:
Error using NIDAQ_PCIe_6537_startup_script (line 20) <--- this references the last line, inScanData
Cannot start because the clock for digital input channel 'port0/line0' from 'Dev2' is not configured.
To configure its clock:
- Add an analog input or output channel from device 'Dev2'
or
- Add an external clock.
I have resolved the problem before on a different NI-DAQ by creating a dummy analog channel, but this card is entirely digital. The documentation I have found online uses an output channel with type 'PulseGeneration', but this card only supports digital on all channels. I have tried removing the addclock line altogether, and get the same error message.
I have also tried replacing the ck = line with the following:
ck = addclock(daqDig,'ScanClock','Dev2/200MHzTimebase','port0/line0');
Now the error is:
Error using NIDAQ_PCIe_6537_startup_script (line 15)
Invalid option 'port0' for destination device. Valid destination devices are 'Dev2'.
I changed it to this (testing all possible PFI channels):
ck = addclock(daqDig,'ScanClock','Dev2/200MHzTimebase','Dev2/PFI5');
And get the error:
Error using NIDAQ_PCIe_6537_startup_script (line 15)
Cannot specify the same device as both the source and destination for 'Dev2'.
I have also tried to set the clock source as external:
ck = addclock(daqDig,'ScanClock','External','Dev2/PFI5');
And get the error:
Error using NIDAQ_PCIe_6537_startup_script (line 17)
Hardware does not support the specified connection. Check the device user manual for valid device routes and pin-outs.
The device manual shows that PFI4 - PFI5 are sample clock sources. See page 5:
I am absolutely at my wit's end - does anyone see what I am missing here? Thank you in advance for any suggestions.

Answers (0)

Categories

Products

Release

R2021a

Asked:

on 9 Jul 2021

Edited:

on 9 Jul 2021

Community Treasure Hunt

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

Start Hunting!