asynchronous call

Hi all

This is the first time I use call asynchronous one under VI. in my program everything is OK but when I run it, the 'run' demolition 'Cancel' icons above the fliker Sub VI. What is the problem with my program.

Thanks in advance

Valentine wrote:

Dear Bob

In the case you mentioned, I think I can attribute as the shutdown command to one of the input terminals of th Sub VI and then wire 'Stop asynchronous VI' button in the VI main at the terminal entrance mentioned of the VI Sub so in this case, it is not necessary to define a global variable?

Am I entitled?

Concerning

You're right, but that he would not do what you want.  LabVIEW uses the principle of the data stream, which means that the data flowing into a VI does at the start of the VI and runs to the end of the VI.  Suppose you wire stop Sub - VI one entry (which we will call ' stop Sub - VI') of the Subvi.  If you call it with stop Sub - VI = True, then the Sub - VI will have its judgment said when it is called.  Suppose you call with stop Sub - VI = False - well, the sub - VI starts working with fake plugged into the Terminal to stop (and therefore will not stop).  Now the sub - VI runs asynchronously. with its entry "Stop" being False.  Nothing of what you are doing in hand VI will influence this asynchronous routine (that is why it is asynchronous - it runs independently, in parallel - the only time where you can pass data inside on its connectors is when she starts (and called), and the only time where you can remove data is when he stops.)

The exception to this, of course, is using a shape any global, as I've explained.  By all means, try to make your way - you will find that you can not stop the asynchronous routine by using a control cable connector.  Once you do this, do not hesitate to try one of the methods that I have described, which will work.

BS

Tags: NI Software

Similar Questions

  • Problem with asynchronous call and Forget.vi and MessageBoxW (user32.dll)

    I have a problem.  I want to use the same type of structure as in "asynchronous call and Forget.vi.

    There is a picture of my (Message Box.vi) VI.

    The VI expect the 'narrow reference' I select OK or cancel.  This is not the expected behavior.  If I turn off the "narrow" reference I have the expected behavior (by renaming properly the buttons).

    What am I doing wrong with the asynchronous call?

    Looks like close reference wants the loop of the root and your dialogue it blocks until it is finished.   I assumed that Run in the user interface thread is selected in the COLD LAKE to the MessageBoxW function, try changing to run in any thread

  • A limit to the reentrant instances run using the VI server and asynchronous call?

    I have an application that attempts to launch many incoming preallouees clones using the server of VI with asynchronous call to start. I find that it seems to be an upper limit on the amount of clones that can be run by using this method. 26 Nations seem to run and then in addition more clones are laid but they seem to be just sitting here do not run. I confirmed this behavior by all launch on the performance front panels.

    Is there something I'm missing here?

    You use option 0 x 40 incorrectly.   That allows you to create a pool of clones and aims to created that only once (I ran up to 10000 clones with a reference using 0x40).  If you want a clone by reference, then just use 0x80.

  • Problem on asynchronous call: façade Subvi is not pop up when it is called.

    Dear all,

    I'm new to LabVIEW, and this is the first time I try to use the asynchronous call.

    I'm using LabVIEW 2011.

    I want to build a directory for several screws, and it should enable users to open more than one of the screws at the same time pressing the buttons. Before the construction of this directory, I just tried asynchronous call allows you to call a form of VI VI, but found a big problem.

    I followed the steps described in the help file, created a strictly typed reference, set the option on 80 x because I need not return. When I run it for the first time, it worked fine: the Subvi popped up and run. Then I closed the Subvi. But for the second time and, when I run the appellant VI, the Subvi does not pop up, instead it seemed to work silently on background because when I manually opened from the file that I found running. In fact, I have found no option as "display front when it is called" of the asynchronous call.

    The appellant VI and Subvi are attached. The address of Subvi calling VI should be amended accordingly.

    What should I do to make it work correctly? Thanks a lot for any idea!

    Linjxz,

    If you have ever thought a solution via the property node, then you can ignore this response.  However the easist if not the best method practice to do what you want is to: with your PS open press ctrl + I, with an "appearance of the window" selected in the drop-down window, click Customize.  Check the box "Display front panel when called" and then the correspondent "close front after ward initially closed".  Mind you as your under VI must begin execution closed to make it work while programmaticly you can over come this obstacle.

    Looking to do more with less code.

    Mark R

  • TestStand new Thread VS LabVIEW 'Call & Forget' an asynchronous call

    Hello world

    Here is an example from the site ni.com showing how to use LabVIEW to validate a notifier TestStand.  I changed the example to adapt to the situation, I need to use it.  I have an example that works very well (when I use a new thread TestStand to start the notifier VI) and an example that does not work (when I use an asynchronous call to LabVIEW 'Call & forget' to start the notifier VI).

    I would like to understand why this does not work in the second case. The reason why I prefer the 2nd situation which currently does not work, it is that I try to eliminate all multiple threads in an outdated sequence, written by someone else a few years ago that I can't troublesoot it and update the code to make it work with the new reality of today.

    Also, to my knowledge.  I do not understand why the second strategy does not work.  The notifier of forms reference is the same thing and hadled in the same way.  I have included my example with 2 situations files in the files of distinct sequences.

    Thanks in advance to the person who will be able to enlight me.

    Nien

    Hi again,

    It is true that I don't get any errors in the sons of the "bus" error when you try to set the alert of LabVIEW system but now I noticed what is wrong. In my example that does not work, the TestStand notifier reference is a valid reference inside the "call Notifier and Forget.vi", but it became an invalid Refnum once inside the 'Notifier.vi '.

    You are right that it is not a question for the forum TestStand.  It is only associated with LabVIEW. If I run the VI "Call notifier And Forget" only using LabVIEW, I see that any reference (such as a queue reference) became an invalid Refnum once inside the 'Notifier.vi '.  It seems that it is not possible to run a valid french Refnum a node "Start Asynchronous Call.

    I'll try to get comments in the forum of labview.  Sorry to be totally off topic here

    Nien

  • Why an asynchronous call would lead to "the VI is not executable. The full development version... »

    I built a labview moderately complex program to connect with a new parser that I build.  To briefly describe the application, the main VI is a user interface which, in an initialization step, asynchronously calls a dozen other screws each called VI is a state machine that handles communication with a component specific for my parser, whether heat controllers, regulators debit, NI DAQmx channels, a SQL database, etc..  I use the VFG and/or EI to communicate information between the main VI and each component. The system works well when it passes through NI Labview 2012 SP1 (full development Version).  I build the project successfully, but when I run the construction (on the same development machine), I encounter the "the VI is not executable.  The full development of LabVIEW version is needed to correct errors"message.

    My first troubleshooting step that was supposed to isolate the problem.  I removed all the asynchronous calls, rebuilt and the program works without errors (granted, no State machines that handle I/O bundles are running). This gave me the impression that my UI screws are not the problem.

    The next step that I took was to create a test project with a simplified user interface to call asynchronously, and control a single component.  The first part, I tried to control a heating unit, and it works perfectly.  I have build it and run without errors or problems.

    Thinking that the component should not be a problem, I add the async call for this component in my main VI, to test it.  This works well in the built environment of Labview development, without errors, but alas, I get the same message as the "VI is not executable' when I try to run the build.

    I am at a loss on how to make trouble, or it could be the cause of the problem.  Why an asynchronous call to the VI even break the construction of an executable project, but don't cause problems in an executable of side projects?


  • LabVIEW executable not feasible using the asynchronous call

    Hello

    my project works very well from the source, but fails to run as an executable file. I was able to follow him to the asynchronous call of a VI.

    So far, I was able to solve the problem by using a queue dummy and loops in order to start the VI parallel to the rest of the code.

    I tried:

    1 mass recompile

    2. build the source distribution, remove existing build, create new

    3 allways include reminder all screws and all the screws called by reference via Server

    Always without success. I tried to hide the forum to find answers, but only found suggestion I already tried fail. Help, please

    So problem solved...

    Now it works.

    But I can't understand why and what was the problem.

  • Start the asynchronous call brutal Typedef Bug

    There is a nasty bug which I think is the cause of many anomalies weird I see with the events of the user, like where some get fired and if I probe the refnum of the event on a VI that was launched using the asynchronous call node start I get some weird value for reference as 8450 or 5500 instead of some great typical integer. It is not also match the value that I get when I initialize the reference. This happens only intermittently, but I can reproduce the bug that I see on a smaller scale to a certain extent. This is not exactly the same as what I see in my current project, but I guarantee you both are related. Also, I'm pretty confident that this has to do with the help of LVlibs as well.

    So... to reproduce some questions:

    Unzip the attached code and open the project

    Open Main.vi. It is hard to see because it's pink, but notice the point of constraint on the node to call asynchronous start. This is provided at this point because I have a cluster of non-typedef in the connector pane, but a TD cluster plugged into it.

    Now open AsyncCall.vi

    Drag the eventcluster.ctl of the project on the façade of the asynccall.vi

    CTRL + x on the typedef cluster that has placed you on the front panel

    Select the non-typedef cluster by clicking it

    CTRL + v to replace the TD not cluster with the cluster of TD and save

    Return to main.vi, you will notice that the point of constraint does not go far.

    Open context-sensitive help and notice that the ctrl types match, but it's as if LV does not recognize it on the beginning of the node of the asynchronous call.

    Remove the node from asynchronous start call, then replace it. The cluster to the top wire. Voila, no point of constraint.

    Second question - same result but different method to get there.

    Now that you have components of connector typedef stress points and no more because you've taken the first steps of this 'exercise', remove the EventCluster.ctl from the library and record.

    WOAH, look the points of back strain, because node call asynchronous start still referencing the typedef cluster that he thinks that should be in the library. This can be seen by removing the cluster on main.vi and then right-click on the node to call asynchronous start on the side of the connector and creating a new constant of cluster

    It is creates a greyed out of control! Why? Well, we will reopen the context-sensitive help. Whadda you know, it's always looking for the control in Bug.lvlib that no longer exists.

    Now, the question that I'll have in my complete project that I can't post and can not reproduce on a smaller scale updates the typedef causes the dot of coercion. Otherwise I can't update my typedef cluster that contains all my events without going and replacing EVERY SINGLE launch async call node EVERY time I have add a new event.

    Major problem.

    Please let me know if these steps to reproduce were not clear or you have difficulties to reproduce the problem. I use LV2013 SP1. I opened the project in 2014 to see if it has been fixed in a later version, but I saw the same thing.

    I can repro with measurements of @GregFreeman and also confirm that I saw this same issue at least since the LV2012, but they have not reported it having not been able to provide a minimum test (thanks, @GregFreeman!) scenario

    For the record, it seems that the bug here, it is the spread of type sometimes makes an incorrect assumption / optimization as to if the conpane of the start the asynchronous call node must be updated when the source changes.

    A more obvious change - say, add/remove an entry, reverse order, or change data types altogether - always seems to spread properly.

    Incorrect optimization seems to be a terminal retains the same type of database, but transforms the type definitions - or, if the type definition is re-related or related outside a library owner.

    @GregFreeman watch the bug goes from non-typedef typedef, but it's actually worse in the other direction - when a link to a missing file is maintained.

    Call the asynchronous starting node seems to maintain a list of links that is distinct from that of the VI, and this list of links separated, this is what seems to not be properly invalidated. For example, in the screenshot, I illustrated example of Greg that the node generates no error in the compiler even after parenthood and rename the Typedef...

    ... even when we "Create Constant" on this terminal incriminated with list obsolete links, we get a compilation error. Since then, the grayed out type highlighted in the contextual help cannot be found, because 'Bug.lvlib:EventCluster.ctl' no longer exists, but the list of links separated from this node was not notified:

    It is worth noting that "Bug.lvlib:EventCluster.ctl" does not appear in the list of links of the VI at this stage.

    Often, no compiler error is generated after this failure occurs and as Greg reports, you could end up with undefined behavior (e.g. suspicious Refnums and events that seem to not fire not) (and I'll add it to this list a hearty portion of DAborts with diversion total number of messages).

    In addition, you * could * receive errors of cryptic linker for generations, but maybe not (the above screenshot, you'll notice I added two builds, neither of which seems to have a problem of building). (It seems that the broken link is travel with the distribution of the source, even if 'Disconnect the definitions of Type' is selected during the build process. That is why I believe anecdotally that node maintains a list of link separately the list of VI, and it's maybe part of the problem).

    It is noted that during this refactor (de-parent and rename) all screws and control remained open and in memory and all files have been saved. No funny business where LabVIEW would be unable to update links in a file that was not in memory.

    Another note - in the original example, all source files have been unifiles, and I can add anecdotal report this bug is much more insidious when separate compiled Code is active on the source files. In this case, the source may appear to be perfect - no point of constraint, no link expired - but the code that is currently running can be broken. In other words, what you see is not what you get, which makes debugging impossible. (This bug in particular is one of the few who makes "Cache of compiled clear objects" become a normal procedure controlled throughout the application development)

    Anyway, I wanted to draw attention to this issue, given that this thread is not yet associated with a CAR and it's a serious bug that generates a behavior undefined performance caused by a fairly normal refactor now has a well-characterized small repro case.

  • How do I know if a VI is already running before calling Start Asynchronous Call?

    The new node to start the asynchronous call is great for the spawning of several instances of the reentrant vis.  However, I fell a little bit using for screws not reentrant the old practice of using the method "Run a VI" would allow us to check the Execution.State of the VI before calling the method to execute.  This way if the State was running or running at a higher level, we could spend the invoke node and just use a property node to open the front panel.  With the starting node the asynchronous call, it seems that we must use a strictly typed static VI reference, and when we open the reference VI, VI gets booked and his Execution.State = running.  So, how whether it is not only reserved by wire, but actually running before calling Start redundant?

    Moreover, the redundant beginning has an interesting behavior.  Actually, it will cause the targeted VI must be performed again after it stops.  Even if you tap the Abort button on the target VI, it run immediately still and always the same number of times as the starting node the asynchronous call is executed.  There is nothing wrong with that, and I guess the simple answer is to simply go back to the old method of "run a VI.  It's just that ability over these inputs directly to the connector pane is so nice.  Maybe missing me something obvious.  Oh, I am referring to the call and forget mode (0x80).

    Thank you

    Dan

    Maybe missing me something obvious.  Oh, I am referring to the call and forget mode (0x80).

    Yes you have forgotten that he forgets the Run method always seems to be a better choice for this mode

  • deployment of the asynchronous call

    I need deploy an executable on a computer of the client and for the first time, I need to use an asynchronous call in my program I don't know how I'm going to keep the path to the 'reference of VI Open' valid after I build and deploy the application.  The obvious way would be to use a configuration file to allow me to set the path independently of the LabVIEW Application.  However, when you include A VI in the always 'include' is not an EXE so not include a file in the folder of generation, which in fact had reference on the host computer.

    Teaching tips on how to proceed would be to very help full to learn to deploy this application

    Attached is a code snippet of how I am currently using an asynchronous call

    Thank you

    Mark R.

    That's how I always call a VI by reference.  Saw the ref static VI causes LabVIEW load this VI in memory and be able to find it by name when opened.

  • Debugging asynchronous calls

    When you use asynchronous calls, is there a way to see and/or kill the clones running? Let me explain my program a little structure.

    I develop a tests suite that can read in the test script files and run different (or the same) on several devices connected to a chassis OR modules of the AO. The two main components of my program are the CommandParserQueuer (CPQ) and the CommandExecutor (CE marking). A command queue is created during initialization. The CPQ reads in the script files and translated into commands adds those to the queue of the command. The controls are beams of the States of the enum and all data needed to perform this action. The CE marking is a machine of the State in queue. When queues begin to fill, the CE removes the items and perform the actions (e.g. AO tension adjustment, read data from the device, restart the device, etc.).

    Program to quit smoking, a stop command is sent to the EC, which simply sets the while loop stop true and it allows to get out. This worked well until I implemented the ability to run several tests at once, which meant from multiple instances of THIS Start Asychronous Call (options x 80 and x 40).

    Because of my design, I have to run a while loop inside the asynchronous calls, that goes against the recommended practice of not doing. During initialization, I create a command queue for each connected device. For example, if I have two devices DEVICE1, and 2 the device, two queues are created with these names and two these are called by reference to these queues. CES sitting then slowed until the queues fill up with items.

    The problem I have is that sometimes, but not always, blocks of code inside the CES are throwing errors, and also the CES not arrested in accordance with the instructions. I'm out all together of LabView. I also want to emphasize enforcement of clones. Is this possible?

    Any thoughts?

    During an instance multi-instance has a several traps.  You seem to have sailed with success some of them, but not all.  As Jed394 said, the framework of the actor should help with start and stop, but it looks like that your error is more due to a conflict of shared resource.  This resource conflict could be a hardware or software.  A few things to look for:

    1. Is the code that you share between reentrant CES?  It must all be, but nothing waiting for something (i.e. awaiting a DAQ card data) must be re-entrant, so that the two separate these may have their own instance.  There is a balance here between using a lot of memory and the contention on subVIs.
    2. You can try to use two items from the same material that cannot be used separately.  For example, you can not simultaneous, of two locations of code, read different analog inputs of the DAQ card even.  This can be quite hard to track down, since the hardware devices vary in their capabilities.
    3. Is that what your truly separate data space between your bodies?  Depending on how you configure access to data, the two CBS could try to access the same or incorrect data.

    Good luck.  Let us know if we can help you more.

  • Asynchronous call still slow down the main VI

    Hello!

    I currently have a 'main VI' quick process underway, and I have a Subvi, which is essentially a device data collection. However, this Subvi works at 1 Hz, while my main VI runs a lot faster.

    I created an asynchronous call to the Subvi and set it such that the hand is not expected to incoming data. I followed these very simple instructions: http://zone.ni.com/reference/en-XX/help/371361L-01/lvhowto/acbr_call_and_forget/

    However, when I run the present, my main VI is as slow as if I did not use an asynchronous call. For your information, the only node inside my main while loop is the node "Start Asynchronous Call.

    Is there something I'm missing about how works this Subvi without slowing down my main VI?

    Thank you very much!

    I guess that your main problem is that the DLL calls are set to run in the user interface thread.  This could prevent your main VI to update until the end of this call to the DLL.  Try to set their 'Run in any thread.

    In addition, there is no need keep saying this VI to run over and over again.  He needs is called only once.

  • An asynchronous call - why so long?

    LV 2013, Win7

    I have a window that comes and goes, during the operation of the program.

    This window has 72 sub-panels, each containing a retractable VI even copy for a "block".  I insert the VI in the secondary and then to run the VI with a call CALL and FORGET.

    When the user closed the window, the entire block live end, and the window closes.  I don't care if the closing backstage going again after the window disappears.

    But when the user leaves the program, with this window to the top, I need to make sure that the block screws have completed before I stop other things (close files, etc.).

    To this end, I changed the CALL and FORGET a CALL and operation COLLECT and installed a WAIT on ASYNCHRONOUS CALL to each instance at the end of the code window.  It is after the blocks have been ordered to die (via an event).

    I see the debug file (a part is represented) to about 1000 milliseconds to wait for all instances to die.

    The thing is, if I change to "0" to "1000", then what I expected, it is that the actual waiting time would< 100="">

    My thought is that during this timed wait blocks could die anyway, it would take less time to actually wait on them.

    But when I do that, nothing really changes.  Registered time is always above 1000 mSec.

    If I limit the number of blocks to 12, the time is 97 mSec, to 24, is 185, for 36, is 576 and so on - it is proportional to number of blocks.

    So, what is really?  If he waits just things die, why the timed wait does not affect the numbers?

    I initially (when I used CALL and FORGET) kept track of how many were opened and how much were closed and waited for that becomes zero, but it is a cleaner way to do it, at least in theory.

    Am I missing something?

    You can consider another approach to ensure that all instances of high school left, as a queue. Each instance is an element in the queue when it ends, then stops. Your cleanup code removes the elements in a loop For which runs once for each instance, so after each instance is finished he can proceed. This way to care not in the ORDER in which the sub-panels out, you simply confirm that they have completed all. Should be lower overload that call & collect.

  • Using asynchronous calls in a while loop. How 'Skip' node and only retrieve data as it is treated

    Maybe I'm not understand asynchronous calls... but I thought I should be able to call one another VI and essentially 'jump' it is the node and only receive data as the called VI treats.  In other words, similar to the Run of VI, I can wire a wait until done? with a fake and the main VI will not wait for the other VI end of race.  The main VI continues to function, and when it passes the called node of the VI, it will receive data if it happens to be there.

    How can I call a VI in a while loop and do not wait so he could spit out the results?  Data flow is my enemy on this one...

    The first VI treats its own figures (using the iteration count) and displays them on the PC.  Other indicators are the data of the called VI.  I want to be able to work around the blue circle node and receive data only that it will be available.

    Any help is appreciated.  Thank you.

    What I said OR the 'Start asynchronous call' is the preferred method for starting background tasks. This call is usually used to run background tasks. For example, you have a process of journal. When your application starts it would use the "asynchronous call Start" to start the process of journal and then move on to the other stuf. The process of the journal would then happily run in the background and the main application is free to do other things. Of course when implementing these types of systems you need a way to coordinate things like exit. This is where the queues and stuff come it.

  • How to stop an asynchronous call to activex makes a VI?

    I use Labview 8.6 to collect data of monkeys hand movement. Because some graphics are necessary, I do use Visual c# express edition to program graphics and appeal that the VI using ActiveX from my c# code. I use three VI, which two I call synchronously (I'm waiting for the call ends). But the third VI must be called asynchronously so that I can continue my work in c#. This VI extracts data from the accelerometer via DAQ and exported in a file of measure LV in a while loop.

    I start the asynchronous call by VI.run (true) where true indicates that I don't want to wait for the call. Now when a trial is over (Monkey Gets a visual cue, then works correctly ends) and I have to stop collecting data. I have one of the following two ways to stop the VI.

    (1) make an abandonment by using vi.abort (), but this means residue data collected by DAQ not written to the file of measures.

    (2) set the button stop in the false via VI VI. SetControlValue(). In this case, the VI does not stop immediately, it takes a LONG (1.5 to 2.5 s) time to stop. I tested that it takes a long time to stop running the VI using Labview without using c#.

    Note that as soon as I stop my VI, in the file lvm I want to write c# 'trial closed' to differentiate between successive trials data. I don't want to create new lvm for each test file (there will be some 300 of them), so I add data in the same file. In the case of 2), I don't have a VI.isRunning () to see if it stopped running. I can sleep() in my c# code for a second or two and then add 'the trial ended' file lvm but all of this is in real time that happens and I can't sleep that long.

    Now my problem is that the two options are not good for me. Is there a better way that someone can suggest? "And why does do so for the VI to stop if I use 2)? Is there anything I can do about it? Thanks in advance.


  • Asynchronous call to Oracle 11 g

    Thank you in advance.

    I have two questions:

    1. how to asynchronously call a pl/sql for Oracle 11 g?

    2. What is asynchronous call compared to the synchronous call?

    Best regards, ib

    To clear my problems, I develop the program using the form of Oracle and my colleague suggest me to perform all of the procedures of my as a job because he thinks that by doing this, just in case the network is broken, the procedure is still running in the server and the user can also do another job so that the background task.

    Whether to work or not depends on what work needs to be done.

    All code runs in the server, and even if the connection is lost, the code will continue to run until the server needs to communicate with the client and finds that the customer is gone. What happens then depends on the client and how the connection was lost.

    I'm still in doubt that I'm working on the bulky data and looking at the code above it is a call to sleep() method which can be a performance issue.

    Who said that you should use this code? This code appears as an attempt to wait until these two work is carried out. Why would you do that? If you want to wait just run the code in a procedure. It does not return until the procedure is performed.

Maybe you are looking for

  • Linux 64-bit upgrade 31.5.3 esr always reports 31.5.2

    I've updated my 64bits (SUSE Linux 11.4) to 31.5.3, esr using the root account, it succeeded.But when he works under my normal user account, he reports again that it is 31.5.2, resulting nagging continues to upgrade.

  • color issues - please help

    I have a photosmart c6280.  I got it since early September.  I am very very disappointed with it.  the image quality is terrible.  with the setting up, it's even worse when it is set to automatic.  the prints are very washed-out, with spots on them.

  • Need facilities for Satellite A100 WXP CD

    Hello When I bought my Toshiba A100 last year it did not come with an installation cd, now I want to rebuild my laptop to get all this allowed to go out and run fast. How to get a Windows XP Professional cd that will work with the cd key on the under

  • Updates of patches and downloads for windows xp that took place after the release of sp3

    Is there or will there be any type of packs of update that I can incorporate into my windows xp pro sp3 install cd using nlite [or not] would make it easier to keep my system up to date when I Custom installed my system? I know that there is a very e

  • Cannot change the date or time.

    I go to control panel or click on the time in the lower right corner, and then click change date/time.  I then click on the month (September) and scroll down to July and click on apply.  It remains July for a split second, then changes again in Septe