Advice on the restructuring of code to avoid the downturn over time

Hi, I am a new user of LabView, you want some advice on how to better structure the program I wrote and which is used to perform a hydrostatic test arrangement. Data are collected on a module of AI cDAQ 9207 and a cDAQ 9474 module is used to control the two valves that subsequently controls pressure in and out of the test Chamber. I enclose my first version of the reference code.

What the VI is supposed to do when the user of the weapon system and strikes then the execution, the program switch will cause a transition of the test chamber through several States corresponding to the levels of different pressure for some time. Time curve vs pressure is written to a file of measures. I built using a state machine structure.

My problem is, during the initial trial, when the duration of the test was about 5 minutes or so, the program went very well. However, once I started to test the length of the actual test of 2.5 hours, I noticed the program running slower and slower as time progressed to the point where it would take several seconds for each iteration of the loop, then by accident about an hour or two in the test. After scouring the articles and messages, I suspect the main culprit is the diagram of waveform and to a lesser extent DAQ assistant.

While I need the loop structure data collection and case to run pretty quickly (preferably the order a few hundred s/s) I need the code to be able to react to changes in pressure in the room quickly enough, the actual data, that I need to store and display the graph can be as slow as a sample per second or even longer. My guess is at this point that I have to rebuild the program using some sort of architecture of producer/consumer, I'm looking for some advice on how best to structure the program.

Data acquisition obviously belongs in the producer loop that will run at a fast enough pace and there will be a consumer loop that will run at a much slower pace for the Bulletin Board writing to the extent of the file vi, but where should I put the case of structure state machine which currently controls the valves? Should put in the loop of the producer since it must run at the same fast pace as the collection of data, so it can react to changes in pressure or should I build another loop of consumer for him? What other indicators (pressure and Boolean) and controls on the front panel, they should be on another loop operating at a medium speed I want to respond to a faster pace than the data to the chart/write the loop, but they do not need to be as fast as the data acquisition loop?

Finally, I'm not quite sure what would be the best way to reduce the sampling rate of the data that I have in fact appear on the graph and the store in the file, it wouldn't make sense to create another task of measurement that samples at a rate below just for that purpose. Suggestions and advice would be greatly appreciated! Thanks in advance!

Bob

My guess is that if you monitor the use of memory over time, you see that going up, Yes? Everything is is always a good idea to get rid of the express VIs, I would look for the problem of slowdown in the structure of the case. You repeatedly open and never close tasks which are created using some DIO channels. Hnece each time that the loop more memory is allocated. Try to move creating channel screws out of the loop, then the tasks are created once before the start of the loop and then written to as required inside the loop - and don't forget to delete tasks once the loop over.

Mike...

PS: You are right with your comments regarding the structure of the producer consumer. Basically it break up as things get quickly (DAQ IO) that there is in a loop, while the user interface and the stuff that can take a long time (such as the data record) are in another loop. You can even have three loops with one for the acquisition of input data and the other for the digital output.

PPS: Finally don't forget that even if the structure of consumption of the producer is usually represented with everything in a single diagram, there no need to be. I wrote a lot where each loop is in his own VI which is run dynamically, then the application starts.

Tags: NI Software

Similar Questions

  • full waveform graph to calculate the area under the curve over time

    Hello

    If please find my attached VI and help me please for integration to get area undercut for my chart of waveform.

    I would like to find my wave power wind energy production chart oever within one month of time.

    I think I have to integrate to get the area under the curve and so I m now using tool integrated into labview attached.

    As I did not wait years for my result and so I want to make sure that the tool that I m using is correct.

    Please advise me what method I will use for my chart.

    Dominique says:

    I would like to integrate my table of power over time (table of power is on each interval of a minute) and the entire graph is one month. So, I'll put dt = 1?

    You put dt at some units you want in the final result. If you want Wh, you want dt in hours. If the spacing is currently a minute, you can express in fractional hours and use the result as dt. Try dt = 1/60.

  • create the voltage over time

    Is it possible to generate an output voltage on a DAQ 6009 A0? I have a data excel sheet that I put in a 2D array. The voltage is not constant over time. I have problems with the synchronization of the signal. I was able to trace the signal on a chart. This is the same as the original data to excel. I have two data streams. Voltage and time. But after separating the two signals how can I generate the graph?


  • check the opacity over time

    Hey!

    Doeas someone knows a way to check the property opacity over time? I need something more than. activeAtTime()

    found this

    App.Project.Item (index) .layer (index).propertySpec.valueAtTime (time, preExpression)

  • How can I move the CRA over time default text?

    I have placed "Default Text" on a separate video track. In the video, a hand is oriented along an arc for 1.5 seconds.  I want the text to follow the CRA that the hand moves.

    I stumbled on how to do this all by pointing and dragging various things in the framework, then I screwed up the edit and CTRL-Z got myself back to a better point AND I LOST THE ABILITY to do so.

    While it worked, I would see my text in its framework, and the center of the image has a cross.  By positioning the scrubber at the beginning and ending points, there was a line drawn from the cross to the text.  The starting point was a line showing the starting position, the point of arrival had it showing the end position.

    Now, when I try to move the text, I get one of two things (none of them work for my plan):

    (1) I have the window "Settings" open and the pointer tool is used to fix the position of the text in my "Default Text" setting.

    (2) I'm moving the entire frame in the preview window and the cross moves with it.

    I stumble on something and I don't know how I got there.

    Thanks for any help you can give.

    Me: 64-bit Windows 8.1, Adobe Premiere Elements 13

    billsbayou

    Great news. Great job.

    Timeline clip selection, Panel applied effects tab/Applied effects Palette/movement extended to get across (to zoom) and properties of Position (panoramic view).

    That's where I was pointing you in my previous post when I wrote

    But if everything you want to do is to move text along a path in Premiere Elements, which can be done Motion Keyframing scale (to zoom) or

    Position (panoramic view) / probably better using this framing key to the Position property. Have you tried yet?

    There is always another way... creating keyframes for Position at the level of the "elastic" timeline, orange line that scrolls horizontally on a video editing or audio clip. More info on another time if you are interested.

    But, at present, a lot of progress.

    RTA

  • The maximum graph time

    I need to draw a picture that shows the behavior of the frequency of the peak spectral of the signal over time. I thought that this VI will work fine:

    The interesting thing is that before you plug the output of statistical Maximum of the block time to the time of Max graphic time, displaying the parameters correctly:

    Here's the diagram corresponding to the façade above:

    But as soon as I connect the Max permeate more graphic time to the output of statistical Maximum block time and run the VI, the time (x axis) of the chart changes frequency x axis:

    Once again, I want to the chart to view the changes in the value of maximum frequency over time. Any suggestions? I have attached the VI below. Thank you!!

    Hello wprice

    I have converted the duplicate dynamic data and was able to see the values to show based on time.  Can you let me know if this is the direction in which you want to move forward?

    Thank you very much!

  • Advice on the acquisition of trigger using the bridge of strain cRIO module

    Hi all! I quote a project of collecting the values of a single lane of a constraint NOR-9236 bridge module. I need to view and draw a large number of curves over time, and I'll try to find the best way to trigger the acquisition. It is the first project of LV RT that I've been involved with, I'm looking for a bit of general advice as well.

    Basically, I need to acquire 500 samples at 1 kHz, and I need to know if there are special considerations that I'm on. Specifically, I'll need a DIO module? It is an application quite simple (to my knowledge, anyway), but I would prefer something a little more predictable and controllable timed a trigger.

    Thanks and let me know if I have omitted important information.

    No worries, the statements above seem reasonable. It will be largely a matter of this application in the code that you write. It fell well within the capabilities of this system. Good luck!

  • Need some advice on the best way to do specialized source distribution

    I need to give a customer a labview block, they can use our material in their own labview code that will read the (encrypted) data net senor off the coast and the flow of data in a form usable output.  I built a vi that can be used in a loop, a bit similar to the block of canned labview data acquisition that can be used to acquire data from products OR.

    There are many sophisticated (and secret) algorithms going on in the background which make sense data and translate them into a usable data table, but also configure the hardware itself. Accordingly the only final vi I prepared to distribute the client makes use of Subvi about 20. Almost none of these subvis could be ideally be reconverted in plain code in main vi, nor what I want to do this.

    The rules of the game is the following: I want to give him the block I created to use its own code, without him to see what's happening inside the vi.  I can deny him access to the block diagram/s, no problem, but I don't want to give him access to the subvis, to use, or even to know their names - preference they would be hidden or otherwise pre-compiled. Preferably I would just give him the main block only, perhaps with some support files that would be entirely opaque to him.

    Looking for advice on the best way to go. There is an elegant solution to this problem? For example, it would be better to compile the block as a .dll file, and then write a wrapper vi any?

    Have you thought of creating a packed library? You can also password protect your code. You can delete the distributed code block diagrams. You can use a combination of the above as well.

  • Guard application launch at the start of the appliance, also need advice for the implementation of network methods

    Hi all

    I'm new to the development of Blackberry and I'm writing a relatively simple application to run on 7.1.

    So far the development was interesting, I managed to create my user interface using resources online (mainly this forum), but today I tried to implement some of the network classes that I need and now I just met constant problems.

    I use Eclipse SDK 3.7.2 (the one that comes with the plugin RIM)

    First question:

    I'm not sure what I changed, but today I noticed that whenever I start the Simulator (by sim 9360) my application is started during the initial startup process. I don't think he did this before, but to be honest, I wasn't paying much attention. I think it starts at the start of the device is because I put a breakpoint in the constructor for my class from the main screen, which is hit before the Simulator happens even to the point where it is ready for user interaction. In addition, once it is ready, if I press the BB button, I see my registered application.

    I don't have it set to automatic start in .xml descriptior enforcement.

    I started this application on the HelloBlackBerry sample, here is my main method for the entry of the application:

    public static void main( String[] args ) {
            appSettings = AppSettings.fetch();
            // Create a new instance of the application and make the currently
            // running thread the application's event dispatch thread.
            HelloBlackBerry theApp = new HelloBlackBerry();
            theApp.enterEventDispatcher();
            //openConnection();
    
        }
    
    
    

    As far as I know, this is the only entry point for the application.

    More code

        public HelloBlackBerry() {
            // Push a screen onto the UI stack for rendering.
            mainScreen = new ScreenHelloBlackBerry();
            pushScreen( mainScreen );
        }
    

    Here is the method of. my class AppSettings fetch()

        // Retrieves a copy of the effective properties set from storage.
        public static AppSettings fetch()
        {
            AppSettings savedSettings = (AppSettings) _store.getContents();
            return new AppSettings(savedSettings);
        }
    

    Some of this code that I wrote myself, the persistence store cause the launch of my car?

    I tried to reset the Simulator to the factory settings, no change.

    All applications initialized during the startup of the device and then closed shortly after?

    Part 2: Need advice for the implementation of functions of network in the application

    I need to implement some methods that will retrieve data from a web service, and I also need to send data to this service. What I've read, the ConnectionFactory is the way to go. I want my application to make a request when the application is open and can check on a set interval. I didn't know exactly how to go about adding another thread for networking, I understand that network connections should not be created on the thread main event, so I tried to do this:

    The constructor of my class that implements screen (ScreenHelloBlackBerry), I use the following to create a modal dialog box to prompt the user for a username, I also try networking wire in the same segment of spawning:

            public ScreenHelloBlackBerry(){...initialize fields and managers, add it all together...then near the end
    
    //This will open the confirm dialog when the application is launched
            UiApplication.getUiApplication().invokeLater(new Runnable() {
                  public void run() {
                      openConfirmDialog();
                    //start connection - Possibly broken
                      ConnectionThread ct = new ConnectionThread();
                      ct.start();
                  }
            });
    

    I don't know if it's somehow OK to do, but it seems to work for what I need. I want a user who launches the application at the prompt, and if a user switch applications, when they come back they wondered again (unless they close the app and reopen it).

    Here is my ConnectionThread:

    public class ConnectionThread extends Thread
    {
    
        public void run()
        {
    
              ConnectionFactory connFact = new ConnectionFactory();
              ConnectionDescriptor connDesc;
              connDesc = connFact.getConnection("http://www.google.com");
              if (connDesc != null)
              {
                  HttpConnection httpConn;
                  httpConn = (HttpConnection)connDesc.getConnection();
                  try
                  {
                      final int iResponseCode = httpConn.getResponseCode();
                      UiApplication.getUiApplication().invokeLater(new Runnable()
                      {
                          public void run()
                          {
                              Dialog.alert("Response code: " +
                                            Integer.toString(iResponseCode));
    
                          }
                       });
                      httpConn.close();
    
                   }
                   catch (IOException e)
                   {
                     System.err.println("Caught IOException: "
                          + e.getMessage());
                   }
              }
        }
    }
    

    At the moment it has basically unmodified code from a sample that I found, I'll be retooling to meet my needs whenever I can make it work. I HAD this work to the point where, after the closed user confirm this dialog, a few moments later a an alert dialog appears with the 302 response code. I don't know what changed, but now it doesn't work at all, and if I try to scroll with the debugger, I can't past the httpCon.getResponseCode (). I've seen some mistakes earlier on "no record of service was set up", and I also had once a timeout exception.

    I'm sure I'm doing this wrong, but at the same time as I said WAS working, and now it is not. If someone has done this far, thank you very much for your time and advice are much appreciated.

    Also, should I try to start the thread of the network of the UIApplication class instead of the screen? There is currently very little happening in the class that extends UIApplication, do I spend most of my business logic out of the class of the screen and in the UIApplication class?

    Thanks in advance!

    Hi all

    Just to conclude this topic for those who are interested, I found an excellent guide to the implementation of networks in applications of BB, click here for a link.

    About my application being started at the start of the simulator of the device, I found that on a device real this behavior is not complied with, and in addition, the behaviour seems to have stopped after uninstallation and reinstallation of my Simulator.

    See you soon,.

  • Validation table - advice on the best approach to please? :)

    Hi All - would appreciate some advice please...

    I have a (static) table in my form according to the directions of the image below:

    Impact Table.JPG

    Each drop-down list is the same, the user can choose to "Minor", "Moderate", "Significant", "Major" or "Intolerable". When they do the selection I need several things:

    1. The background color of the cell needs to change to 'Minor' = green, "Moderate" amber, "Significant" = amber =, 'Major' = red or "Intolerable" = red.
    2. The selection should auto fill all right with the same value that some - for example if a user selects 'Major' in the second cell of the row from the top (finance), all the cells to the right should default to "Major" and change color accordingly.
    3. The selection must define the deposit available towards the bottom of choice to ensure the impact assessment can only increase over time – for example, if a user selects 'major' all the downs fall standing on this line (to the right of the selected dd) have only the option of selecting 'Major' or 'intolerable '. The line should be hidden if the user then changes a selection, the result of which means the coast got less over time - which means that the line must be performed again.

    The dropdown values are related to specific numbers ('Minor' = 1, 'Significant' = 2, etc.) and that must remain the case that the values are used in the XML at a later stage.

    I had managed to get the color change of work and had tried to implement a "Switch" statement to define the drop down lists (number 3 above), does this have worked if the user makes selections according to the rule regarding the impact that worsen over time, but I had a very odd behavior when the user changed a selection subsequently and 'broken' rule. I have since deleted all javascript code to leave.

    My question is this: what would be the best way to get what I want to do?


    Could make you in an efficiant manner using a function / script object or other?

    I would be very grateful if someone could suggest a method, provide a snippet of code perhaps or even write the code for a single cell for me stick in every other ?

    Here is the form: https://www.dropbox.com/s/ncvq9cyoqolh2tn/BIA%20Impacts%20Table.pdf?dl=0

    Thank you very much

    Ellis

    Hi, Ellis,.

    Sorry, misread the requirement.  If the date should be copied across, without worrying, then you can delete the statement altogether.

    dateField var = contextItem.parent.resolveNode ('#field.) ([ui.oneOfChild.className == "dateTimeEdit"]');

    dateField.rawValue = ImpactsSubForm.DateTimeField1.rawValue;

    This version also manages the date fields with different names (referencing of nominally ui elements child element class... just do not add another date field to the line)

    Here's another link https://sites.google.com/site/livecycledesignercookbooks/BIA%20Impacts%20Table.date.1.pdf? attredirects = 0 & d = 1

    Concerning

    Bruce

  • Advice on the use of the oracle.apps.aia.core.eh.i18n.EHCorrectiveActionRB

    Hello

    I'm trying to implement the AIA error handling and reading that AIA provides xpath functions to retrieve the error code messages and corrective action messages. the documentation says that you must use the oracle.apps.aia.core.eh.i18n.EHCorrectiveActionRB listresourcebundle class to do this.

    My questions are:

    1. this oracle.apps.aia.core.eh.i18n.EHCorrectiveActionRB of the class already exists within the AIA in order to add the new error etc... you just need to change?
    2. If the above is true then where can I find this class to add new messages?
    3 this Listresource bundle must be implemented in all composite samples of AIA? If yes how can I do this?
    3. does anyone have examples that I can use to implement the management of errors?
    4. all other general advice on the use of this list of resources group

    Thank you for your help in advance.

    Kind regards.
    Adrian

    1. this oracle.apps.aia.core.eh.i18n.EHCorrectiveActionRB of the class already exists within the AIA in order to add the new error etc... you just need to change?
    Yes, they exist oob with FP. In 10g, it will be under system/classes/bpel file.
    2. If the above is true then where can I find this class to add new messages?
    In 10g, it will be under system/classes/bpel file. 11 g, it will be under /soa/modules/oracle.soa.ext_11.1.1/classes folder.
    3 this Listresource bundle must be implemented in all composite samples of AIA? If yes how can I do this?
    No, the bundle is a single resource, and you can add your messages in the same class.
    3. does anyone have examples that I can use to implement the management of errors?
    Please see available in OTN download AIADemo. All composite materials have the error handling.
    4. all other general advice on the use of this list of resources group
    11 g class of resource bundles is replaced by a file of text properties.

  • Advice of the Oracle

    Hello

    I want to know if it is possible to avoid using an index in a query.
    For example, I've defined 3 column index on a table named 'SUMMARY_VECTOR' with the following names, respectively:
    1 SUMMARY_VECTOR_ENTITY_NAME_IDX
    2 SUMMARY_VECTOR_IDX_CASE_NAME
    3 SUMMARY_VECTOR_VECTOR_ID_IDX

    I want to know if I can avoid using one of the three indices in my query by using the advice of the oracle.
    If it is possible, please if can u post an example

    Thank you

    Use no_index hint: / * + NO_INDEX (index_name table_name) * /.

    http://download.Oracle.com/docs/CD/B10501_01/server.920/a96533/hintsref.htm#5300

  • I'm trying to download the updates to my computer, but can't. I get the error code 646 and the download fails. I tried to download the update several times, but get the same answer. What is the problem?

    Ideas: I'm trying to download the updates to my computer, but can't. I get the error code 646 and the download fails. I tried to download the update several times, but get the same answer. What is the problem?

    • Pragrams you have problems with
    • Error messages
    • Recent changes to your computer
    • What you have already tried to solve the problem

    Remember - this is a public forum so never post private information such as numbers of mail or telephone!

    Hello

    Try this 1st to see if it helps, and it should:

    Description of the Patch registration cleanup tool
    http://support.Microsoft.com/kb/976220/

    ------------------------------------------------------

    If necessary :

    Try this - Panel - Windows Updates - on every update that will not be installed - click on the important updates
    or the update itself - double click a view more information (or click top then discovers on the right)

    Those who will take you to a page where you can download the update.

    Or go here and the KBxxxxxx number to download it.

    Download Center - mount the KBxxxxxx.

    Microsoft Download Center
    http://www.Microsoft.com/downloads/en/default.aspx

    Download - SAVE - go to where you put them - click on - RUN AS ADMIN

    Then you can right click on the update in the updates Windows and HIDE.

    If you get an error Installer install this version:

    Windows install 4.5 Redistributable
    http://www.Microsoft.com/downloads/details.aspx?FamilyId=5A58B56F-60B6-4412-95B9-54D056D6F9F4&displaylang=en

    ----------------------------------------------------

    Then run this:

    How to reset the Windows Update components? -a Mr Fixit
    http://support.Microsoft.com/kb/971058

    Description of the system for Windows Vista, Windows Server 2008, update tool and
    for Windows 7
    http://support.Microsoft.com/kb/947821

    ------------------------------------------------------------
    Because these are all Office updates you might get more information if necessary in the Agency of those groups that
    may have experienced the same problem.

    Office newsgroups
    http://www.Microsoft.com/Office/Community/en-us/FlyoutOverview.mspx

    Microsoft.public.office.misc discussions
    http://www.Microsoft.com/communities/newsgroups/list/en-us/default.aspx?DG=Microsoft.public.Office.misc&cat=en_us_01cb749f-c998-4762-8099-df71793c11c7&lang=en&CR=us

    ------------------------------------------------------------

    If necessary you can incident free get reports however the above should take care of it for you.

    Windows updates - free Incident report

    Go here and click on-> Windows Update fails while searching, downloading or installation of updates
    http://support.Microsoft.com/GP/wusupport#tab3

    The security updates, you can get free support Incident report
    http://www.Microsoft.com/protect/resources/support.aspx

    I hope this helps.
    Rob - bicycle - Mark Twain said it is good.

  • Do a clean install of Windows Vista 32 8.1; advice on the new partition formats.

    Hi, I'm going to do my clean install of Windows Vista 32 8.1 today.

    Need advice on the size for my new partition (s).

    Currently defined as the partitions:

    Total: free:

    OS (c                          99.7G          11.9G

    Data (D G 111, 14.5 G)

    HP_Recovery (E 12.0 G 1.97 G)

    I am running:

    Laptop HP Pavilion DV9700 Entertainment

    32 Vista Home Premium, SP1

    Basically I want a suitable partition for the new Windows OS 8.1 (more room for restore points).

    And the rest of the data area, I guess, as if I had originally.

    Does anyone have any other ideas, because I start from scratch.

    Hi davisj-oaktree.

    To remove the Vista partition, I included the following two links http://bit.ly/1dWZLLn, and http://cnet.co/1dWZQii. Please check the information on each of these websites.

    Good luck!

  • You want advice in the sale of 4.5 years old Alienware Aurora Alx

    Hi all

    Just for starters I don't have much experience with computers, computer hardware, etc. I intend to do a lot of research before I make any final decision on my desktop but my plan is to sell and look for a laptop. I appreciate all the advice.

    I have an Alienware Aurora Alx desktop computer (late 2011) with an Intel core i7 cpu 920 @ 267 GHz, 6 GB of RAM installed. I have 2 GPU AMD Radeon HD 5670 connected with AMD crossfire.

    I run a ton of different games on this issue at the highest graphics settings without any problem, Civ 5, LoL, cities: horizons, CS, Dota 2, Arma 2 and rocket League to name a few.

    I'm looking for just to get advice on the price range, where to sell, how to find buyers, etc. Any help is welcome and appreciated. Thank you for taking the time.

    You can compare your requirements with those of eBay. It is generally a good way to find a range of prices.

Maybe you are looking for