How to simulate waveform using formula node

is it posible to get waveform using formula node.for example,i want to calculate Vo=Vs sin wt,in formula node,i use
V*sin*2*pi,how to use the answer to plot waveform

or if you REALLY want to continue it the way you had (not sure why you would)...
Use the rating system, otherwise its useless; and please don't forget to tip your waiters!
using LV 2010 SP 1, Windows 7
Attachments:
build[1].vi ‏16 KB

Similar Messages

  • How to create and use a node globally  as well as internal table

    HI,
    Kindly let me know how can I create a node & internal table globally and which I can use them in various methods in view and controller as well, if u can provide an example it could be very help full.
    my requirment is uploading a multiple files in wdp ABAP for this I just followd the link below
    http://wiki.sdn.sap.com/wiki/display/WDABAP/UploadandDownloadfilesinWebdynproABAP
    which for single upload and for making this for multiple upload I need a node could be usefull globally or a IT please check my code below
    DATA lo_nd_n_upload TYPE REF TO if_wd_context_node.
        DATA lo_el_n_upload TYPE REF TO if_wd_context_element.
        DATA ls_n_upload TYPE wd_this->element_n_upload.
        DATA lo_nd_n_file_download TYPE REF TO if_wd_context_node.
        DATA lt_n_file_download TYPE wd_this->elements_n_file_download.
        data ls_file_upload TYPE ZFILE_UPLOAD1.
       ZFILE_UPLOAD_1 = wd_componentcontroller->Elements_ZFILE_UPLOAD_1.
         t_file_upload = ig_componentcontroller->ITAB1.
       t_file_upload = wd_this->zfile_upload1.
       navigate from <CONTEXT> to <N_FILE_DOWNLOAD> via lead selection
         lo_nd_n_file_download = wd_context->get_child_node( name = wd_this->wdctx_n_file_download ).
      navigate from <CONTEXT> to <N_UPLOAD> via lead selection
        lo_nd_n_upload = wd_context->get_child_node( name = wd_this->wdctx_n_upload ).
      get element via lead selection
        lo_el_n_upload = lo_nd_n_upload->get_element( ).
      @TODO handle not set lead selection
        IF lo_el_n_upload IS not INITIAL.
      get all declared attributes
        lo_el_n_upload->get_static_attributes(
          IMPORTING
            static_attributes = ls_n_upload ).
    ls_n_upload will contain the File name file type and file contents *
       ls_n_upload-file_size = xstrlen( ls_n_upload-file_content ).
       ls_file_upload-FILE_NAME = ls_n_upload-FILE_NAME.
       ls_file_upload-FILE_TYPE = ls_n_upload-FILE_TYPE.
       ls_file_upload-FILE_SIZE = ls_n_upload-FILE_SIZE.
       ls_file_upload-FILE_CONTENTS = ls_n_upload-FILE_CONTENT.
       append ls_file_upload to t_file_upload.
       clear ls_file_upload.
    lo_nd_n_file_download->bind_table( new_items = t_file_upload set_initial_elements = abap_true ). 
    ENDIF.
    so here I would like use t_file_upload(node or IT ) to use globaly which can keep the previous data and I can add the existing data and in another method I would like to submit the data in t_file_upload to table
    Regards
    raj

    Hi Chandra,
    Resloved, I createa table type in SE11 by giving my table name as a line type and I used that as a Global IT in view "attributes" tab and I made the my code as follows its working now
        DATA lo_nd_n_upload TYPE REF TO if_wd_context_node.
        DATA lo_el_n_upload TYPE REF TO if_wd_context_element.
        DATA ls_n_upload TYPE wd_this->element_n_upload.
        DATA lo_nd_n_file_download TYPE REF TO if_wd_context_node.
        DATA lt_n_file_download TYPE wd_this->elements_n_file_download.
        data ls_file_upload TYPE ZFILE_UPLOAD1.
        data t_file_upload TYPE standard table of ZFILE_UPLOAD1.
       navigate from <CONTEXT> to <N_FILE_DOWNLOAD> via lead selection
         lo_nd_n_file_download = wd_context->get_child_node( name = wd_this->wdctx_n_file_download ).
      navigate from <CONTEXT> to <N_UPLOAD> via lead selection
        lo_nd_n_upload = wd_context->get_child_node( name = wd_this->wdctx_n_upload ).
      get element via lead selection
        lo_el_n_upload = lo_nd_n_upload->get_element( ).
      @TODO handle not set lead selection
        IF lo_el_n_upload IS not INITIAL.
      get all declared attributes
        lo_el_n_upload->get_static_attributes(
          IMPORTING
            static_attributes = ls_n_upload ).
    ls_n_upload will contain the File name file type and file contents *
       ls_n_upload-file_size = xstrlen( ls_n_upload-file_content ).
       ls_file_upload-FILE_NAME = ls_n_upload-FILE_NAME.
       ls_file_upload-FILE_TYPE = ls_n_upload-FILE_TYPE.
       ls_file_upload-FILE_SIZE = ls_n_upload-FILE_SIZE.
       ls_file_upload-FILE_CONTENTS = ls_n_upload-FILE_CONTENT.
       append ls_file_upload to ME->wd_this->gt_file_upload .
       clear ls_file_upload.
    lo_nd_n_file_download->bind_table( ME->wd_this->gt_file_upload ).
       endif.
    thanks for the support.
    Regards
    Raj

  • XY graph using formula node

    In a formula node there is one input(x) and two outputs(y1,y2).
    Plot y1,y2 on a single XY graph for different x1 values(from 100-200). please reply...
    regards,
    jathin
    Solved!
    Go to Solution.

    Hi Jathin,
    this sounds like a school assignment. This forum isn't intended to do other peoples homework.
    This assignment also is very basic stuff, which should be easily to solve after going through basics course offered by NI...
    And, as said before, we will help to develop code as soon as you attach your work here. We will not write stuff from scratch...
    Best regards,
    GerdW
    CLAD, using 2009SP1 + LV2011SP1 + LV2014SP1 on WinXP+Win7+cRIO
    Kudos are welcome

  • Formula node forbid to run VI when undefined variable is used

    On all LabVIEW version, we can use Formula node to evaluate mathematical formulas.
    We can define input and output variable freely and calculate using some variety of formula.
    But when we use undefined variable as output, can execute VIs with no errors.
    We think it is a problem because when programmer makes a typo, they cannot notice the mistake.
    When undefined variable is used as output variable, LabVIEW should forbid to run VI.

    I think you are going to get the same (or similar) answers than to my suggestion(s) to make VI outputs potentially "required" and the same for some functions (built-in VIs):
    http://forums.ni.com/t5/LabVIEW-Idea-Exchange/Allow-required-outputs-in-VIs/idc-p/3157058
    http://forums.ni.com/t5/LabVIEW-Idea-Exchange/quot-Function-terminal-not-connected-quot-detection-plus/idi-p/1858573
    In general, I agree with you, there is a potential for problems. Not really for the reason you are mentioning, because a typo will break the VI (unless you have two output variables with very similar names - unlike in your example - such as y and y0). But it could make for some frustrating debugging session.

  • Real time processing in formula node

    hello all,
    I'm using LabVIEW for data acquisition of an analog signal.My sampling frequency is KHz. Now if I've to process these data's in formula node what type of variable I need to define in formula node.?
    For example,if I want to add add all the magnitudes of the samples and store the sum after each sample squired.How do I write the formula node?
    I'm an amateur in labVIEW. amateur guide.
    Thanks in advance.

    pramodantony wrote:
    Now if I've to process these data's in formula node what type of variable I need to define in formula node.?
    Who forces you to use the formula node? You simply need to process the data, the means should be irrelevant.
    Acquired data in LabVIEW can be of many forms (arrays, waveforms, dynamic data, etc.). Can you show us what you have?
    LabVIEW Champion . Do more with less code and in less time .

  • Formula node uInt32 overflow

    I'm having a weird behaviour in formula node. The overflow of unsigned integer operations simply doesn't match the results of standard LabVIEW blocks as shown in the attached picture.
    How can I deal with this problem? I need the behaviour of the block diagram. I could not do a right logical shift in unsigned integers in block diagram, so I'm using formula node (I could not figure out how to do it because I can't negate a unsigned value).
    I'm using LV2012SP1. Were there any changes in this behaviour in newer versions?
    Thank you.

    I found a problem in hexadecimal and octal numeric representations of the formula node. The picture illustrates the issue. Three variables are assigned with the same value but outputs different results.
    The hex and octal representations only work for half range of the 32 bits unsigned integer. When the value assigned gets beyond this limit the variable receives zero. This doesn't happen with a decimal value neither with 8 bits variables. Seems the problem doesn't only happen with overflow operations.

  • Periodic PCR profile in Formula Node

    I use Formula Node to build a three-stage temperature profile in LabVIEW v7.
    if (x>=0&&x<5)
    y=94;
    if (x>=5&&x<10)
    y=56;
    if (x>=10&&x<15)
    y=72;
    How to make this signal become periodic?
    You can find my VI in the attachment.
    Attachments:
    test.vi ‏21 KB

    If you mean periodic on x, then adding before your calculations expression
    x=mod(x,15);
    can work (as this will make argument always wrap in [0,15) ).

  • Formula node with global variable

    Hi,
    I am tring to use formula node with global variables as an input and output,
    but this is where I see the SW hangs forever.
    By the way I am a novice to the labview.
    Can some give me hint why this is happening?
    Thank you in advance,
    Do
    Solved!
    Go to Solution.
    Attachments:
    formula_node_wGlobalInputOutput.JPG ‏281 KB

    Well, the first case of the two loops has a direct LabVIEW translation like this:
    However, just because that's the direct translation doesn't mean that's what you should be doing. In the formula node it seems as if you were copying elements from one array to another. Element-wise operation on arrays via loops can be quite inefficient in LabVIEW. Often one can operate in place with arrays, and an operation that would require two loops in a language like C would actually require no loops in LabVIEW. In fact, with the above example, even if you were to use loops, arrays can auto-index for-loops so you don't even need to wire the constants to the N terminals to tell the loop(s) how many times to run.
    Can you describe what you're trying to accomplish? There's likely to be a more natural way to do it in LabVIEW that would require no loops. Have you gone through the tutorials? You can also look over the material in the NI Developer Zone's Learning Center which provides links to other materials and other tutorials. You can also take the online courses for free.

  • Formula node: type conversion

    Hello guys
    I have LV 5.0 and have to edit a script which has some kind of overflows. For testing I set all variables to the hightest usable range - extended or i32. Now I see, in all formula nodes, there are type conversions. How can I change the type of the inputs/outputs of the formula node?
    Hardware_Tester
    My first language is German, please ignore my faults...

    Hi,
    I forgot that you run Lv5.0. My example refers to Lv7.1.
    As far as I know in Lv7.1 the input variable type changes automatically as you connect a control.
    On the contrary the output is DBL by default but you can change it in the formula node introducing an explicit declaration of that variable (see "h" in the attached picture).
    Here are some useful link:
    http://forums.ni.com/ni/board/message?board.id=170&message.id=12253&requireLogin=False
    http://digital.ni.com/public.nsf/3efedde4322fef19862567740067f3cc/d6bed7d73659c43586256a7300691c26?
     Sorry, I understand that this cannot solve your problem but I don't remember how Lv5.0 works with formula node.
    Regards
    CLD - Labview Certified Developer
    Attachments:
    untitled3.gif ‏42 KB

  • Formula node(RIPEMD-160)

    Hi:
    I have project for RIPEMD-160 password control program,I need call standard RIPEMD-160 C language,
    I am understand Labview,but I am not understand C language,
    How can I use Formula node or Call Library function node?
    Can you help me,
    below is my program
    unsigned int K;
    unsigned char B[ ]={0xB3,0xE6,0x1F,0xCA,0x7A,0xA6,0xE3,0xF5,0xF7,0x58,0x59,0xF3,0xE0,0x35,0x85,0x59,0x1C,0x0A,0x08,0xA7,0xF3,0x59,0x0F,0xE5,0x3D,0x53,0x71,0xFA,0x7B,0xAC,0x4C,0x19,0x0F,0xE5,0x3D,0x53,0xF1,0xFA,0x7B,0xAC,0xB3,0xE6,0xBC,0x06,0x30,0xAB,0x43,0x81,0xE1,0x14,0x1A,0xCF,0x50,0xFE,0x33,0xD5,0xAF,0x1F,0xC7,0xBA,0x9F,0x35,0x2C,0xF9};
    D=RIPEMD-160 [B];
    K0=D13
    K1=D7
    K2=D63
    K3=D53
    K4=D1
    K5=D47
    K6=D0
    K7=D17
    K8=D51
    K9=D66
    K10=D41
    K11=D35
    K12=D25
    K13=D60
    K14=D11
    K15=D27
    RIPEMD-160 sample code see attach files.
    autocar
    附件:
    rmd160.c ‏11 KB
    rmd160.h ‏6 KB

    Hello autocar.
    有關如何將C語言轉成DLL,您可能需要找C語言的高手,建議您到雅虎或到其他BBS站求救。
    Thanks
    NI Taiwan AEs

  • Formula node for array

    hi
      i want to convert the values of an array using a different formula for each value in the array.     Can i use formula node for this?    if yes how
    if no then is there any other method except for extracting each one individually and converting?

    kunal227 wrote:
    there are 16 elements in the array and the number remains constant (actually they are temp values acquired by a fieldpoint hardware).
    the formula is a linear conversion (for example y = m*x + C) corresponding to the calibration curve of individual thermocouple connected to the fieldpoint hardware.   every thermocouple has a different calibration curve and hence every element in the array is converted using a different linear formula.
    All you need is an array of [m] and an array of [C], all the same size as your data arrray. No formula node needed.
    (I think that's what mikeporter had in mind above)
    Message Edited by altenbach on 07-24-2007 03:38 PM
    LabVIEW Champion . Do more with less code and in less time .
    Attachments:
    CorrectedArray.png ‏4 KB

  • For loop in formula node

    Hi,
    I wanna do some signal processing after I got the magnitude and phase infos from FFT. But the errors say that there is undefined variables.  I am just wondering that here absP and angleP are both vectors. Can I express them like what I did in the attached vi? 3x.
    Huihui
    Attachments:
    Untitled 12.vi ‏9 KB

    Hi huihui,
    do you just want to know the real and imaginary values of your signal?
    Why use formula node at all?
    Best regards,
    GerdW
    CLAD, using 2009SP1 + LV2011SP1 + LV2014SP1 on WinXP+Win7+cRIO
    Kudos are welcome
    Attachments:
    Untitled 12.vi ‏13 KB

  • NI PCI-6542: Creating Dynamic Waveforms Using the HSDIO Library

    Hello!
    I am having problems understanding how to create waveforms using the HSDIO library to run on my PCI-6542 board. I need to create a program that turns one channel on for 12.5 microseconds, waits a set amount of time(i.e. 100 samples),  and turns another channel on for 12.5 microseconds.
    This program is to be used in a phased array ultrasonic system.
    Below is the Dynamic Generation example program that turns channels 0 - 2 on for 1024 samples.
    * Example Program:
    * DynamicGeneration.c
    * Description:
    * Generates a simple pattern on specified channels.
    * Pin Connection Information:
    * None.
    /* Includes */
    #include <stdio.h>
    #include <limits.h>
    #include "niHSDIO.h"
    /* Defines */
    #define WAVEFORM_SIZE 1024
    int main(void)
    ViRsrc deviceID = "Dev1";
    ViConstString channelList = "0-2";
    ViReal64 sampleClockRate = 50.0e6;
    ViInt32 dataWidth = 4;
    ViUInt32 waveformDataU32[WAVEFORM_SIZE];
    ViConstString waveformName = "myWfm";
    ViInt32 timeout = 10000; /* milliseconds */
    ViSession vi = VI_NULL;
    ViStatus error = VI_SUCCESS;
    ViChar errDesc[1024];
    ViInt32 i;
    /* Initialize generation session */
    checkErr(niHSDIO_InitGenerationSession(
    deviceID, VI_FALSE, VI_FALSE, VI_NULL, &vi));
    /* Assign channels for dynamic generation */
    checkErr(niHSDIO_AssignDynamicChannels (vi, channelList));
    /* Configure sample clock parameters */
    checkErr(niHSDIO_ConfigureSampleClock(
    vi, NIHSDIO_VAL_ON_BOARD_CLOCK_STR, sampleClockRate));
    /* Query the Data Width Attribute */
    checkErr(niHSDIO_GetAttributeViInt32(
    vi, VI_NULL, NIHSDIO_ATTR_DATA_WIDTH, &dataWidth));
    /* Populate waveform with ramp data */
    for (i = 0; i < WAVEFORM_SIZE; i++)
    waveformDataU32[i] = i;
    checkErr(niHSDIO_WriteNamedWaveformU32(
    vi, waveformName, WAVEFORM_SIZE, waveformDataU32));
    /* Initiate generation */
    checkErr(niHSDIO_Initiate(vi));
    /* Wait for generation to complete */
    checkErr(niHSDIO_WaitUntilDone(vi, timeout));
    Error:
    if (error == VI_SUCCESS)
    /* print result */
    printf("Done without error.\n");
    else
    /* Get error description and print */
    niHSDIO_GetError(vi, &error, sizeof(errDesc)/sizeof(ViChar), errDesc);
    printf("\nError encountered\n===================\n%s\n", errDesc);
    /* close the session */
    niHSDIO_close(vi);
    /* prompt to exit (for pop-up console windows) */
    printf("\nHit <Enter> to continue...\n");
    getchar();
    return error;
    Questions:
    How can I change the values in waveformDataU32 to create off and on states(instead of just always on)?
    How do I select the channel that waveformDataU32 is applied to?
    Thanks!
    Zachary Geier
    Solved!
    Go to Solution.

    The waveformDataU32 array is an array of 32 bit integers. Each bit corresponds to a line on the device.  So on the first clock cycle, this program outputs:
    0000 0000 0000 0000 0000 0000 0000 0000
    Then it outputs the following, changing on each clock pulse:
    0000 0000 0000 0000 0000 0000 0000 0001,
    0000 0000 0000 0000 0000 0000 0000 0010,
    and so on all the way up to 1023:
    0000 0000 0000 0000 00000011 1111 1111
    In the example you include at the bottom, you are setting the least significant bit (LSB) to zero and one, effectively only changing one line on the output. To change all of the lines, you should use 4,294,967,295 or 0xFFFFFFFF instead:
    for (i = 0; i < WAVEFORM_SIZE; i++){
    if(i < 200){ //If sample number is less than 200
    waveformDataU32[i] = 0; //Turn off channels 0-2
    else{
    waveformDataU32[i] = 4,294,967,295; //Else turn on all channels for 800 samples
    -Jim B
    Applications Engineer, National Instruments
    CLD, CTD

  • Array index problem in formula node

    dear friend
    I'm trying to use formula node to solve a problem because I make this program using c at the begining.
    It runs perfectly in turbo c, but somehow it doesn't work in the formula node.
    I try to debug my source code, and I find that the formula node seems can't read the true value in
    the array.
    Here is the code in the formula node.
    int32 i,j,k;
    for ( i = 0 ; i < sopa; i++ )
     j = 1;
     ep[i][0] = pa[i];
     ep[i][1] = np[ep[i][0]][0];
     while ( ep[i][j-1] != exit )
      for ( k = 0 ; k < sonp ; k++ )
        if ( np[ep[i][j-1]][k] != -1 && (pc[ep[i][j-1]][ep[i][j]] + pc[ep[i][j]][exit] >= pc[ep[i][j-1]][np[ep[i][j-1]][k]] + pc[np[ep[i][j-1]][k]][exit] ) && (pc[ep[i][j-1]][np[ep[i][j-1]][k]] == org[ep[i][j-1]][np[ep[i][j-1]][k]] ))
          ep[i][j] = np[ep[i][j-1]][k];
      j++;
    This is the part that I think the problem might be.
    if ( np[ep[i][j-1]][k] != -1 && (pc[ep[i][j-1]][ep[i][j]] + pc[ep[i][j]][exit] >= pc[ep[i][j-1]][np[ep[i][j-1]][k]] + pc[np[ep[i][j-1]][k]][exit] ) && (pc[ep[i][j-1]][np[ep[i][j-1]][k]] == org[ep[i][j-1]][np[ep[i][j-1]][k]] ))
     ep[i][j] = np[ep[i][j-1]][k];
    I state that "np[ep[i][j-1]][k] != -1" but I do get the value -1 in the array "ep".
    Could someone tell me why I get -1 in the array?
    I hope I can finally do it all by labview not using formula node,but array like "pc[ep[i][j-1]][np[ep[i][j-1]][k]] "
    seems very hard to wire in labview. Could someone give me some good advices of doing this?
    Thanks for your help

    altenbach 已寫:
    normanshi wrote:
     ep[i][0] = pa[i];                                          (A)
     ep[i][1] = np[ep[i][0]][0];                            (B)
    ...    if ( np[ep[i][j-1]][k] != -1 && ... )          (C)
          ep[i][j] = np[ep[i][j-1]][k];                       (D)
    I state that "np[ep[i][j-1]][k] != -1" but I do get the value -1 in the array "ep".
    Could someone tell me why I get -1 in the array?
    I hope I can finally do it all by labview not using formula node,but array like "pc[ep[i][j-1]][np[ep[i][j-1]][k]] "
    seems very hard to wire in labview. Could someone give me some good advices of doing this?
    There are many possible scenarios to get a -1 in the ep output. For example if the -1 gets already written in step (A) or (B) at a certain index, and that index does not get overwritten in step (D). You are indexing all over the place! Is there some bounds checking on the array contents? What are typical inputs and array sizes?
    I'm sure about that the -1 doesn't get already written in step (A) or (B) because ep[i][0] and ep[i][1] is fine. What really makes me confuse is that sometimes ep array has the value like this.
    That means it does overwritten some value in step (D). The -1 should never be written into it because I have already state that np[ep[i][j-1]][k] != -1. Somehow I still get -1,and this is really strange! I'm indexing all over the place becuase I can't figure out a better way to achieve my requirement.
    I think I should briefly tell you what I'm trying to do. In this program,I input some values which means the distance from one point to another. Then I use floyd's all pairs shortest-path algorithm to find all the shortest distance. Finally I want to find out the "shortest path". I mean like from point 4 to point 0,the shortest path might be like 4 -> 2 -> 1 -> 0, and what the formula node part do is trying to find out this "shortest path". Maybe you can give me some better advice of doing this, I have been thinking a better way to do it for about two months. I think I'm really not good at this.
    I try to do it all by labview ,but again I get a strange problem. This time the ep[i][j-1] doesn't get the correct value. In the first time i=0 j-1=0 ep[i][j-1] = 1,but the second time i = 0 j-1 = 1 ep[i][j-1] = 0. This makes the "ep[i][j-1]!=exit" get the incorrect boolean value. The ep[i][j-1] should be 2,not 0. I try to use highlight to find if I make any mistake, but I can't one.This is the input and I put the labview program in attached file (temp4.vi).
    Could you help me find out why this happened?
    Thanks for your help altenbach!
    由 normanshi 在 08-19-2006 10:06 PM 上編輯的訊息
    Attachments:
    temp4.vi ‏191 KB
    ep.jpg ‏10 KB
    input.jpg ‏9 KB

  • Array in formula node

    Hello everyone,
    I am new in labview. I would like to display the coherence function with the correct frequency scale. For instance, I want it to be as follow: FreqAxis = 0:Fs/2/(N+1):Fs/2. where Fs is the sampling frequency and N the number of sample. I am trying to write using Formula node, but it is not working.
    Thanks for your time and your help.
    Axel

    Thanks again for your comments and your time .
    I have attached the .vi file and a screen-shot of the expected result (cohere2.png).
    Cheers
    Axel
    Attachments:
    Code_frequency.vi ‏531 KB
    cohere2.PNG ‏17 KB

Maybe you are looking for