Simplification of Code

Hello!

I have this snippet, with shift registers, attracts intrigue last 20 on the same graph you see on the botton of the image. Any of you have an idea how to make this more compact code? Or someone has a solution to make it scalable, for example if I want to use the last 100 plots?

Thank you in advance!

It look like you are actually doing an array of clusters.  So do the shift register a table of these clusters.  You can increment then what waveform to be replaced at each iteration.

Tags: NI Software

Similar Questions

  • Simplification

    Hello

    I do the simplification of code now, it a pretty big Chuck of the codes.

    I was wondering how can I track my memory usage to see that my work is effcienc or not?

    Also, I am trying to speed up my code run time so how can I tell how long it will take for all of the code?

    Thank you

    The easiest way is to go to tools-> profile-> Performance and memory.

    Another way to compare (good for subVIs) code is to use two functions of the number of cycles with your code in the middle.  Subtract the last of the first to get your code how long taken.

  • Edit/delete/add scene coordinates in the table during execution

    Hello world

    I managed to build table allows you to store and record the coordinates of the stage and remind to control steps. However, I need change/remove/add details of scene during execution. I also need to allow the user to directly edit the coordinate from the scene of the array. Wondering what someone knows what is the best way to do it? Or is it better to use the matrix or Cluster? Thanks in advance.

    Best regards

    Han Yen

    Han Yen wrote:

    Thanks much altenbach for all the advice. I tried to do a table 2D control. I've been playing with table in the control. However, I still can't find out how can I detect that I change the data in the table 2D with the more recent issue during execution? How can I then update my current table with the latest data?

    Well, the 2D table is updated immediately and you do not all the other tables.

    Do you mean that you want to update XAbs, etc. where the just changed line is already selected?

    In any case, here's a simple project, perhaps it will give you some ideas. I would recommend using also the tables for XYZPos, entrances etc. and the XYZabs. This simplifies the code because you reduce the number of terminals and table operations.

    Let me know if something is not clear to you.

  • Measurement of angular position with encoder in quadrature and NI USB 6281

    Hello.I have an application developed with labVIEW 7.1 and 6014 OR for the measurement of angular position using encoder quadrature, where are used 3 sons - one of them connected to the source, second to the OID (0 or 1) and a third to digital ground. I can't use the same application or NI USB 6281.Now connections, I would like to know how I can create a similar application in labview 2009 and how to make the relevant connections for NI USB-6281, which is a mx NI DAQ device. Please suggest. Thank you.

    I have my loan application. I understand there are big difference using LabVIEW 2009 and NI USB card, compared to the previous version I was using THE LabVIEW 7.1 and a traditional daq. The difference, I should say that wellness is both in terms of simplification of code and the accuracy of the result. I was a little surprised, showing results. Thanks a lot to JB for your time and sharing those pieces of details.

    I can well after awhile my code in the forum. Hope this helps someone like me looking for a similar application.

  • Display problems with all types of terrain and graphic

    Hello

    I have display problems general with all types of chart, graph or plot that I try to use, on two different machines, both with NVIDIA graphics cards.  A machine is a MacBook under XP SP2 in bootcamp and the other a Dell T3400 workstation (or something similar) under XP SP3.

    I posted this thread earlier which Ben replies to the weird graphic behavior.  Ben suggested that I try to simplify my code as much as possible while keeping the bad behavior and by submitting to the NC and the forum, because it is others have had problems of graph.  I tried, but in vain.  Display problem continues and continues and continues and then they just go and I can't get back by unscrewing the last stage of reduction or simplification of code.  But at some point during the reconstruction of the code, which I cannot determine, returns the bad behavior.

    So, I was set up with graphics looking for shit, until recently, when I thought I'd try some suggestions of other messages to a XY-plot function as a graph by creating a buffer and using nodes of ownership of land for the range control.  Things seemed promising, until my "XY table" started getting shit, too.  This time, the issue was with the grid lines becomes all chopped, attached images.

    I am out of resources here.  I think I'm running out of options to display graphic data in an acceptable manner.  Do I have to display data by using an Excel chart in an ActiveX container in Labview?  I'm not skilled enough to do it again.  I like Labview, it is the only programming language that I am competent even remotely help, but it's just inferiorating.

    Any suggestions would be much appreciated.  Thanks for reading.

    -Greg

    Greg,

    is there a particular reason why you use the bar plots - view superior graphic style? Try activating the legend of the plot, go to the bar plots and select the first track of the Bar Style. Your chart is displayed very well after that.

    See you soon,.

    Cerati

  • data transmission between the General case and problems of timing instructions using daq devices

    I'm currently developing a program using LabView 2012 SP1.  I am interfacing with an NI USB-6009 data acquisition using NOR-DAQmx 9.5.5f4.  I'm trying to get a voltage on the three analog inputs (AI0 and AI3 AI4) 1 second to start and 20 seconds of starting.  Three digital ports: P0.0, P0.1 and P0.2 are used to market the transistors for the signals in question and must remain high to the course of ~ 20 seconds the readings will take place.  After 20 seconds, I need to take the readings of each analog channel and the difference of the two to determine the delta at the start.  This delta will lead logic to implement later.  The attached VI has a while loop that runs on an interval of 1 second and a case statement that takes a reading DAQ at 1 second and 20 seconds (two separate trials).  The while loop stops after 21 seconds.  The question I have is how to manage the tensions of reading of the second 1 case and the second case 20.  I need to take the difference and the exit to the front after 20 seconds elapsed.  Please keep in mind when you answer that I am relatively new to LabView.  I have experience with several other languages (Matlab script, C, Java, Perl, etc.), but am still learning how to get concrete results in LabView.  That being said, guess I know nothing outside of what you see in this VI.  If you have any recommendations on how to implement more efficiently, I am open to suggestions. Thanks in advance for your help.

    RJ

    I would make the acquisition of 21 seconds of a value of data from data acquisition.  Then, you can index you want specific samples.  Have time to wire samples is much more reliable that Windows hope will be both properly 21 seconds.  It also simplifies the code in a bit.

  • management of the State with audio buzz.js

    Hey guys,.

    Been researching threads and can't find the answer!  I really try to not ask until it is the last resort.

    I need to find a way to stop the sound and symbol that plays when I click on another.

    This will help me in all my projects!  Please someone help me.

    composition ready, I have the sounds listed as such:

    mediaPath var = "soundz";

    sym.iSound1 = new buzz.sound ("soundz/toilets", {format: ["mp3"]});

    sym.iSound1.bind ('loadeddata', Function {}

    var point = Edge.getComposition (compId) .getStage ();

    });

    sym.iSound2 = new buzz.sound ("soundz/coffee", {format: ["mp3"]});

    sym.iSound2.bind ('loadeddata', Function {}

    var point = Edge.getComposition (compId) .getStage ();

    });

    each button, I have this:

    sym.getComposition () .getStage ().iSound1.play ();

    var mySymbolObject = sym.getSymbol ("top1");

    mySymbolObject.play ();

    Help, please!  I know how to stop a sound. But there are 10 total sounds. I could just list code to stop the other 9 sounds on each button?  Seems redundant.

    That is to say

    sym.getComposition () .getStage ().iSound1.stop ();

    sym.getComposition () .getStage ().iSound2.stop ();

    sym.getComposition () .getStage ().iSound3.stop ();

    etc etc.

    var mySymbolObject = sym.getSymbol ("top1");

    mySymbolObject.play ();

    And here are the project files...


    https://www.dropbox.com/sh/daws4h9yvgkwxg4/fnUerNx6Sl

    Here is your file corrected. All the code is compositionReady. I also added the ogg files for compatibility. I do not thing you need of aif, but I went on. Remove them and try. Using a table for your symbols simplifies the code and this way, they can have any name.

    https://app.box.com/s/ne6llgfln3sgqtgdpbfo

  • DataTip custom rendering engine for chart

    I use the code below to create a converter from tip of custom data in a chart. Right now, I have a rendering by chart type engine. It works well but I would like to have the component under the handle any type of graph.

    What should I put in the switch statement so the correct variable will be created?

    I sailed in the Variables pane and I see an id for the variable element, but I do not know how to access it properly.

    < mx:VBox
    ' xmlns:mx = ' http://www.Adobe.com/2006/MXML "
    backgroundColor = "#FFFFFF."
    backgroundAlpha = "0.95.
    borderColor = "0xB7BABC.
    borderStyle = "solid".
    paddingTop = "5".
    paddingBottom = "5".
    paddingRight = "10".
    paddingLeft = "10".
    verticalGap = "-2".
    Color = "#000000".
    >
    < mx:Label text = "{_dayText}" width = "100%" textAlign = "center" fontWeight = "bold" fontSize = "13" / >
    < mx:Label text = "{_dollarText}" width = "100%" textAlign = "center" fontSize = "11" / >
    < mx:NumberFormatter
    ID = "dollarFormatter".
    precision = '2 '.
    thousandsSeparatorTo = «»
    decimalSeparatorTo =". »
    rounding = more 'close '.
    / >

    < mx:Script >
    <! [CDATA]
    Import mx.charts.series.items.ColumnSeriesItem;
    Import mx.charts.series.items.LineSeriesItem;
    Import mx.charts.HitData;
    Import mx.formatters.NumberFormatter;

    [Bindable]
    private var _dayText:String;

    [Bindable]
    private var _dollarText:String;

    override public function set data(value:Object):void {}
    We know to expect a HitData object from a graph, so let's cast as such
    While there are no surprises DURATION
    HD:HitData var = value as HitData;

    Any HitData object has a reference to the ChartItem that created it.
    This is where we need to know exactly what kind of Chartitem we deal with.
    Why? Because a pie chart will not have an xValue and yValue a, but things
    as the bar charts, histograms and, in our case, the charts will be.
    switch (?) {
    case 'ColumnSeries ':
    var point: ColumnSeriesItem = hd.chartItem as ColumnSeriesItem;
    break;
    }

    var point: LineSeriesItem = hd.chartItem as LineSeriesItem;
    var point: ColumnSeriesItem = hd.chartItem as ColumnSeriesItem

    the xValue and yValue are returned as objects. Let's take as strings, so
    that we can display them in the fields of the label.
    _dayText = string (item.xValue);
    _dollarText = "$" + dollarFormatter.format (String (item.yValue));
    } //end set data
    []] >
    < / mx:Script >
    < / mx:VBox >

    The operator 'is' you will tell if the data type of the object "is" of a certain type.

    So if (event.currentTarget button) returns true if the data type of the event.currentTarget object "is" button, or maybe a subcategory.

    This expands your possibilities and simplifies your codes, as you don't have to rely on IDS, but can simply check the data type.

    Of course, that your situation must lend itself to data type checking and I think in your case because PieChart was different, I think that yours falls into this category.

    If this post has answered your question or helped, please mark it as such.

  • Does anyone know of an extension of the Illustrator who simplifies UPC-A codes

    The UPC program has expired, you are looking for a direct extension for Illustrator. Anyone know of any?

    I used Code bar of SNX Pro to generate the UPC on the labels and packaging for a dozen years. This program is essential in my work. You can give them a glance.

    http://www.snx.com/

  • Cannot access a HID device get code 5 error please let me know how to access a HID device, I need an example of code to access a HID device in windows 7.Thanks.R.M. Kiran

    /*******************************************************
    Simplification of Windows HID

    Alan Ott
    Software signal 11

    22/08/2009

    Copyright 2009, all rights reserved.
     
    The contents of this file can be used by anyone
    for any other reason without conditions and can be
    used as a starting point for your own applications
    that appeal to HIDAPI.
    ********************************************************/

    #include
    #include
    #include
    #include
    #include "hidapi.h".

    The headers needed to sleep.
    #ifdef _WIN32
    #include
    #else
    #include
    #endif

    int main (int argc, char * argv)
    {
    int RES;
    unsigned char buf [256];
    #define MAX_STR 255
    WSTR wchar_t [MAX_STR];
    hid_device * handle;
    int i;

    WIN32 #ifdef
    UNREFERENCED_PARAMETER (ARGC);
    UNREFERENCED_PARAMETER (argv);
    #endif

    struct hid_device_info * devs, * cur_dev;
       
    devs = hid_enumerate (0x0, 0x0);
    printf ("id=%d\tsproduct id = %d\n",devs-> vendor_id provider, devs-> product_id ");
    cur_dev = devs;
    so that {(cur_dev)
    printf ("detecte\n device type: % 04hx %04hx\n path: %s\n Serial_number: %ls", cur_dev-> vendor_id, cur_dev-> cur_dev-> path, product_id, cur_dev-> Serial_number);
    printf ("\n");
    printf ("manufacturer: %ls\n", cur_dev-> manufacturer_string ");
    printf ("product: %ls\n", cur_dev-> product_string ");
    printf ("output: %hx\n", cur_dev-> release_number ");
    printf ("Interface: %d\n", cur_dev-> interface_number);
    printf ("\n");
    cur_dev = cur_dev-> next;
    }
    hid_free_enumeration (devs);

    To implement the command buffer.
    Memset (buf, 0x00, sizeof (BUF));
    buf [0] = 0x01;
    buf [1] = 0x81;

    Open the unit by using the VID, PID,
    and possibly the serial number.
    handle = hid_open (0x4d8, 0x3f, L "12345");
    handle = hid_open (0 x 0461, 0x4d81, NULL);
    If (! handle) {}
    printf ("cannot open device\n");
    Return 1;
    }

    Read the manufacturer string
    WSTR [0] = 0x0000;
    RES = hid_get_manufacturer_string (handle, wstr, MAX_STR);
    If (res<>
    printf ("could not read the manufacturer string\n");
    printf ("string of the manufacturer: %ls\n", wstr ");

    Read the product chain
    WSTR [0] = 0x0000;
    RES = hid_get_product_string (handle, wstr, MAX_STR);
    If (res<>
    printf ("cannot read string\n product");
    printf ("string of product: %ls\n", wstr ");

    Read the serial number string
    WSTR [0] = 0x0000;
    RES = hid_get_serial_number_string (handle, wstr, MAX_STR);
    If (res<>
    printf ("could not read the serial number string\n");
    printf ("string of serial number: (%d) %ls', wstr [0], wstr");
    printf ("\n");

    Read the indexed string 1
    WSTR [0] = 0x0000;
    RES = hid_get_indexed_string (handle, 1, wstr, MAX_STR);
    If (res<>
    printf ("could not read the string indexed 1\n");
    printf ("indexed 1 string: %ls\n", wstr);

    Define the function hid_read() as non-blocking.
    hid_set_nonblocking (handle, 1);
       
    Try reading from the device. It is and must be without
    given here, but enforcement should not block.
    RES = hid_read (handle, buf, 17);

    Send a report on the device
    buf [0] = 0x2;
    buf [1] = 0xa0;
    buf [2] = 0x0a;
    buf [3] = 0x00;
    buf [4] = 0x00;
    RES = hid_send_feature_report (handle, buf, 17);
    If (res< 0)="">
    printf ("cannot send a feature report. \n") ;
    }

    Memset (buf, 0, sizeof (BUF));

    Read a report of the device
    buf [0] = 0x2;
    RES = hid_get_feature_report (handle, buf, sizeof (buf));
    If (res< 0)="">
    printf ("failed to get a feature report. \n") ;
    printf ("%ls", hid_error (handle));
    }
    else {}
    Print the buffer returned.
    printf ("function Report\n");
    for (i = 0; i< res;="">
    printf ("% 02hhx", buf [i]);
    printf ("\n");
    }

    Memset (buf, 0, sizeof (BUF));

    LED toggle (cmd 0x80). The first byte is the report number (0 x 1).
    buf [0] = 0x1;
    buf [1] = 0x80;
    RES = hid_write (handle, buf, 17);
    If (res< 0)="">
    printf ("could not write () \n");
    printf ("error: %ls\n", hid_error (handle));
    }

    Status request (cmd 0x81). The first byte is the report number (0 x 1).
    buf [0] = 0x1;
    buf [1] = 0x81;
    hid_write (handle, buf, 17);
    If (res<>
    printf ("impossible to write() (2) \n" ");

    Read the requested State. hid_read() has been set to be
    non-blocking by the call to hid_set_nonblocking() above.
    This loop shows the non-blocking of hid_read() nature.
    Res = 0;
    While (res == 0) {}
    RES = hid_read (handle, buf, sizeof (buf));
    If (res == 0)
    printf("waiting...\n");
    If (res<>
    printf ("could not read () \n");
    WIN32 #ifdef
    Sleep (500);
    #else
    usleep(500*1000);
    #endif
    }

    printf ("read data: \n");
    Print the buffer returned.
    for (i = 0; i< res;="">
    printf ("% 02hhx", buf [i]);
    printf ("\n");

    hid_close (handle);

    / * Free of static objects of HIDAPI. */
    hid_exit();

    WIN32 #ifdef
    System ("pause");
    #endif

    return 0;
    }

    Hi KIRAN RM,.

    Given that you need example code to access a HID device in windows 7, the question you have posted is better suited for the MSDN Forums. Please post your query in the link next to the support of the MSDN forum for further assistance.

    Windows hardware development

  • Migration of code (Development) Dev to Uat to Production (performance) (Development)

    Hi all

    I want to know what is the best approach to migrate the code migrate from Dev Environment for Uat environment then scenerio in Production (delivery Type)

    I would like also to master all repository approach knowledge & creating repository without conflict of id internal while migration of work object.

    Thank you.

    Arun

    There is a lot of documentation out there about the repository ID number, but in short:

    1. Ensure that your deposits in each environment have unique IDS when they are created. One method that can help with different environments is to ensure that standards are numbered from IE a unique range of all repositories in DEV ID assigned to the range of 100 to 199, UAT 200 to 299 and 300 to 399 PROD. It is easy to deduce the ID of environmental objects have been created.

    When the migration of objects DEV--> UAT--> PROD, I would say that it should be never rest the scenario. You must migrate design time objects because all your development should be limited to the DEV, including corrective measures that may be taken following UAT. Also this approach greatly simplifies the migration activity. However if you are to move objects of design to the UAT time, not recommended, then make sure that:

    1. When you migrate objects between environments make use of Smart Export / Import, which was introduced in 11 g so that you get all of the dependencies of the object.
    2. Import using mode synonym insertion/update to keep the source of the migrated objects.
    3. Your logical architecture is uniform in all environments (true regardless of whether you are migrating design objects or some scenarios)
  • Since iOS 10.0.2 my phone is accessible without the access code

    Since iOS 10.0.2 my phone is accessible without the access code after I pressed the sleep button. Press the home key several times my phone opens. As a first step, it is that he fell asleep in itself not when I used the sleep button but now even after skeep button I can access my phone without the password.

    the rear power and apple support site are not easy to use to report the problem.

    Have you tried to set up your password again in the settings?

  • Playgrounds are learning to code 1 download error

    I recently bought an iPad Mini 2 specifically so that I could use the app to playgrounds to learn about Swift.  Whenever I try to download the playing field 'Learn to Code 1 - basics of the swift' I get an error that says: "not taken download error supported URL.  I uninstalled and reinstalled the soft playgrounds several times.  Other playgrounds (as 'learning to Code 2 - beyond the basics') download very well.  How can I bypass or fix this error and get the first playground of lesson?

    Finally, the playing field is downloaded successfully!

  • Access code is lost as soon as the screen turns off

    When I turn my wrist after that my Apple Watch screen exploded, I need to enter the access code. I turn on the wrist, the screen turns off, I turn back, screen lights up, I need to re-enter the password. And so on and so forth. The watch does not maintain the code.

    I am white white, is not dense hairs on my wrist, no tattoos and I wear the watch very well on my skin.

    The funny thing is: it is a replacement watch, I got today. The other had the same problem, but this is probably because the bottom of the watch with the sensors fell, must have damaged the sensor cable. But this one is brand new.

    Hello

    Make sure the wrist detection is enabled:

    • On your iPhone, in the application of the watch, go to: My Watch (tab) > General > detection of wrist - turn on.
  • I am tryng to buying music on itunes, but it says security code wrong please help

    Hello

    I have problems I want tp purchase music on my itunes bt ts always requires the security code that I don't have it please help

    Check your card information. If they are correct, try to change or remove your Apple ID - Apple Support payment information

Maybe you are looking for

  • How can I get the screen foxfire of origin at the time I opened foxfire?

    Now, I get an advertisement below the place where I enter my question. I had to remove it and return to the original screen life

  • Qosmio G50 - 12G - how to remove Toshiba instructional video?

    Nice day I bought a Toshiba-G50 - 12G 10 days in the Netherlands. I have the following question: After a certain period of time, that I do not use the laptop, suddenly a video instruction begins to play showingHow can I for example upconvert SD to HD

  • Migration of HDD SSD

    Hello I want to migrate the HARD drive of my Acer Aspire S3 - 392G to an SSD (Crucial M550). All I have to do is make a recovery from USB, follow these steps? Use the following steps to create your backup drive: Press on the Windows () touch + Q.Type

  • 600-1120: touchscreen: mouse image appears on the screen?

    Hello During each action in touchscreen mode, an image of big mouse appears on the screen and then disappears after a few seconds.  Is this normal? Is it possible to remove the image of the mouse? Thanks for your help!

  • Facebook cannot load images

    I can see the pictures on Facebook, but not those that are displayed in the news feed. I can't see pictures I have uploaded before or pictures of my friends posted on their profiles too. I can't see also cover photos. All I see are gray boxes that do