UserEvents to communicate between subVIs and a main VI

Follow-up to http://forums.ni.com/t5/LabVIEW/2-parallel-state-machine/m-p/3247857#M946309

You want to start 2 parallel state machines. It was suggested to use UserEvents

Mainvi:

Subvi:

I have 2 questions:

1)

Am I right in when is to say that I can place my machine of the State in the Subvi instead of the random generator and waveform table?

2)

How to start Subvi with arguments?

Michael.Koppelgaard wrote:

Follow-up to http://forums.ni.com/t5/LabVIEW/2-parallel-state-machine/m-p/3247857#M946309

You want to start 2 parallel state machines. It was suggested to use UserEvents

I have 2 questions:

1)

Am I right in when is to say that I can place my machine of the State in the Subvi instead of the random generator and waveform table?

Yes, a way if you create your state machine using a shift register (with Enum or string) located on the while loop around the structure of the event. Note that the time-out period of the structure of the event that creates random numbers at certain intervals. You may have your DAQ here. Of course, there are other options, such as the use of two parallel loops in the Subvi, the top loop only for the GUI and dynamic events, and lower node would make data acquisition and even hold the state machine logic...

2)

How to start Subvi with arguments?

Also have a look at how I did in my example project: I call the Subvi with two arguments: an ID (digital U32) and the cluster typdef holding the UserEvents references. Easy to create another entry point for this sub - VI, as a cluster that could contain several parameters (as parameters DAQ, ports COM, device ID, etc...). After you change this Subvi, remember to update 'Type specifier VI refnum (for type only). You can right click on this object and browse your set up-to-date the Subvi, so the new input terminal "appears" on the icon 'start the asynchronous call.

EDIT: start designing your state machine in the Subvi and later, after your VI in order to comment and you help if you need.

Tags: NI Software

Similar Questions

  • How can I communicate between MUSE and animate CC OEM element?

    Hi all

    Please let me know how can I call the Muse javascript function (written using the object > option Insert HTML code) by a click of a button.

    This button has been designed and coded using CC animate and its OEM file has been imported in MUSE.

    Basically, I'm looking for a solution communicate between MUSE and OEM, and vice versa.

    Help, please!

    Thank you

    AshishK

    There is no adequate way to do file OAM control over site of muse. In fact, even a simple button OAM is a html document independent, which has a head, body and its own scripts and html code. OAM - is a site within your site are located in an iframe. This format is used for banners and animations for beauty, but not for the features. If you need the functionality, you must export your animation in html and javascript, disassemble the part code and integrate the muse - something on your mind, in the body. And of course, you have to understand with in the code. But even for a experienced, coders this approach would be absurd. It is easier to make a simple button in cssto integrate this a whopper for the site, which would create a disproportionate burden

  • How to communicate between JSP and jsf/jspx/managed bean using ADF11gR2

    Hello

    Scenario1.

    I use Jdeveloper 11 g R2, I am developing an application in the ADF. In our application, we implement of payment gateway.
    Application of the ADF, we call payment gateway.
    inside the payment2.jspx
    ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
    * < af:commandButton text = "#{res ['makepayment_2.totalpaymentthroughknet ']}" id = "cb1" action = "#{makePayment2.callPaymentGatway}" / > * "
    ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
    PaymentGatwayManagebean Method callPaymentGatway()
    public void callPaymentGatway() {
    > System.out.println ("Hi callKnetMethod method called");}
    > String payUrl, payId = null;
    > HashMap hm = new HashMap();
    > HttpServletRequest request = (HttpServletRequest) (JSFUtils.getFacesContext ()) .getExternalContext () .getRequest ();
    > logger.info ("-> callKnetMethod method called");
    > hm = KnetUtils.knetInitialize ("1", "2", "3", "4", "5", "6", "7");
    > payUrl = (String) hm.get ("PayUrl");
    > payId = (String) hm.get ("PayId");
    > request.setAttribute ("knetRedirect", "true");
    > try {}
    > KnetUtils.knetPay (payUrl, payId);
    >} catch (Exception e) {}
    > e.printStackTrace ();
    {>}
    }
    the above method called Paymentgateway after response from gateway payment successful return transaction with some data as the id of the transaction, the name of the Bank, amount, train etc. all data by adding to the URL
    Exodus http://192.168.102.41:7101/amificweb/faces/ami/repback.jsp?paymentId="+paymentId+"& result ="+ result +"& auth ="+ auth +"& ref ="+ ref +"& postdate ="+ post +"& trackid ="+ trackid +"& amp; tranid = "+ tranid + ' & udf1 =" + udf1 + ' & udf2 = ' + udf2 + ' & udf3 = "+ udf3 +" & udf4 = "+ udf4 +" & udf5 = "+ udf5;

    *Current repback.jsp page*
    --------------------------------------------------------------------------------------------------------------------------------------------------------------------------
    < %
    Payment gateway data take into repback.jsp
    > String paymentId = request.getParameter("paymentid");
    > String ErrorNo = request.getParameter("Error");
    > String udf1 = request.getParameter("udf1");
    > string udf2 = request.getParameter("udf2");
    > string udf3 = request.getParameter("udf3");
    > string udf4 = request.getParameter("udf4");
    > string udf5 = request.getParameter("udf5");
    > System.out.println (request.getParameter("result").toString ());
    > if (request.getParameter("result").equalsIgnoreCase ("CAPTURED")) {}
    > result = request.getParameter("result");
    > are later = request.getParameter ("postdate");
    > tranid = request.getParameter("tranid");
    > auth = request.getParameter("auth");
    > trackid = request.getParameter("trackid");
    > Ref = request.getParameter("ref");
    >
    > out.println ("REDIRECT = http://192.168.102.41:7101/amificweb/faces/ami/*voucherPrinting1.jsp*?paymentId="+paymentId+ "& result =" + result + "& auth =" + auth + "& > Ref =" + ref + "& > postdatent =" + postdatent + "& trackid =" + trackid + "& tranid =" + tranid + "& udf1 =" + udf1 + "& udf2 =" + udf2 + "& udf3 =" + udf3 + "& udf4 =" + udf4 + "& udf5 =" + udf5 "); {
    } else if (request.getParameter("result").equalsIgnoreCase ("CANCELED")) {
    > result = request.getParameter("result");}
    >
    out.println ("REDIRECT =http://192.168.102.41:7101/amificweb/faces/ami/Error1.jsp?paymentId=" + paymentId + "& result =" + result + "& ErrorText =" + ErrorText);
    >}
    > % >
    -
    In the present scenario I can redirect from repack.jsp to voucherPrinting1.jsp and I can take all of the data in the jsp page.

    But I want all the data * CallPaymentGatwayManagebean * method, how can I do. ?

    How communication between jsp and jsf, jsff, jspx, managedbean?



    Maroof

    You must save the config.xml file adfc bean in the scope of the request this ways you can call the method any page bean.

    Also have you tried using the pages in a taskflow with jspx and saving the bean in the taskflow which is a better approach?

  • How to communicate between ExtendScript and basic generator

    I run a separate node server as described in this tutorial to create a plugin with generator-core. http://tomkrcha.com/?p=3896

    I'm in a situation where I need to send a lot of JS to photoshop via generator.evaluateJSXString (). But it can easily become uncontrollable that you can send a string. So, for any complicated feature, it becomes difficult to maintain. Is it possible set a bunch of functions in a script to measure file and then call these functions from the application node?

    So I could send:

    generator.evaluateJSXString ('doSomeStuff ()');

    And in a script somewhere (I don't know where this script should go)

    I have the defined function that can do something

    function doSomeStuff() {}

    for (var i = 0; i < 10; i ++) {}

    doc.artLayers.add ();

    }

    }

    Where the Script to extend file would in this case? OR is there a better way to make this kind of thing.

    Just a mixed collection of thoughts:

    • Yes, you can package scripts in the form of .jsx files (also jsxbin if you prefer not to share the source) and run with generator.evaluateJSXFile (path), which will work even in ESTK. It has some limitations

      • It is just a file that runs, that is not this function 'call '. I managed this by dividing my Javascript libraries and plugins (= this a function). Can I use Gulp to concatenate libraries necessary for each plugin to create scripts of jsx 20 + that I call the two panels of node & Photoshop
      • There is no parameter passing, but it can be overcome by the presence of a script (that you run a string) parameter store (or fetch result) to Photoshop as a descriptor of persistent custom action
    • The plugin folder where your main.js is accessible by Node.js variable '__dirname '.
    • Depending on how you use paths, you should consider Windows "------" vs. Mac ' / '.
    • Another good way of communication between the panels of Photoshop and the node is a Web server in the configuration node and use Ajax/jQuery in Panel of Photoshop. You can do ~ 500ms update on election and get feedback from Panel pretty real time.
  • How to connect and communicate between PXI1031 and PLC Controllogix?

    I would like to know how to develop communication between the CAP/PXI with PLC, using the Ethernet switch.

    What is the add-on hardware or software necessary?

    I found some useful information through a video:

    http://zone.NI.com/WV/app/doc/p/ID/WV-11/nextonly/y

    Please do not hesitate to give your suggestions and any other information or thing for the same experience.

  • I can communicate between PC and cRIO throughout the series?

    I'm new to the compactRIO. I have a lot of experience with the old Fieldpoint hardware. I understand that they are essentially diffeentliy. The RIO has its own processor and can run stand-alone programs. The Fieldpoint was really just IO for a PC.

    I'm trying to communcate with my RIO (OR cRIO-9074) on the serial port. Is this possible as on the Fieldpoint? Or is the serial port on the chassis of RIO just for interfacing to a different serial device? I'd rather do not to use the ethernet port if possible.

    Hey tir38!

    You can make a serial between devices using the serial port on the chassis of the cRIO. The port is usually referred to as COM1 on the chassis and you can program using the Standard Serial VI (VISA VISA Read.vi, Write.vi, etc.). That being said, you don't have to have a VI running on the target to manage this communication. But when it comes to code to the target deployment and configuration of the target through MAX, you must use an ethernet cable.

    I hope that solves your problem!

  • Communication between LabVIEW and MCU based on Modbus Protocol

    Hello

    I am a first year student in the port.and series applications see you, my projiect needs to communicate between LV and MCU based on Modbus Protocol.all configure it are correct, but the lv to send false information which is not suitable for modbus.i do not know how to fix it.

    My programs are:

    Why did you decide to write your own code instead of what is already available? If you had done a search, you would have easily found the modbus library. Just give a try.

  • How to communicate between AEGPs?

    Hi all

    Is it possible to communicate between AEGPs? I know that by adding more, we can communicate between effect and ECAP. We can also communicate between AEGPs with the Suite?

    Thank you and best regards,

    Dheeraj

    Yes, a custom suite is the way to go.

    Wait with the help of the suite after you are sure al the AEGPs loaded, otherwise you can try to use the suite before it has been set.

    you do not have this problem using a suite in an effect because AE loads AEGPs first, and then only the effects.

    the first call of idle would be a good time to load more.

  • How can I remove the black space between the title and the main section of the screen?

    Hello

    I'm a black space between the title and the main screen. I don't want this space.

    How can I remove this space?

    Please help as soon as possible?

    http://www.BlackBerry.com/knowledgecenterpublic/livelink.exe/fetch/2000/348583/800332/800505/800508/...

  • What is the main difference between IMPORT AND EXPORT

    What is the main difference between IMPORT AND EXPORT using Toad in the production site

    EXP FILE = E:\A\ABC USERNAME/PASSWORD@DATABASENAME. DMP (LOCATION. JOURNAL OF DMP) = E:\A\ABC. (LOCATION. NEWSPAPER OWNER) = USERNAME GRANTS = STATISTICS N = COMPLIANT NONE = Y

    FILE USERNAME/PASSWORD@DATABASENAME EXP = LOCATION. JOURNAL OF DMP = LOCATION. JOURNAL FROMUSER = USERNAME = USERNAME GRANTS TOUSER = STATISTICS = NONE N IGNORE = Y

  • Communicate between extension html and c ++ plugin

    Hi all

    I'm developing an extension html for InDesign CC2014. There is a scenario where I need to communicate between the extension and the C++ InDesign plugin.

    I followed the instructions at http://wwwimages.adobe.com/content/dam/Adobe/en/devnet/cs-extension-builder/pdfs/CC_Extens ion_SDK.pdf and wrote on the extension of the code part. The part c ++ code has not changed since the Flex versions, so no problems there.

    I tried to call the extension of the plugin and it worked. I recorded an event in the plugin to listen to and sent another event of the plugin. But the Committee does not seem to listen to or distribute any type of event. On the part c ++ plugin, the error of registration codes and send returned were codes of success, so the problem is not with the plugin.

    Here's the code for the html Panel,

    I save the event to listen to at the time of the loading of the page.

    function onLoaded() {
        var csInterface = new CSInterface();
    
     // Register the named event handler
      csInterface.addEventListener("com.mypluginevent.test", myEventHandler); 
    
    }
    //Create a named event handler callback function
    function myEventHandler(event)
    {
      alert("Event captured!");
    }
    
    // This function is called on a button click
    function onClick()
    {
      // Create your local CSInterface instance
      var csInterface = new CSInterface();
      var event = new CSEvent("com.myhtmlevent.test", "APPLICATION"); 
    
      event.data = "This is a test!";
      csInterface.dispatchEvent(event);
    }
    

    Here's the part C++ code where I send the event "com.mypluginevent.test".

    csxs::event::Event event = {"com.mypluginevent.test",
                                  csxs::event::kEventScopeApplication,
                                  "myEventHandler",
                                  NULL,
                                  NULL};
    
    csxs::event::EventErrorCode err = sdkPlugPlugInstance.DispatchEvent(&event);
    

    I always get a hit on the dispatch of the event, but the extension intercepts her.

    Can someone tell what I am doing wrong?

    Hello

    I don't know if it will help but take a look at the documentation for CC 2014 (rather than the CC 2013 docs you use): official Adobe Extension SDK Documentation for 2014 CChttp://adobe.ly/1rin38t>

    Best regards

    Hallgrimur

    --

    René Hallgrímur | Product Manager Adobe EAC | @HallgrimurTh

  • Main difference between OWB and ODI

    Hello

    I have a very long search behind me to know the difference between the two, but the thing the most I found was marketing blah blah blah and not core-facts :(

    Can someone tell me the main difference between OWB and ODI. Please only facts and no marketing blah blah blah :)

    Also, it would be good that you have a reference (link or something else) of your facts for me

    I look forward to your replies

    Hello

    Oracle Warehouse Builder VS Oracle Data Integrator

    BR,
    IM

  • Open a Subvi and run automatically

    Hello everyone,

    I ve a structure of the event in which a Subvi is called by server of VI. I Don t want the main VI to freeze I turned forward until it is turned off.

    But the Subvi is called and in edit mode. How can I call the Subvi and run automatically?

    Kind regards

    Wilbur

    Hi Wilbur,

    Good afternoon and I hope that your well today.

    Thanks for the post.

    The VI property Exec.RunOnOpen is not necessary - if you are using Server VI, this property is ignored - and your using the method run a VI in any case.

    I think that your problem is with the configuration of your reference open VI. If you set the entry to zero (0) options it works? It does for me. And if I said that admission to 8, it load in edit mode.

    The problem that I believe is in the detail of the reference open Help content. When the reference is destroyed in the server called VI VI VI is shorter.

    For example, I have a small delay between my RunVI (wait that fact - false) and the reference close VI. After the period of my called VI stops.

    What results you want to achieve? You try to call a reentrant VI? If so, please take a look at the following example

    Load and call several Copies of a Subvi using VI Server

    http://zone.NI.com/DevZone/CDA/EPD/p/ID/4192

    Please let me know how found you this information.

  • Display satellite C50-A546 cards how to switch between NVIDIA and INTEL?

    Hello

    How can I switch between NVIDIA and INTEL graphics cards?

    PS
    I have already installed all the drivers, but I can see that INTEL the card used chart!

    * OS: Windows 8.1 x 64
    * NVIDIA driver: 340, 52-portable
    * DirectX: 11

    Hello

    The Intel graphics chip, which is part of the central unit should be used for low performance applications, because it allows you to save energy and reduce the internal temperature.

    For best performance while game, it s advisable to use the external GPU (nVidia or AMD)
    This setting can be changed in the nVidia control panel s

    Here, you should choose manage them 3D settings (can be found on the left in the nVidia control panel)

    Now in the main window, you will find two global settings and program parameters tabs
    In the program settings tab, select the (game) program that needs to use the nVIdia GPU

    If it is not listed, click the Add button
    Then choose the graphic processor preferred for this program (generally must be nVidia processor high performance)

    Last but no less, in this program-specific settings, you can assign additional features to improve performance.

  • on the use of LLB, Subvi and project

    Hi all

    I have heaps of subroutines will necessary for all projects of development on the same computer. For a long time, I wrap each of these subprogrammes as a separate Subvi and call the Subvi when necessary. But I just saw that someone will build a LLB in contains all these Subvi. It will be the same to build the LLB or separate from the Subvi? So, what's the advantage of using LLB? I have seen that the builtin functions are all grouped together in a LLB. So if I create my LLB, where should I put this LLB so it will appear in the main palette?

    The second question I have is what is a project concerns in labview 2013? I've been using labview 7 long and I create my project in a folder. But LV2013, I can creae a project and link everything in there. So what's the advantage of using a project?

    Thank you.

    It's really no use for an llb. It was mainly used to store screws with long names - names that were not supported in the early days of the transition from the BACK. Storing files in a Bachelor's degree in labor law is a bit risky because a single corrupt VI will make everything unreadable llb. A Bachelor's degree in law is not appropriate for source code control. Source code control is able to follow the Bachelor of law and not individual files. The only time a law degree should be used must distribute released code. Better and this which is used is now the lvlib or packed library. One of the biggest hassles of older versions of LabVIEW is the inability to load different screw with the same name. Placed in separate vilibs, you can now do.

    The advantage of the project is what you said - all linking together regardless of the actual location of the file. The project may contain files other than screws - word and excel for example files. A project is also required to create an exe file. The project contains the specifications of construction for the exe and Setup. A project can also contain DAQmx tasks. Even if you do not create an exe file, a project is always a useful organizing tool.

Maybe you are looking for

  • No iMessage Notification on 7 iOS10/iPhone?

    I just bought the iPhone 7 and thought I missed my iMessage notifications or glanced at them. Turns, I have not received notifications of all... the other apps iMessage I will continue to receive notifications but iMessage is disabled despite the att

  • Where can I find a list of my contacts on Firefox?

    I find it a category on the left for contacts on my Firefox window that gives me a list of my contacts and their email addresses. Where can I find my contact list?

  • Vertical zoom resets to ZoomToFit

    I work with MS2015 and chart WPH. If I do horizontal zoom and then I want to do vertical zoom, vertical zoom resets the zoom to be ZoomToFit. For example, the x axis interval is between 0 and 10 and the axis interval is between 10 and 20, I want to d

  • cRIO-9073 disconnects

    I connected a cRIO-9073 to my computer and connected to my LabVIEW project. I downloaded the software to it and configure it to scan mode. It is, whenever I connect to it in LabVIEW, it disconnects after only 3 minutes exactly. I did nothing at all w

  • Stuck in a boot loop

    When I start my computer HP it reached my home page but then generates two error messages and will restart.  The first message is related to MSN messenger, it reads as follows: you cannot sign in to MSN Messenger because you are using an older versio