Derivate a waveform from a Function generator

I want to use the derivate of a waveform from a Function generator in a Formula node,  but unfortunatelly I dont no how can i do this. I need the exact value of the derivate ("qpg" input variable) to use in the equation in the Formula Node.
I found a Derivate sub VI, but it gives me the derivate as a vector so i cant wire it as an input to the Formula node.
I attached pictures about my VI.

As I understand it, you are using a Waveform Generator VI, and want (in addition to the Waveform) an additional output that is (an estimate of) the derivative of the Waveform.
If you consider the Waveform Generator as a "black box", something whose internals you don't know, but something that produces a new output every delta-t time increment (I'm going to call this "dt"), then you really do need to estimate the derivative.  Note that since you cannot "predict the future", to estimate the derivative, you need the current data and previous data.  One very common estimate for the derivative x'(t) at time t is (x(t) - x(t-dt))/dt, that is, the difference between the current point and the previous point, divided by the time increment.  For a waveform generator, this will probably be a pretty good estimate, as the data should be relatively "smooth" and noise-free.  Do note, however, that this estimate is really over the time interval t-dt and t, so you could consider it shifted backward in time by dt/2.
If you want a more accurate estimate of the derivative, one "centered" on the current time, t, then your formula needs to take into account not only the current value and past values but also future values.  This is the reason many "derivative functions" use vectors, as this contains past and present values (with some worry about what to do at the beginning and end of the data).
On the other hand, if you are generating the data yourself (that is, if you have a VI that you input t and it outputs f(t)) and you have a "nice" function f (say a sinusoid or other non-random function), you can get the "exact" derivative just by programming it.  For example, if f(t) = sin (omega * t), then f'(t) = omega * cos (omega * t).
Bob Schor

Similar Messages

  • Acquire waveforms from function generator to oscilloscope

    I have a problem. We constructed a virtual function generator and a virtual oscilloscope. It's working well, the oscilloscope is displaying the (almost) correct data. My problem is that the waveform displayed in the oscilloscope vi is always sine, although the selected waveform in the function generator is already different.
    I should replace the constant 'zero' with something so that the cases will change in order for my oscilloscope to display different waveforms. Is there a way to acquire the values of the constant enum, for instance, from another vi to this vi?

    Yes, you would need to replace the constant with a control. Once you do this, in the main VI you simply do a right click on the subVI's terminal and select Create Control/Constant that but you cannot change it as the subVI runs.

  • Sending waveform to function generator?

    Hello all,
    I am using an agilent 33205A function generator and require it to use a
    special driving waveform.  Currently I load the waveform using
    this HP Benchlink software.  I would like to automate this in the
    startup of my vi.  Is there a way to download a "home-grown"
    waveform to the function generator using labview? 
    Thanks,
    Azazal
    Azazel
    Pentium 4, 3.6GHz, 2 GB Ram, Labview 8.5, Windows XP, PXI-5122, PCI-6259, PCI-6115

    If you're using the driver from here, then use the function called ag33xxx - Arbitrary Wfm Ops. You will have to create the waveform in the form of a 1D array. Look at the high level example called ag33xxx - Arb - Application. I don't see a function in the driver that allows you to output a defined waveform so you may want to look in the instrument manual to see if there is such a function. If there is, then it should be a simple matter to read it and then place the values into LabVIEW as a constant or something you read from file.

  • What is the internal impedance of the NI ELVIS Function Generator?

    Does anyone know the load impedance of the function generator? I'm wondering how much it may be tainting the results of Tau for my RC circuit. Thanks.

    Impact -
    With the NI ELVIS Function Generator, the output impedence is spec'ed
    at 50 Ω guaranteed.  You can find the block diagram from the
    Function Generator on page A-6 and C-6 (Appendix C:  Theory of
    Operation) of the NI ELVIS User Manual. 
    NI Educational Laboratory Virtual Instrumentation Suite (NI ELVIS) User Manual - http://digital.ni.com/manuals.nsf/websearch/11E6BA4103D9ADD086257103005C97E0
    Good luck with your application!
    Mark Walters
    Application Engineer

  • Velleman PC Function Generator K8016

    Hi
    Does anyone know if there are example programs for the Velleman PC function
    Generator?
    Cheers
    Wayne

    Hello Wayne,
    Unfortunately, there are no examples specific to the Velleman PC Function Generator K8016. What exactly are you trying to do? If you are trying to acquire a signal from the function generator through your DAQ board into LabVIEW, try the �Cont Acq&Graph (buffered).vi� example.
    If none of these suggestions help, or if I�m not correctly understanding your issue, please post the software and versions you are using, the applicable portions of your code, and any other information that may help, and I�ll be happy to look further into it.
    Have a nice day!
    Robert M
    Applications Engineer
    National Instruments
    Robert Mortensen
    Software Engineer
    National Instruments

  • VB/C# Function Generator Example

    Hello,
    I have a NI-5401 Function Generator and a NI-5112 Digitizer for hardware. I would like to use C# to output a signal from the Function Generator to the Digitizer and see the results on the CWGraph control. Is there any sample (in Visual Basic if C# not available) that demonstrates the appropriate ActiveX controls and some basic functionality similar to this?
    Thanks in Advance!
    Derek

    Hi,
    You may want to take a look at the following:
    C:\VXIpnp\WinNT\nifgen\Examples\VisualBasic
    Sincerely,
    Sastry V
    Applications Engineer
    National Instruments

  • Labview NI ELVIS function generator error

    Whenever I run my vi one time and run it again for a frequency sweep it sometimes shows an error
    Possible reason(s):
    Resource requested by this task has already been reserved by a different task.
    Task Name: _unnamedTask<1314>
    What does this means?
    here is an image of my block Diagram
    Attachments:
    Bode_Plot.png ‏46 KB

    Impact -
    With the NI ELVIS Function Generator, the output impedence is spec'ed
    at 50 Ω guaranteed.  You can find the block diagram from the
    Function Generator on page A-6 and C-6 (Appendix C:  Theory of
    Operation) of the NI ELVIS User Manual. 
    NI Educational Laboratory Virtual Instrumentation Suite (NI ELVIS) User Manual - http://digital.ni.com/manuals.nsf/websearch/11E6BA4103D9ADD086257103005C97E0
    Good luck with your application!
    Mark Walters
    Application Engineer

  • I want to use the Function Generator VI to send command signals through the NI 7344 motion controller. This will be a closed loop servo valve system. I want to be able to change from say a square wave to a sine wave on the fly. Idea's?

    I am going to run tests that require an actuator to move using various types of arbitrary waveforms such as sine or square. The NI 7344 is hooked to the UMI that is going through a driver for a servo valve. The loop is analog and it is closed. I have played with some of the examples but can't get it to work. I have used the function generator VI to generate a signal but I think I am using the wrong input VI to the motion control board. When I use what I have it moves the servo and then stops. It doesn't continually generate the signal.
    I would love to use the controls on the function generator vi to control frequency and amplitude ect. Any help or pointer would be helpful. Thank you in advance.

    Hello,
    I'm not clear on exactly how you want to use the generated data but I'm assuming they will be used as your target points.
    There's a built-in example for motion called 'One-Axis Contour Move.vi'. This example demonstrates how to provide your target points as 1-D array. All you need to do is to replace the input array with the output of the function generator. In order to have it run continuously, use a while loop. You can further program your application so that it'll change the waveform on the fly by monitoring the user interface but this might be little little tricky as you will need to reset the move and load the new generated points while keeping track of your current position.
    I hope this helps. Let me know if you have further questions regarding this
    application.
    Best regards,
    Yusuf C.
    Applications Engineering
    National Instruments

  • How to read data from a GPIB when sending a function generator command

    I'm using Visual C++ with the ComponentWork ActiveX and I'm tring to plot a
    CWGraph using the data coming from a GPIB device. When I write command such
    as "*IDN?" to the GPIB device, everythings if fine and I can read what the
    GPIB device return me. But when I send a command like "SOUR:FUNC SIN;SENS
    DATA?", the writing seems to be okay, but when I try to read the data, I
    alway get a "Timeout expired before operation completed" error message. I
    have tried with the CWGPIB and with the CWVISA but the result are the same
    with both.
    My reading code looks like this:
    COleVariant vReadBuffer;
    vReadBuffer = m_VISA.Read( COleVariant( (short) 2000 ) );
    and it work fi
    ne for "*IDN?" or for multimeters command.
    I want to know how I must read the data for function generator commands.
    Thank alot

    It sounds like your device is not accepting that command string as valid. The string you listed above is probably missing a colon between SENS and DATA. "SOUR:FUNC SIN;SENSATA" Try sending this string in Measurement & Automation Explorer to the instrument first to make sure it is working.
    Best Regards,
    Chris Matthews
    Measurement Studio Support Manager

  • Have problem when generate Web Service from bapi function

    Dear all,
    Please kindly help me about generating Web Service from BAPI function, It does not success only this attached function.
    I have done so many function without any problems.
    I found 1 case that I use specific variable to be an import/ export then, it can't create as well.
    As for this one, I try so many changes but I can't success it as well.
    This is my function on R/3 4.6C, Dot net connector 2.0, Dot net Frame Work 1.1.
    FUNCTION Z_BAPI_ATTACHMENT_CREATE.
    ""Local interface: Type: Remote-enabled module
    *"  IMPORTING
    *"     VALUE(P_BOTYPE) LIKE  BORIDENT-OBJTYPE
    *"     VALUE(P_BO_ID) LIKE  BORIDENT-OBJKEY
    *"     VALUE(P_MSGTYP) LIKE  SOFM-DOCTP
    *"     VALUE(P_DOCTY) LIKE  BORIDENT-OBJTYPE
    *"     VALUE(P_RELTYP) LIKE  BRELTYP-RELTYPE
    *"     VALUE(P_FNAME) LIKE  RLGRAP-FILENAME
    *"     VALUE(P_OBJDES) TYPE  SO_OBJ_DES
    *"  EXPORTING
    *"     VALUE(RETURNMESSAGE) TYPE  CHAR50
    INCLUDE : <cntn01>.
    P_BOTYPE  TYPE  BORIDENT-OBJTYPE DEFAULT 'BUS2105'
    P_BO_ID   TYPE  BORIDENT-OBJKEY
    P_MSGTYPE TYPE  SOFM-DOCTP DEFAULT 'URL'
    P_DOCTY   TYPE  BORIDENT-OBJTYPE DEFAULT 'MESSAGE'
    P_RELTYP  TYPE  BRELTYP-RELTYPE DEFAULT 'ATTA'
    P_FNAME   TYPE  RLGRAP-FILENAME
    P_OBJDES  TYPE  SO_OBJ_DES
    TYPES: BEGIN OF ty_message_key,
    foltp TYPE so_fol_tp,
    folyr TYPE so_fol_yr,
    folno TYPE so_fol_no,
    doctp TYPE so_doc_tp,
    docyr TYPE so_doc_yr,
    docno TYPE so_doc_no,
    fortp TYPE so_for_tp,
    foryr TYPE so_for_yr,
    forno TYPE so_for_no,
    END OF ty_message_key.
    DATA : lv_message_key TYPE ty_message_key.
    DATA : lo_message TYPE swc_object.
    DATA : lt_doc_content TYPE STANDARD TABLE OF soli-line
    WITH HEADER LINE.
    First derive the Attachment's ( MESSAGE )document type.
    p_docty = 'MESSAGE'.
    CASE p_reltyp.
    In case of URls
      WHEN 'URL'.
        p_msgtyp = 'URL'.
    In case of Notes / Private Notes
      WHEN 'NOTE' OR 'PNOT'.
        p_msgtyp = 'RAW'.
      WHEN 'ATTA'.
    Take given parameter e.g. 'DOC', 'PDF' etc.
    P_MSGTYP = 'EXT'.
      WHEN OTHERS.
    ....exit
        EXIT.
    ENDCASE.
    Create an initial instance of BO 'MESSAGE' - to call the
    instance-independent method 'Create'.
    swc_create_object lo_message 'MESSAGE' lv_message_key.
    define container to pass the parameter values to the method call
    in next step.
    swc_container lt_message_container.
    Populate container with parameters for method
    swc_set_element lt_message_container 'DOCUMENTTITLE' p_objdes.
    swc_set_element lt_message_container 'DOCUMENTLANGU' 'E'.
    swc_set_element lt_message_container 'NO_DIALOG' 'X'.
    swc_set_element lt_message_container 'DOCUMENTNAME' p_docty.
    swc_set_element lt_message_container 'DOCUMENTTYPE' p_msgtyp.
    In case of URLs..it should be concatenated with &KEY& in the begining.
    CASE p_msgtyp.
      WHEN 'URL'.
      lt_doc_content = '&KEY&http://www.rmtiwari.com' .
        CONCATENATE '&KEY&' p_fname INTO lt_doc_content.
        APPEND lt_doc_content.
    In case of Notes or Private Notes, get the data from files on appl
    server or from wherever(? - remember background).
      WHEN 'RAW'.
        lt_doc_content = p_fname.
        APPEND lt_doc_content.
    In case of PC File attachments
      WHEN OTHERS.
        OPEN DATASET p_fname FOR INPUT IN BINARY MODE.
        IF sy-subrc EQ 0.
          DO.
            READ DATASET p_fname INTO lt_doc_content.           "2 of 27
            IF sy-subrc EQ 0.
              APPEND lt_doc_content.
            ELSE.
              EXIT.
            ENDIF.
          ENDDO.
          CLOSE DATASET p_fname.
        ENDIF.
    ENDCASE.
    'DocumentContent' is a multi-line element ( itab ).
    swc_set_table lt_message_container 'DocumentContent' lt_doc_content.
    Size is required in case of File attachments
    DATA : lv_doc_size TYPE i.
    DATA : l_file_lines TYPE i.
    DESCRIBE TABLE lt_doc_content LINES l_file_lines.
    READ TABLE lt_doc_content INDEX l_file_lines.
    lv_doc_size = ( 255 * ( l_file_lines - 1 ) ) +
    STRLEN( lt_doc_content ).
    swc_set_element lt_message_container 'DOCUMENTSIZE' lv_doc_size .
    Refresh to get the reference of create 'MESSAGE' object for attachment
    swc_refresh_object lo_message.
    swc_call_method lo_message 'CREATE' lt_message_container.
    Get Key of new object
    swc_get_object_key lo_message lv_message_key.
    Now we have attachment as a business object instance. We can now
    attach it to our main business object instance.
    Create main BO object_a
    data: LO_IS_OBJECT_A type SIBFLPORB. "type SIBFLPORB is unknown, so I
    DATA: lo_is_object_a TYPE borident.
    lo_is_object_a-objkey = p_bo_id.
    lo_is_object_a-objtype = p_botype.
    LO_IS_OBJECT_A-CATID = 'BO'.
    Create attachment BO object_b
    data: LO_IS_OBJECT_B type SIBFLPORB. "type SIBFLPORB is unknown
    DATA: lo_is_object_b TYPE borident.
    lo_is_object_b-objkey = lv_message_key.
    lo_is_object_b-objtype = p_docty.
    LO_IS_OBJECT_B-CATID = 'BO'.
    *TRY.
    *CALL METHOD CL_BINARY_RELATION=&gtCREATE_LINK
    EXPORTING
    IS_OBJECT_A = LO_IS_OBJECT_A
    IS_OBJECT_B = LO_IS_OBJECT_B
    IP_RELTYPE = P_RELTYP.
    CALL FUNCTION 'BINARY_RELATION_CREATE'
      EXPORTING
        obj_rolea    = lo_is_object_a
        obj_roleb    = lo_is_object_b
        relationtype = p_reltyp
      EXCEPTIONS
        OTHERS       = 1.
    Check if everything OK...who cares!!
    COMMIT WORK.
    if sy-subrc = 0.
      RETURNMESSAGE = 'S-Success'.
    else.
      RETURNMESSAGE = 'E-Error'.
    endif.
    ENDFUNCTION.
    Thanks in advance,
    Benjawan
    Edited by: Nitipat Chadchavalpanichaya on Oct 20, 2008 9:02 AM

    There is no any error message show up. It just the class
    Z_BAPI_ATTACHMENT_CREATE  doesn't create autometically as normal. I showed you as below.
    That means I can't call class z_bapi_attachment_create.
    ' <autogenerated>
    '     This code was generated by a SAP. NET Connector Proxy Generator Version 2.0
    '     Created at 21/10/2551
    '     Created from Windows
    '     Changes to this file may cause incorrect behavior and will be lost if
    '     the code is regenerated.
    ' </autogenerated>
    Imports System
    Imports System.Text
    Imports System.Collections
    Imports System.ComponentModel
    Imports System.Runtime.InteropServices
    Imports System.Xml.Serialization
    Imports System.Web.Services
    Imports System.Web.Services.Description
    Imports System.Web.Services.Protocols
    Imports SAP.Connector
      '@ <summary>
      '@ Client SAP proxy class
      '@ </summary>
      <WebServiceBinding(Name:="dummy.Binding", Namespace:="urn:sap-com:document:sap:rfc:functions")> _
      Public Class PRAttachment
        Inherits SAPClient
        '@ <summary>
        '@ Initializes a new PRAttachment.
        '@ </summary>
        Public Sub New()
        End Sub
        '@ <summary>
        '@ Initializes a new PRAttachment with a new connection based on the specified connection string.
        '@ </summary>
        '@ <param name="connectionString">A connection string (e.g. RFC or URL) specifying the system where the proxy should connect to.</param>
        Public Sub New(ByVal ConnectionString As String)
          MyBase.New(ConnectionString)
        End Sub
        '@ <summary>
        '@ Initializes a new PRAttachment and adds it to the given container.
        '@ This allows automated connection mananged by VS component designer:
        '@ If container is disposed, it will also dispose this SAPClient instance,
        '@ which will dispose a contained connection if needed.
        '@ </summary>
        '@ <param name="Cont">The container where the new SAPClient instance is to be added.</param>
        Public Sub New(ByVal Cont As Container)
          MyBase.New(Cont)
        End Sub
      End Class

  • How to plot data from a GPIB function generator

    I am doing a litle application with Visual C++ and the ComponentWorks++ to
    control a GPIB device. I am tring to Plot a CNiGraph with data coming from
    the GPIB function generator. I use the code below to write/read the device
    and to Plot the graph. It give me some results but for exemple, if I
    request a sin wave it give me something that doesn't look like a sin and if
    I request a square wave it give me about the same wave... So I want to know
    if the problem is in my code or maybe it's because my device is just a
    emulator not a real func generator. But I guest I am doing some kind of
    convertion error.
    CNiInt16Vector vBuffer(100); // Should I try CNiReal64Vector or something
    else ?
    m_Visa->Write(m_strC
    ommande); // Write to the device, this works well
    m_Visa->Read(vBuffer); // Is it the right way to do reading ?
    m_Graph.PlotY(vBuffer); // This Plot some data, but it doesn't seem right
    Could somebody bring the light on this?
    Thanks alot!
    P.S. Sorry for the bad english...

    Ares:
    I have two suggestions about common problems in VISA.
    (1) How is m_Visa defined? There is occasionally some confusion about which VISA class should be used for this purpose. CNiVisaSession is the class designed for this purpose.
    (2) How is the instrument returning data? Usually instruments return some sort of header before the actual data.
    You may want to contact National Instruments Technical Support to continue this discussion. You can reach our telephone support at 1-800-IEEE-488 or email support at http://www.ni.com/ask.
    Good Luck,
    Chris Wood
    Applications Engineer
    National Instruments

  • Generate waveform from datafile

    Hi all,
    I have a datafile with the time and amplitude values of a human gait cycle. I want to generate a waveform from that file. Is there any method that read the data from the file and generate a waveform from that?
    Pleae reply urgently
    Jinal..

    This is the file. If possibl could you please provide me coding also?  I am a novice at Labview.
    Thanks
    Jinal.
    Attachments:
    Gait Cycle.xls ‏27 KB

  • Sending .arb files to function generator

    Hi
     i am  very  fresh to labview  programming.
     I have  created some  waveforms  using  HP BenchLink software(and saved in .arb file  format).  Can i send  these  wave forms  to  a  function generater  through Labview  program . if  possible   how  can i do that
    Thanks
    jith

    Hi
     Yes  i have  downloaded the driver ag3xxx and  installed .  and   also got  some  advise from [email protected]
      Their  comments  follows .
                    Yes you can read the values from the .arb file into LabVIEW and store
    the values in 1D array or text file and then send it to the function
    generator you are using.
         Basically you would have to use APIs such as read from binary
    file(there are examples present in LABVIEW example finder which shows an
    example of how you could read a binary file.) After reading from the file
    you could store its values in an array or a text file and the read from
    this array and send the data to the function generator you are using. If
    you are using a function generator which is not made by National
    instruments you have to install the device drivers for that instrument fro
    LABVIEW, you could install them from www.ni.com/idnet.
                 i have  used  some  eg:  programmes   given in LV to read binary files .
                 The  function name is  "read binary files vi " .  the  out  put  of "read binary files vi "
                 is  data .  I am trying  to store this  data  in an array  , but   got  stucked  ,  in finding
                 a sutable  function to send  this  array valuse  to  the  function generator. Can  i send
                  the  array out  put  directly to a  FG  ?
     Thanks
     jith

  • Get waveform from TDS2012

    Hello,
          the attachment is an example whose function is to acquire the waveform from an oscilloscope  from a reference book. Now I'm wondering whether the waveform displayed in the waveform graph is just the waveform the oscilloscope acquires. My oscilloscope is TDS2012. I connect the oscilloscoe probe to the channel 1 input connctor.Attach the probe tip and ground lead to the PROBE COMP connectors.The  PROBE COMP signal is a square wave with a frequency of 1KHz and a peak voltage of 5V. If I choose channel 1 as the trig source, and let the programme run for 1000 times,it will take more than 1minute to complete this task. I just want to know whether the  waveforms  refreshed in the waveform graph are generated by the source during the  1 second since the programme starts.
    Attachments:
    get waveform from an oscilloscope with VISA function.vi ‏17 KB

    Hi yaoyao,
    Your question all depends on the behavior of the CURVE? command.  If it generates a new acquisition each time it is called, then you should be seeing 1000 different waveforms.  If CURVE? simply transfers the existing waveform without initiating a new one, you will be transferring the same waveform 1000 times.  The programming manual should have more details about the behavior.  You may need to call
    You should look at the LabVIEW instrument driver that we have for this instrument:
    http://sine.ni.com/apps/utf8/niid_web_display.download_page?p_id_guid=047216EC20B66FABE0440003BA7CCD...
    The instrument driver should simplify programming and you can look at the block diagrams to see which instrument commands are being sent.

  • USRP as a function generator

    Is it possible to use USRP as a function generator ? If yes can any one please provide me the sample VI. I want to generate Sine wave, Square wave, Triangular wave etc. Also I need the option to vary Frequency and Voltage. Is it possible to implement Function Generator mechanism on USRP using LabView? Please guide.  

    Hello josephkirmani,
    When you say you want to use the USRP as a function generator, do you mean you want to be able to output and send a function over a certain RF carrier frequency? If so, I think you might find the example below helpful, it uses frequency modulation (must have the modulation toolkit installed) in order to embed a signal of your choosing (square, sine, triangle…) into a FM modulated waveform to be transmitted over a specified carrier frequency. Just switch out the Basic Multi Tone.vi for your preferred function from the Waveform Generation Palette. If that’s not what you are trying to do, please clarify. 
    Example: https://decibel.ni.com/content/docs/DOC-24206
    Matthew R.
    Applications Engineer
    National Instruments

Maybe you are looking for

  • Unable to switch themes

    I downloaded the HTML DB Survey App and have been making modifications with it, kind of a more hands on approach to a better understanding of APEX. I am not able to switch the theme - in fact I can't switch it to ANY theme! I thought perhaps it was u

  • Has anyone solved battery problem on the S5IS

    So far  duracell coppertop NMH 1600mah promaster and nothing seems to last operating camera with external flash and no LCD monitor on to get any life,does anyone make a battery pack or grip for more capacity.

  • Is there an alternative to flash for animation?

    I have a flash sequence on a clients website but it is not friendly with the menu as it overlaps. It is also unfriendly on ipods, ipads and the like. We need to retain the animation sequence and wonder if it could be converted into another format whi

  • Availability in 11i

    Might seem like a simple question...but I am just a manufacturing kind of guy. Upon entering a line in OM...I hit the availability button and a window pops up and there are 3 fields that confuse me. What exactly are the differences between AVAILABLE>

  • Auto install another app with the installation of AIR app

    Hi I am new to desktop application development. I am stuck on an issue. My air application uses another application installed on user machine to capture the screen shots. I want to bundle this third party application (screen capture software) install