Jump to content

G_M

Members
  • Posts

    5
  • Joined

  • Last visited

Posts posted by G_M

  1. Hi everyone, 

    i'm Galvani from the department of mechanic at the technical university of Berlin, interested in vibration theory and machines dynamics. Getting started with  MCC Products, i hope this forum will help me to improve.

    Best!

  2. Hello,

    i'm trying to generate and acquire signals for a study using a DT9857E box, so i wrote a short code(using matlab and the DAQ Toolbox) to test wether the result could be satisfying or not. The code is written this way:

    clear all, clc, close all
    s = daq("dt");
    fAbtast = 50e3;
    s.Rate = fAbtast; %1000;
    BoxName = 'DT9857E-16(00)';
    addoutput(s,BoxName, '0', 'Voltage');
    addinput(s,BoxName,'0', 'Voltage');

    fIn = 1e3;
    t = 0:1/fAbtast:1-1/fAbtast;
    x = sin(2*pi*fIn*t);

    Output_data = x'*1.2;
    Input_data = readwrite(s, Output_data);
    figure
    time_vec = seconds(Input_data.Time);
    plot(time_vec, Output_data)
    hold on
    plot(time_vec, Input_data.Variables)
    hold off
    grid on
    legend(["Output Signal","Acquired Signal"])

    The result looks this way.

    DT9857E_Output.thumb.jpg.b687ac134098b514b85f0e686e714948.jpg

    Any Idea on why the acquired signal does look that way? Since i just connected an output channel to an input channel, the same output signal or at least likely was expected to be acquired.

    I even try to reproduce the example in the following matlab documentation: Simultaneously Acquire Data and Generate Signals - MATLAB & Simulink - MathWorks Deutschland

    but the result did not look great :

    %% Example from Matlab's documentation
    % A session has been already defined
    output = cos(linspace(0,2*pi,1000)');

    data1 = readwrite(s, output);

    figure
    plot(output);
    hold on
    plot(data1.Variables);
    ylabel("Voltage (V)") 
    %title("Acquired Signal");
    legend(["Output Data","Acquired Signal"])

    Out_Int.thumb.jpg.c36ace3eee8a6f5800a3bba41c69f5ff.jpg

    below is an enlarged view of the acquired signal

    Out_Int1.thumb.jpg.1094a7a36cc3ef7ddb27e870bc27f10c.jpg

    Any suggestion to fix this will be greatly appreciated.

    Thanks for your reply :)

    I also attached a matlab file with the code if one may want to reproduce these results.

    testOutput.m

×
×
  • Create New...