Event structure in RT project

Hello.
In my main VI i have an event structure for few buttons. When I run the VI itself it works perfect.
When I open a new project, adding cRIO 9074 as a target, then adding the VI to the project the buttons doesn't respond. The event structure doesn't work.
Why? Is there any problem using event structure with RT targets?
Thanks 

Tacchi,
Front panel events do not work on RT targets.  Only dynamic events are allowed on RT.  The reason for this is that when a VI is running on RT, its front panel doesn't actually exist.  See this KnowledgeBase for more info:
http://digital.ni.com/public.nsf/allkb/42B70D2D0C4B568586256E2F0051441D
Chris M 

Similar Messages

  • Event structure in a project using RT target

    Hello.
    As i was already told, i can't use dynamic events on RT targets. Can you suggest me a solution?
    I have the following project:
    Not a Real-Time Project. But project that using RT target: NI cRIO 9074.
    My main VI looks like (part of it):
    It is implemented by  while loop, which runs until START button is pressed. The button pressed after all the values are set, and then the scan begins. 
    When i was developing this VI outside the project, I used event structure for save to new/existing file, show graph buttons (the white buttons). Because it should not interrupt the while loop (user can make setting, then press show graph, then set something again and only then press START).
    It was like here:
    Now, i wanted to bring all the parts together and put that VI in the project. In addition i wanted to add few buttons, like <-- and --> which are moving the motor manually before the scan starts. BUT, it didn't work.
    Now I'm stuck
    How can I implement what i describe above in my situation?
    Thanks!!! 

    Hi Tacchi,
    Are you planning on running your application as a startup executable or from the development environment? If you are planning on running this from the development environment, probably the closest thing you will get to the behavior you currently see with an event structure is by polling the value of the control that you wish to trigger the event. For example, if you wanted an event to be triggered when a button is clicked, you can have a while loop with a case structure inside of it that performs whatever code you want when the value of the button is true:
    Granted this is not the ideal translation, but since RT applications are meant to run headlessly without a front panel, it may be the best option for your application.
    Hope this is helpful!
    Aaron P
    National Instruments
    Applications Engineer
    http://www.ni.com/support

  • Strange problems about my projects(efficiency,event structure,queue)

    hey,guys,i am a labview user from china,so forgive me about the chinese words of my projest. i found something wrong with my work. .
    there are two functions in my "While loop", the first one depends on "queue" and  is to get information from UART, the second one is "event structure" to send information through UART. my problems:
    1. i can not stop while loop by pressing "停止“, and i find two ways to stop it. first, i press"停止”,then, i press any buttons that can trigger "event structure"twice, at last, while loop can stop.the second way, i press buttons for "event structure" one time, then "停止”, and then the same button for"event". it also works
    2.my work does not run efficiently. you guys can try. once you press buttons for "event structure", it responses very slowly,and if you press many times,the whole program seems like suspending.i have added a LED named test at the front panel, it should light once you press "运行“. and it also shows how slow the whole program is.
    i have attached my work, and my main vi is "串口通信 主VI".
    can any body give me some suggestions? thanks a lot
    Attachments:
    Uart.zip ‏140 KB

    Your event structure will execute exactly once per loop of the main loop, thus the other three loops must stop before handlig the next event. You will also get a race condition between the top loop and the events when writing.
    I'd put the top loop as the timeout case in the event and place the loop around the event for starters.
    /Y
    LabVIEW 8.2 - 2014
    "Only dead fish swim downstream" - "My life for Kudos!" - "Dumb people repeat old mistakes - smart ones create new ones."
    G# - Free award winning reference based OOP for LV

  • Can you share FP Controls between different Event Structures

    I'm creating a program that will either read real-time data from an VNA on the GPIB bus, or read a saved s2p (Agilent) file and analyze it. The FP consists of 5 graphs, and various controls which handle events like printing, changing filters, or exiting. on the BD I have a case structure controlled by an operator selection pop-up. I tried using the same FP controls in the event structures I have setup in each case, as only one event structure would ever be executing at any given time, but the program doesn't seem to like it ast run-time. I've worked around the issue by creating "duplicate" controls and using the property setting to make them visible/disabled, etc., but the is seriously congesting my BD.
    Anyone know a way to share controls with seperate event structures?

    It sounds like the root problem is the overall structure of your program. I highly recommend that you check out the Queued Message Handler project template in LabVIEW 2012, that will show you how to utilize a single event structure and pass events to a consumer loop. If you program is too large to consider an architecture change at this stage of the game, then there is a workaround for your problem.
    What is most likely happening is that you have the event structures all set to lock the front panel until the event completes. However the case structure that you have wrapped around these event structures is causing all but one of these event structures to be unreachable thus preventing you from handling the event. Again, as I stated above, the "RIGHT WAY" to fix this is to select a better program structure but the "kluge work-around" fix is this: Dynamically register for the value change event on all of the controls you are trying to trap events for. Dynamic events can be deregistered and re-registered at run time. This will allow only the event structure in the active owning case structure to be registered for the events, thus no other event structures will get in your way.
    Disclaimer: This advice is given based on very minimal information and a great deal of speculation and may not be correct. Please include your code if you need further assistance.
    Charles Chickering
    Architecture is art with rules.
    ...and the rules are more like guidelines

  • Event structure in Sub VI

    Hello ,
     I have a developed a program which captures video and user can save images out of it. I have used .NET reference to handle the video part, and the VI is attached in this post. Now i have to make this VI as a sub VI and running this from Main VI. I tried creating event structure in Main VI which i used in sub VI , still i could not suceed. Kindly assist me in this regard
    Solved!
    Go to Solution.
    Attachments:
    Webcam-Control-Projekt-mit-Reference-Design-2013_original.zip ‏286 KB

    Hello Michael,
     I have attached a model in which Main VI calls the Sub VI using Event Structure. Two events can occur in Main VI and their corresponding event Structure is called in Sub VI using Register events. When i run this VI the out put is fine some times but other times i need to trigger event many times before i can see its effect in Sub VI, my doubt is that Register events are reliable, whenever (during the execution of LV) if event occurs will surely its code in the sub Vi gets executed?
    also I have put a indictor(numeric) in the SUb VI which i connect back to Main VI, when i run, i can see the result only in the sub VI not in the main VI.how to see in Main VI?
    I have used the this model (which is attached ) to implement my project(which i already mentioned) . one switch for starting the video and other for recording the image. The video is getting started with out any trouble, but imgae is recorded only few times when i press the button which is for image recording, most of the time second event fails to get executed. Also there are difference in output when i run with and without "Highlight execution", why this happens, is this because of Reg events?
     any more info if required let me know, i will provide.
    Attachments:
    Main_sub_VI.zip ‏18 KB

  • Change the condition in event structures

    Hi all,
    I am a student, currently doing a project. I'm very new to labview and I don't really know much of the function in labview. Anyway, I have this timer made using event structure if I'm not mistaken (I downloaded this timer from one of the post in this forum). This timer will start at 0s, count to 20s, then stop. So what can I do to change the end time of this timer?? Let's say stop at 50s??
    Attached is the program. Kindly please explain to me or modify the program and attached back as a reply. I've been trying to figure it out from the help function, but still don't understand.
    Thank you very much in advance!!!
    Solved!
    Go to Solution.
    Attachments:
    TIMER s.vi ‏13 KB

    Hi,
    Thanks for your inquiry. The VI attached uses a couple of programming structures: While loop, Event structure and Case structure. What you would have to change is actually the case structure. Before we go to that, let us go through the different structures. Open up the block diagram by going to the Menu bar of the front panel and navigate to Window->Open block diagram.
    The While loop is like a Do Loop in text based programming. It will execute until a condition is met. From the attached VI, it stops running when you click the exit button.
    The Event structure is a structure which consists of subdiagrams. The structure responds to interactions with front panel objects. For example, if you click the start or stop button in the front panel, the event structure will switch to a case which corresponds to this interation. In the attached VI, the case, which corresponds to intreaction with the start or stop button, is called  "Start", "Stop": Value Change. Each case will contain an event-handling routine.
    Case structures are like switch statements in text programming. Take a look at the "Start", "Stop": Value Change event. It contains a routine which consists of a case structure. The case structure responds to the input terminal called Start (which is actually the start button on the front panel). The case structure switches between cases according to this input. To view the different cases just cycle through the case structure by clicking the left and right buttons. There are only two cases: True or False as the input is a boolean.
    Now lets take a look at the VI. Take a look at the "Timeout" case of the event structure. This is where the modification needs to be made. Modify the case structure by editing the cases. Change the numbers in case structures: ..20000 to ..50000  and 20001.. to 50001.. This should do the trick.
    Regards,
    Alan Bong

  • Producer/Consumer Design Pattern + DAQmx + Event Structure

    Dear community users,
    at the moment I try to implement the Producer/Consumer Design Pattern into my current project. For this purpose I am trying to make a "minimal-example" in which I use the Producer/Consumer Design Pattern for the data acquisition and analysis (display in GraphXY, calculation etc..) process. In the Producer Loop I perform the data readings via DAQmxRead.VI and in the Consumer Loop, in this example only, I display the data in a GraphXY. At the same time I want to control the data acquisition via an Event Structure, for example Start Measurement/Stop Measurement Buttons. To configure the measurement time, for example if the user only wants to measure 150 sec, I use the Time Out Event of the Event Structure. This is a technique which is often used, when data acquisition and Event Structures are used at the same time (Excuse me if this is wrong!). Due to understand the Producer/Consumer Design Pattern I looked up in the Template\Framework of LabVIEW.
    In the attachment you will find my "minimal-example", which -sadly-, not working. What should I do ? 
    Thank you.
    Best regards,
    tugrul öztürk
    Attachments:
    daqEngine_PCP.vi ‏35 KB

    Your VI will never stop due to the Ok Button that stops the producer loop is read OUTSIDE of the loop.  Add an event case for it.
    Move the Start and the Ok Button inside of their respective event cases.  This will allow the latch to reset when they are read.
    Change the Ok Button to a stop button.
    Use a Greater Or Equal instead of Equal for the measurement time comparison.  What if somebody randomly changes it to 0 on you?  Again, you will never stop.
    Is the DAQ only supposed to read for "Measurement Time".  Right now, it constantly reads.  So if you don't use the DAQmx Read, you will get a buffer overflow error.  You need to put the DAQmx Start Task inside of the Start event case and then the Stop DAQmx Task inside of the Timeout event case when the measurement time is exceeded.  You should also perform the read regardless inside of the Timeout event case.
    I HATE telling the consumer loop to stop by destroying the queue.  You can look data that way.  Instead, send something an empty array.  In the consumer, check for an empty array.  If it is empty, stop.  Destroy the queue only AFTER BOTH LOOPS HAVE COMPLETED.
    You should also report your errors in some way.  Simple Error Handler at the minimum.
    Since you are using Continous Samples, don't limit the buffer.  Leave the Samples per Channel unwired on the DAQmx Timing VI.
    There are only two ways to tell somebody thanks: Kudos and Marked Solutions
    Unofficial Forum Rules and Guidelines

  • Event Structure Question

    Hopefully I can explain this okay....
    I'm using an event structure to control several features in my program and all have worked great.  All of the events in my program are handled via boolean buttons with value changed option.  I have a numeric control in my program that controls integration time.  This changes when the user clicks the up or down arrow or types in a new value.  This control is used and needed to changed the integration time in a couple of different event cases.  However now I'd like to use this numeric control (integration time) to not only change the integration time but also trigger one of the events (in addition to the normal button that I have been using to trigger the event I need to have happen).  (The value of the numeric control when changed also executes a case structure when it is changed in one of the other events.)   
    However when I tried to do this, I ran into some problems.  If I change the numeric control value during one of the events in which I need to use it, and after stopping the event, then another event seems to execute (based on the changing of the numeric control, this event is the same event I ultimately would like to trigger).  Basically I need to stop the numeric control from executing after stopping another event when its value has been changed and only executing when I need it to.  Everything I seem to be doing hasn't been working and I'm just not seeing any type of walk around.  But I need to be able to use the control in various events to change the integration time and also if needed to change it and thus trigger an event (besides using a boolean button to trigger the same event). 
    If needed I can post screen captures or sample code, but my main vi is rather large, so I'd have to cook something up as an  example.
    Any help provided would be much appreciated.   
    Using Labview 7.0 and 2010 SP1 with Windows XP and 7.

    The attached amusing example is an architecture which will work for you.  Read the documentation for details.  It has two components - an event hander and a task handler.  The event handler is the LabVIEW event structure.  The task handler is the queue-based outer loop.  If you need to add data to the tasks defined for the queue, make the queue element a cluster and add a variant to it.
    As a general rule, most UI projects involve getting to the same task through different events, making this the standard design pattern for almost any UI driven program.  You can separate the task handler (consumer) and the event handler (producer), but I have found that the synchronization problems are not worth it.
    I posted 7.0 and 7.1 versions of the code.
    This account is no longer active. Contact ShadesOfGray for current posts and information.
    Attachments:
    LargeGUIApplicationsInLabVIEW_70.zip ‏735 KB
    LargeGUIApplicationsInLabVIEW.zip ‏711 KB

  • How to make an Event Structure work with a webcam feed?

    Hello,
    I'm pretty new to LabVIEW, and I really need some help on a school project.
    In the program, a webcam contantly streams video.  At the same time, I am trying to add an event structure inside of the while loop that contains the webcam information.  An event structure seems to be just the thing I need to add to make my program work, but after adding it, the webcam stopped showing its feed.  My guess is that it's specifically not working with the webcam part, because I've used event structure inside of while loops before.  How can I prevent the event structure from interfering with the webcam?
    I cannot take a screenshot of the back panel at this time, although I can do it within the next 24 hours, if necessary.  Otherwise, I can try to describe the program to the best of my ability.

    i did this a while back for my school project.
    see if its what you need
    Best regards,
    Krispiekream
    Attachments:
    Executive.zip ‏183 KB

  • Event Structure Problems

    Hello all,
    Im using the following code trying to obtain voltages and then use the peak voltage to trigger an event. My event structure doesn't seem to be working properly and I'm not sure what I need to do.
    Take a look, and any help would be great!
    Attachments:
    Untitled 5.vi ‏43 KB

    hey,
    there are a couple of things wrong with your layout, other than the Event Structure isn't being called. What you have here doesn't do a lot and that is the beauty of LabVIEW: you can do the same thing in many different ways.
    Following the Event Structure design you are intending to go with I have attached a redesign of your code, including comments. I believe this should work for you now. I have followed the common State Machine approach, which quite nicely, uses the Event Structure - when in a 'stable' or non-working state.
    The main aspect you need to consider is how the Event Structure is called. It needs an interrupt in order to identify a state that it needs to address. In this case here, to increment a counter each time the peak voltage is detected.
    The Enumerated data type (the value that holds the state of the State Diagram) can be added to or changed. Normally you should 'Customize...' the data type (right click) and create a Type Def variable (ensures all changes are provided throughout the code, where it is used).
    There is more you can do with this structure, it is quite useful and powerful. There are quite a few examples online or within the LabVIEW help function to give you more. In regards to the DAQmx, there is a State Machine project already set up for you - with all type-defs and some events already created for you. After you've mastered this you should go along and check that out more.
    All the best. David.
    Attachments:
    Untitled 5.vi ‏25 KB

  • Extent of Coding inside Event Structure cases

    Hi all
    I am trying to understand the practices while using an Event Structure. I am used to developing most of my projects using an Event driven State Machine Architecture. Most times, I use Event driven-Queued State Machines. I have also used Producer Consumer Architecture with Event structure driving the producer.
    I have always believed that using lots of code, or lots of sub-vis inside one or more cases of an event structure is not a good practice. I reasoned that it will delay the capture of other events occuring while the current case is still executing. This was one of our points during design review, i.e., to reduce the code inside event strucutre cases to as minimal and necessary as possible. We used clusters/queues/LV2Gs inorder to pass on the required data, which will be processed in the other cases/loops.
    However, I happened to recently come across a couple of very old applications upgraded to LV2011. The applications used an event structure in one of the while loops, with one or more parallel while loops inside the Main VI. The event structure was the only code in this while loop, no case strucutres.
    These event structures had loads of code in each case, with sub-vis and nested sub-vis, even DLL function calls among them. Thats when I started to look for information on best practices using event structures and about any available details on the extent of coding allowed inside an event strucutre.
    One sub-vi which was called as a dialog box also had its own event structure (ending up as ensted event structures). I have read about nesting event structures and their disadvantages.
    Off course, the code is working and I am not sure if anyone had any execution problems with the applicaiton.
    However, I am wondering about the pros and cons of having the entire code inside event structure. I would have defined that code a nightmare. Its disturbing me to see that code and being unable to make it better.
    To my understanding, I wish to know if there is any definition or rule regarding the amount of code inside an event structure.
    Thank you

    The exception I use is User driven intefaces where every user action must get a response and each change must complete before the next. In those cases an event only implelmentation is generally fine.
    Now if that code does something that takes long enough for the user to question if the program is still alive should at least get a "Busy cursor" OR a progress bar OR an abortable progress bar where the user get s the option to abor out. THe last case may warrent a parallel process to crunch the numbers.
    But please keep in mind the above suggestions apply only to those User only" type things. Applcations that invlove the word "while" will generally get deamons and other common design patterns used to henld the implementation. But now I have drifted to design teory and away from the subject so ...
    Have fun!
    Ben
    Ben Rayner
    I am currently active on.. MainStream Preppers
    Rayner's Ridge is under construction

  • Can I use an event structure within another event structure

    Hi
    Can use an event structure within another event structure?
    Thanks
    Yasamin
    Solved!
    Go to Solution.

    I attached my Vi from my old project (MY OLD VI). It is worked correctly.
    But I decided that use event structure instead of case structure.
    I attached my new VI as a picture and as a LabVIEW VI too (network_analyzer_8510_920527 Frequency Sweep.vi )
    My graphs show by pressing "case 5: button (Bottom of page right hand).
    Then I want to show each of graph in a large window( in a new VI) by clicking a key (for example "show 1").
    Thanks
    Yasamin
    Attachments:
    my VI.JPG ‏256 KB
    network_analyzer_8510_920527 Frequency Sweep.vi ‏72 KB
    MY OLD VI.vi ‏69 KB

  • Exit from the application using event structures

    Hi
    In my project i used event structure it working fine.
    Now i want to exit(close) the application when i press EXIT button on the front panel.
    Here i attached my project give an idea.
    Regards
    hari
    Solved!
    Go to Solution.
    Attachments:
    Sledge.zip ‏40 KB

    Hi SAM
    U saw my ok.i have one more problem when i run the program(main vi) all the remain sub vi's also opened.
    i want open sub vi when i press a button on front panel.
    i have made small changes to it.
    Regards
    hari 
    Attachments:
    Sledge.zip ‏41 KB

  • Trigger Event Structure Case on Startup

    Hello,
    Within my project, I am controlling a linear actuator via Modbus TCP, with an event structure within a loop.  I control its velocity, acceleration ... etc.  It works beautifully, but I must change the values of the mentioned parameters to trigger the event cases, after startup.  I would like to trigger the event on startup of the program and take the current values on the front panel.
    I have heard about "Property: Value(Signaling)", but I cant seem to understand it and how to implement it..
    Any guidance and help would be appreciated!
    Thanks,
    Danny

    It won't work for you because you already have something designated for the timeout case, and you want a different event case than that to run on startup.
    But, here is the explanation.
    At the top left of the event structure is the timeout terminal.  The number you wire in there tells how frequent the timeout case could execute.  If you put a 0 constant outside of your loop and wire it into that terminal through a shift register, it will execute immediately or almost so.  After the event structure, wire a -1 into the right hand shift register.  Then after successive iteration, the timeout case will be disabled.
    Attachments:
    Example_VI_BD.png ‏12 KB

  • Event structures in older versions of labview?

    Can anyone tell me how to create a workaround for a 'value change' event structure in an older version of labview?  I have a student  version of LabVIEW 6i and need to create a queued buffer from each value change.  Thank you.

    James.Morris wrote:
    Ah, you're only one release away from the event structure. That's too bad.
    You're going to have to implement a Polling loop that continuously checks the user inputs. Make sure you add a Wait function to the loop (~100ms) because that will act as your chance for the user to make changes. You can use shift register(s) to keep the previous loop's values and compare to get a bunch of Value Change booleans. If you want a specific case for the specific events, then you can group all of your Value Changes in to an array and act upon the ones that are True via a Case Structure.
    The Event Structure only pulls a single event per loop and has a queue of events to handle for following loops. You might encounter multiple value changes in a single loop if the user clicks fast enough, or you trigger value changes. To avoid losing the trailing events, you should probably have a For loop within the Polling loop that handles all True values. Either that, or have a consumer loop that handles all of your events.
    James, I swear I'm not picking on you today
    You can set the maximum number of events alowed in the event queue per event in the edit event dialog box.  Check box and int fields in the lower right side.
    6.i didn't have a "Value (Signaling)" property- (a subject of some CLAD exam questions not that you suggested it)
    Student editions could not use 6.i events.  From 7.0 or 7.1 through 2011 Student Edition could use but not edit event structures. 2012 and on Event Structures are available in "All Versions" of LabVIEW- at the time.  I haven't looked into the newer license options.
    On to licensing options. (Not a lawyer! consult your Legal Dept!)
    If you are not doing work towards earning a educational certificate you should not be using Student Edition.  And, in some cases (Like working on a student project with commercial investment) not even then!
    The Home Edition is also a new option.  It is intended to enable fast "Proof of Concept" development or development for your sole non-comercial use.
    LabVIEW Full and Professional are for comercial use and have a "Home Use License Agreement" clause attached. If your company owns a LabVIEW License you CAN install a copy on a "Home PC" for the limited use of aiding your employer (who paid for the license) such things would arguably enclude "Training"
    NI is not totally opposed to negotiating "Exceptional" agreements for mutually beneficial reasons.  Youl'd better bring a justification better than "I can't afford it"  Go find some investors and buy a license in that case.  And Yes, until the moderators take this down, I did at one time have a LabVIEW license for exclusively engaging the LabVIEW Community (Forums and NI Sponsored events use only- LAVA was not encluded)  I'm not sure if such a deal could be negotiated in the future.  In Fact, The Home Edition would have been less costly.
     

Maybe you are looking for

  • 'Sort by last name' not working in Address Book

    In Address book, the 'sort' function (under preferences-General) does not work for half my contacts (all people rather than companies). This does not work for 'by first name', nor 'by last name'. This random list appears at the top of address book, f

  • QuickEdit Lookup Column Sort

    Hello,  I have the following issue and i would like to understand why it has happened in my enviroment and the solution if its possible. About enviroment: Currently running SharePoint 2013 but it was upgraded from SharePoint 2010. Deployed in a 2 ser

  • Log-in message - Network Services Unavailable

    I have been getting the following message upon both my G5 - 10.5.8 and my iMac - 10.6.1 prior to logging in after booting up both machines , both of which are the only two machines upon the same Airport Extreme network. *Network Services Unavailable*

  • My Macbook Pro is possessed. Now what?

    My MBP retina trackpad does not accept any user input, but the cursor is randomly jumping around and screens are switching from desktop to dashboard to mission control randomly. The best way to describe the cursor and screen switches is it looks like

  • Missing double quote in identifier help!

    Hi there I need help with fixing this code, im trying to display the total of employees for Job title and location and its giving me a message saying" missing double quote in identifier" , please help, THANKS SELECT j.job_title, "Job Title", l.city "