What is the best way to run multiple instances of the class containing infinite while loop?

Hello

I have a several instances of the class (say a, b, c,...) that have the same parent and I want to run the same methods overridden to all instances in parallel.

For example:

a.init ()-> a.run ()-> a.stop ()-> a.run ()-> a.stop ()->

b.init ()-> b.run ()-> b.stop ()->->->

c.init() ->           ->             -> c.run() ->               -> c.stop()

...

See the attachment for more details.

The problems are now:

1. the 'run' - method does not return until it receives the external trigger

2. everything to run methods return in a different time

1 chip means I can't use autoindexed for loop because in this case b.run () will have to wait before the end of a.run (), right? Is it possible to run to the loop in parallel?

2 chip means that an object must be able to run and stop independently from others.

What is the most elegant solution? The solution copy - paste in the attachment works for 3 instances, but there are currently 10 and more is coming.

Juha

In fact, what I wanted to know was "how to add the 'P' loop '... Easy, after you ask the right question.

In the attachment, there is a test.vi that has two numerical indicators in a certain time-infinite loops. If I leave the parallelism, the two digital are incremented infinitely. If I don't allow parallelism, only the first is incremented (he never leaves the infinite while loop).

To solve my original problem, I can make an init-start-stop branch within a loop-parallel-indexing for and make sure that there are the same number of instances of loop as there are objects in my array of objects (object array is an autoindexed in the loop for).

Also good point about the vis environment. I should also add that.

Tags: NI Software

Similar Questions

  • What is the best way to run the report of jasper in the ADF Applications?

    Mr President.

    What is the best way to run the report of jasper in the ADF Applications?

    Concerning

    Tender Hello,

    Check out these links

    Sameh Nassar: Using Jasper report in Application of ADF (detailed)

    https://www.YouTube.com/watch?v=ezX0gdLIhs0

  • Best way to run a script from a script

    Hello world

    I'm looking for running a script from an After Effects script, so far, there is aftereffects.executeScript (scriptContent) who use eval to run the script. The problem is that it uses eval so it is not really sure and he is slower. So I would like to know what is actually used when we file-> Script-> Run script file.

    As seen in the Javascript tool Guide CC page 168 in the section QAnywhere Corss-DOM.

    aftereffects.executeScript(theScriptContent); // Doesn't work with a script which as comments AND the script has access to my scope
    

    In addition, if there are comments like / * * / or / * / in the script I want to run, it no longer works.

    So, what is the best way to run a script from a script?

    If you want to evaluate a whole script file, you can use $.evalFile (file, timeout) - see description in ESTK object model viewer

    To evaluate a bit of code, you can use eval, that's for sure.

    Xavier

  • running multiple instances of VBAI does not work

    Hello everyone,

    We are 4 common examples of VBAI at the same time. Recently, he had to copy it (because production is doubly).

    With our first system, we have no problems when you try to run multiple instances of VBAI. This time, however, it does not.

    Our system:

    • 4 cams: Allied Manta 201

    • camera is triggered (rising edge) separately, but almost simultaneously.

    • Four port NIC (with the right driver :-))

    • 4 ports and our on-noard port are bridged.

    • computer: intel I5 (4 cores)

    • License to run Vision Builder 2012.

    • Programmed with Vision Builder HAVE 2012.

    • Interface programmed in c# (receives images of the relevant info 4 programs and displays on the screen).

    Action taken:

    • Test with our program that opens 4 instances of VBAI. Result: 1 single instance opens.

    • Removed our bridge a connected our cams on a switch. Result: 1 single instance opens.

    • Open VBAI 4 VBAI-programs directly (but separately). Result: Each program opens and is fully working.

    • Open 2 programs at the same time (with VBAI). Result: Fist opens and is equipped with the work. At the opening of the second program, that we get error messages saying that it is not possible to connect with our camera.

    • The test above was created with:

      1. The cam connected to our network card 4 ports.

      2. The cam connected through a switch.

    • I have also written 4 simple programs (just enter a period followed by image)

    • With these programs, I tried the above test (VBAI 2 hours and run both programs at the same time). Same problem: 1programs starts, the error messages when opening a second program.

    I have the impression that it's a network problem, but what bothers me is that, when the bridge, I don't see a difference with our another computer that works on our original assemblyline. When you work on a referral that our parameters are the same as on a computer that does not have a network card 4 ports. The computer (and liked)) allows us to run multiple instances.

    Any thoughts?

    Any help would be greatly appreciated. I'm sure I'm missing something obvious here, but I don't really see.

    If you need more information about something, let me know.

    With sincere friendships.
    Tom Declercq


  • Update loop under Vi of hand / run multiple Instances

    Hey everybody,

    If I want to keep my code as modular as possible so that I can see any sub or VI.

    One of the SUB vi is permanently offices incase another output is detected. I don't want to make this mark on the main level because I don't want a huge loop in my main.vi and you won't worry about sending shift register valuse to my Subvi for him to function.

    Essentially, I have designed this subroutine Vi and am now trying to constantly be driven from a main.vi

    This hand is simply.

    Cluster of entry--> Sub VI

    Void VI retains a loop waiting for a change request action. Unfortuantely when I change the vale in main.vi the avlues in Subvi don't update. I guess that makes sense, in C, for example when you call Returns you need to wait until the end of the function call to update. Yet, as Labview is so strongly focused on taking SUB vi to do almost everything for you, I can't imagine labview is not able to update these values. I looked around and the answer seems to be global variables. I really don't want to use the because my application will become very big, but I'll use them if I need to.

    Unforunately, when I tried to use my global variable thing, it didn't work.

    1. global Var = Cluster

    2. it's in the Subvi both the main VI.

    3. when I run my code the global variable is not up-to-date on both front sides when I change one of them. I'm doing something wrong?

    A few comments.

    • You have not included the global variable
    • If you want to run multiple instances of the Subvi in parallel, it must be reentrant.
    • As the Subvi is interactive, it must be configured to display the front panel when it is called, otherwise there is no way to stop it ever.
    • All your time loops needed little expects. They have no need to turn as fast as the CPU allows, all other processes of hunger.
    • "Go to under control" is extremely complex and crawling with weird stuff like an ant farm.
      • The shift register must be initialized to avoid surprises (but you probably don't have it all)
      • Your loop runs one time too many.
      • Avoid the stress points, such as the structure of the case.
      • You can replace this whole thing with for example a table of threshold, no need to loop. (see image below).

    Good luck!

  • Running multiple instances of Flash IDE CS (6)

    I have a build machine compile my fla files by running Flash.exe command line and providing a JSFL file as a parameter. I want to run multiple instances of the IDE Flash to enable simultaneous generations on this machine otherwise it only one thread running on a build machine that is a waste of resources.

    So, is it possible to run multiple instances of the Flash IDE? Perhaps there is some sort of command line? I have Flash CS6, but there should not be a lot of differences with CC, isn't it?

    I don't think that you can run multiple instances of flash CS6 and CC.

    -Reynaud

  • storage of the data output of while loop

    Hello

    I have a data acquisition system set up to read the couple of a transducer. The output needs to be fed with an excel document, once the program stops running, or when a key is pressed.

    with the current code attached, the excel document is created, but it only shows the most recent series of data. How to make the table to store all the data coming from while loop?

    Ive only been programming with labview for two weeks, so chances are that it is something simple, but please help us in any case.

    JM

    To get what you expect, the Terminal output of table a while loop right click and select the option activate Indexing. Usually if you want to save data use queue to pass data inside the while loop to another loop/VI and perform data recording. For all that you have examples, please do a searc in LabVIEW help > find examples.

  • What is the best way to select multiple tracks?

    So, imagine that you have a sequence like this:

    Unselected.png

    And you want to accomplish the following selection:

    Selected.png

    What is the best way to do that has no shift + selection 12 times? I had FCP where I could click the top left and then shift + click on the lower right and get a selection of range in this way. But obviously it works differently in first. If I wanted to include A5 - 7 in the selection, I could do just a selection rectangle, but someone at - it a convenient way to select several clips landlocked like that?

    The fastest way I can think to do is to temporarily make the slightly shorter left selected top clip so that it has an ATM next to him, then use your mouse to drag and drop around all clips. You must again extend the left top clip again after the fact. Alternatively, you could catch the entire section, then shift select the ones that you don't need. In addition, shift-make drag a marquee selection that includes selected clips deselects them.

    See: work with items in a Premiere Pro sequence

  • What is the best way to run two concurrent programs using the output of either executing the other?

    I wanted to just kind of get a notice of some people here. I have two main screws the first is a data acquisition system that displays 99 different sensors and which feeds on these data in a table. The second is a real-time processing system that is designed to take the painting and do many calculations. The two output data from screw at the front that I want to see, so I don't want to use just as a Subvi.

    Is there a simple way to run two screws, using the output of the data acquisition system to power the processor so that you can easily see the signs before two screws? I had thought to simply copy the code from the processor in real-time in the DAQ VI, but I fear that the VI resulting will be very large and unsightly.

    On a side note, I'm more thinking about this? I apologize if this is a stupid question, it has been a long week... aaaand it's Wednesday.

    Look at the Architecture of producer/consumer.  It will be a good starting point, even if you find that you need to change.  When performing data acquisition and processing of tasks in parallel loops, they can both run simultaneously.  Both can feed data to the main draw of the VI.

    I'd probably use three loops with the third being the user interface only.  All that must be displayed to the user is sent to the GUI of the acquisition of data or processing loop loops and commands or entered by users are returned in these loops, probably through queues.  The wall of the VI of data acquisition and processing VI are never displayed to the user.  Especially the treatment, because it runs on a system in real-time, should avoid synchronization issues that can present a graphical interface.

    Lynn

  • What is the best way to run DAQ in larger system?

    I have a relatively simple installation of the PXI hardware require software in real time to perform data acquisition and to provide feedback to the user.  Somewhere on the order of discrete outputs 150, 55 entered discrete, some analog, etc...  My question is this: does anyone know of a white paper, etc., which describes the best way to the acquisition of configuration data?  For example, is it better to put all the discrete outputs on a single task and manage state in memory (150 items Boolean) before writing to DAQmx, or is there some advantage at the time of the execution/memory to open a task for each channel and individually each signal.  The driver even allow me to do this?

    Synchronization is not a concern, is pilot crashes, so I would like to get the best performance out of DAQmx.

    If someone has explored this?

    Dan

    Hi Dan,.

    To optimize your application, you'll want to create tasks as little as possible.  When you create a task, you ask for all the parameters of this task (which would be like doing 150 calls to the hardware).  The extent of the GB whitepapers - you can find useful this webcast .  For example, some of your concerns are addressed low toware of this FAQ document.  Hope this helps, let me know if you need something more specific.  Have a great day!

  • The best way to channel multiple steps using NI USB 6009?

    I'm new to labview and I am trying to acquire multiple voltages of several channels and spread them out on a chart. It seems impossible to do it at the same time since the NI USB 6009 has only one pair of ADC.

    The only way I ever came with is to use daq assistant to support significant tensions one by one and then make it loop awhile, but y at - it any delay during the move between channels?

    And there at - it of best ways to acquire data from multiple channels?

    If you have specified multiple channels (i.e. Dev1 / ai0:ai3) with a single DAQ Assistant, then this is the right method. The inexpensive device has no simultaneous inputs, so you will have to live with the slight delay of channel inter.

  • Best way to run a LabVIEW VI, written for Windows in a MAC OSx environment

    I've written a VI in LabVIEW 8.6 Windows XP and it compiled into a .exe.  Now, I want you to run this executable on a MAC OS x computer.  What is the best way to do this without having to buy a LabVIEW for MAC license or machine virtual Windows for MAC software?

    Thank you

    CJL

    CJL,

    Yes, that should run.   Except... Your show is there any material?  To use all the functions that are specific to Windows (from the platform folder)? It relies on a video driver specific or sound card? It relies on mouse right click action?  All these kinds of things may or may not work because they are closely linked in the Windows operating system and the underlying hardware.  While the software itself will problaby execute, the programmay does not work as expected if some of these dependencies are handled differently by the Apple hardware.

    I have not used VM but native running under Bootcamp works fairly well, again allowing the issues mentioned above.

    Lynn

  • Best way to manage multiple windows help

    Hi all:

    I work with X 5 to create help for a large modular application. I have a single aid project, but want to deliver content for help only for the specific modules used by clients. I am attemtping to create multiple windows help with a window main containing helps for deliverables standard and other windows containing help for specific modules. What is the best way to achieve this using a single project. Or do I have to maintain several projects?

    I tried to use custom windows, but there are some limitations. I created a new file for a custom hhc window manually and it works fine. But I can't open the custom window by clicking on a book in the table of contents (which are what I want) the main window, but can do so by clicking on a subject. Also, I can't assign topics by separate default for each custom window. In addition, when I click a hyperlink in a custom window that links to a topic in the main window, the theme of the main window display in the custom window but it is not in the table of contents of the custom window, it's awkward.

    Help, please!
    Romeo Coutinho

    From the point of view of the user a merged set of help files is probably the best solution. Use global windows of the comprehensive help system is displayed in a window and displays only the topics for modules installed (if you can get your installation meets your wishes people that is ;-)).

    Several projects handling is more complicated to manage a large. Each help topic only stops in a single project; If you want to create or update the help for the XYZ_1 module, you open the project XYZ_1. If you want to change something in the master project, you open the master project. After the edition of a project, you simply compile this module and nothing else.

    The only thing you need to learn are the peculiarities of the help compiler about merged projects. See http://www.helpware.net/htmlhelp/how_to_merge.htm for a good description of these folds.

    -Dirk Bock

  • Can VMware Player run multiple instances of the same VM?

    I looked around but could find an answer to this question. If it has already been answered, please feel free to point me to that answer. I am relatively new to VMware Player, so this may seem like a stupid question. Please bear with me.

    I've been running Linux in a virtual machine using VMware Player 5.0.2 on Win7 and I would like to start another instance of the same virtual machine, simultaneously. When I try to launch the image once again, VMware asks if I want to take possession of the virtual machine running, but does not give the opportunity to start another instance.

    Is it because it is not possible to run two instances of the same VM, or y at - it another way to get there?

    Welcome to the community,

    This can be done. If another instance would be allowed to use the same file system, the guest operating system would be very likely corrupt the file system. What is possible - at least with VMware Workstation - is to create clones related, where the Basic virtual disk is the same (open in read-only mode), but writes go to independent virtual disk files.

    André

  • How can I update the values out of while loop

    The LabView waveform chart updates every 0.1 sec.

    When a user clicks on a button, I want to LabVIEW to wait 5 sec and beep for 5 sec.

    Meanwhile, it should be to update permanently the wavefrorm graph.

    When I have the structure case inside the while loop, it interferes with the updates of the waveform graph.

    When I structure case outside the while loop, the structure of the case is never executed.

    What can I do?

    I thought about it using the example of design of producer/consumer model.

    http://decibel.NI.com/content/docs/doc-5404

    It allows a variable that is updated in a while loop to update outside the while loop while the loop is running.

Maybe you are looking for

  • Cannot log on to the Web site

    I can not connect in my PayPal site. I already uninstalled and re-installed the app from PayPal and Firefox. What is the problem?

  • Can I leave my family Plan and then go back to it, shortly after?

    I want to buy something on my account with my gift card, but in order for my buy the app to "master account" my father, he gets charged. I just want the plan just to buy it and then quickly join it.

  • Satellite A200 motherboard k00015480: what caught cpu supported

    My Satellite A200 motherboard broke down and I tried a repair...I got a motherboard (k00015480) equipped with Jack mPGA479 and Intel chipset 945GM/pm. I can't know which CPU installed!I tried Intel CPU: T5500 T2300 T2400 T1300 Mobile 440, seems to wo

  • I can't seem to ever send a video message

    I get the red exclamation point / Oops, something went wrong. / Please try again or contact us if you need assistance. Message. of course, it is impossible to get help so nobody knows what they mean by help and why my video works fine, but I am not a

  • How can I restore CALENDAR which has disappeared from the iPhone 5 s?

    iPhone 5 s, model ME345LL/A.    iOS 9.2 Have used this phone nearly 2 years without incident. Today my Apple's CALENDAR is not visible on the phone. (It's OK on iMac and iPadMini) CALENDAR is NOT in all groups of application on the phone.  Very weird