Jump to content
  • 0

USB 1608 DAQMI/MATLAB troubleshooting


isherer

Question

We're seeing a different value in Matlab than we are in DAQami.

My versions:
Windows 10 

Instacal 6.60

Matlab 2024a

Data Acquisition Toolbox Support Package for Measurement Computing Hardware 24.1

We expect about 6 V and 0.5-0.9 Volts
DAQami is reading thosevalues correctly, but MATLAB when using slightly modified script of the example script at https://www.mathworks.com/help/daq/getting-started-with-session-based-interface-using-mcc-devices.html
we get these followings results where it starts at the correct values but then increases immediately to 10 V for both input channels. See attached graph.

%% Discover Available Devices
% Discover devices connected to your system using |daqlist|. To learn more
% about an individual device, access the entry in the device table.

d = daqlist("mcc");
d(1, :)

%% Create a DataAcquisition
% The |daq| function creates a DataAcquisition object. The DataAcquisition
% contains information describing hardware, scan rate, and other properties
% associated with the acquisition.

dq = daq("mcc")

%% Add an Analog Input Channel
% The |addinput| function attaches an input channel to the DataAcquisition.
% You can add more than one channel to a DataAcquisition.

addinput(dq, "Board0", "Ai5", "Voltage");
addinput(dq, "Board0", "Ai6", "Voltage");
dq

%% Change Default Properties of the Acquisition
% By default, acquisitions run for one second at 1000 scans per second.  To
% acquire at a different rate, change the |Rate| property.
dq.Rate = 100;

%%
% Run the acquisition and plot the acquired data:
[data, startTime] = read(dq, seconds(3));
hold on;
plot(data.Time, data.Board0_Ai5);
plot(data.Time, data.Board0_Ai6);
hold off;
xlabel("Time (s)"); 
ylabel("Voltage (V)");


 

MATLABGRAPH10V.png

Link to comment
Share on other sites

5 answers to this question

Recommended Posts

  • 0

Hello @isherer.

Unlike DAQami, which allows a user to configure the input channels mode, the analog input channels should be configured for single-ended or differential mode in InstaCal before launching your MATLAB and wired accordingly.

What's the analog input channel mode in InstaCal and how are your sensors wired to the USB-1608G Series device?

Disconnect the other analog input channels or connect them to a ground screw terminal and then retest.

 

Regards,

Fausto

Link to comment
Share on other sites

  • 0

Hello @Fausto

 

The analog input mode is Single Ended, I configure this in instacal.

See attached pictures for wiring. I am using omega drc-4710 load cell signal conditioners attached to omega LCCA-50 load cells.

 

DAQ_Wiring.jpg

DRC_4710.jpg

Link to comment
Share on other sites

  • 0

Hello @isherer

Disconnect both load cells from the USB-1608G Series device. Wire the +5V terminal on the USB-1608G Series device to the CH5H and CH6H terminals. Run your MATLAB script. 
 

If the issue continues, wire the +5V terminal to CH0H and CH1H terminals instead and edit the channels in your script before retesting. Is the issue reproducible with these two channels?

Regards,

Fausto 

Link to comment
Share on other sites

  • 0

Hey @Fausto

 

I wired the +5V on the CH5H and CH6H to the same effect. I then wired the +5V to the CH0H and CH1H to the same effect as well. 

The attached png are the results of the CH0H and CH1H retest. 

 

DaqAmi has interesting results as well. In a single ended 1Hz reading, Channels 0 and 1 are correct with no voltage applied to CH5 and CH6. In a configuration of single ended and 1000 sample rates DaqAmi reads accurate values for CH0 and Ch1 and values close to CH0 and CH1 on channels 5 and 6. Please see attached excel sheets for recorded values.

MATLABGRAPHCH0H.png

IMG_3962.jpg

IMG_3961.jpg

SE1HzTest.xlsx SE1000HzTest.xlsx

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...