Event Structure, Boolean Control and Value Changde

I have a boolean control which is related to a frame in an event structure, the action set as Value Change. It worked ok with front panel click but I have problem with triggering it programmatically. I used the Val(sgnl) property node to trig the event. My problem is that it will trigger whenever a true or false value is sent to the property node, no matter it's changed or not. I don't know whether it's the normal behavior or I'm doing something wrong. Anyone can give some advices? Thanks in advance.
Guangde Wang

What you are seeing is the expected behavior, Value Signaling always sends the event.  An easy way inside the event to see if that is the case is to compare the new and the old value.  If they are the same then you can do nothing in that event.

Similar Messages

  • Controlling the Boolean Controls and generating Numeric Output correspondingly

    Hello everyone,
    I am working on a project of electrode activation, here I was thinking that how could I control one electrode at a time and generate a numeric output of it correspondingly. I want to substitute each electrode with a an LED on Front Panel and generate numeric value of each LED on Block Diagram.
    So it can be divided into two parts
    1- Control the Boolean outputs
    Here, my target is that if I have 5 leds who are used as Boolean control, should be controlled in such a way that only one of them glows at a time and the remaining turns off.
    I mean that for instance if #3 was glowing and the user pressed #2 then #3 should be turned off and only #2 glows.
    2- Generating Numeric value correspondingly
    Then according to the position of LEDs I want to generate a numeric value correspondingly, like previously output 3 was coming and the output 2 comes when second LED glows.
    I request all the participants on this group to help me on it.
    Regards
    Solved!
    Go to Solution.

    Thanks very much Dennis, Its really what i need.
    But i have a bounding in the radio button to place all option together. 
    Since i am activating the appropiate electrode on the body, all the options could not come vertically or horizontally.
    So can you pls guide me how can i make my 5 electrode behave like a radio control.
    Thanks once again.

  • How to structure a control and its display in the same while loop and same display panel (instead of display panel and a seperate parameter-setting panel )

    As you can see, I need to adjust the Target position to certain value (like 1068.88), the actual position is showing 1066.99.  What kind of flow control structure will achive this goal?
    Notice the Labview example "Vibration analysis"  may shed some light on this issue.  Will someone give out a simpler code to show how it works?
    Attachments:
    Spectrometer Control V3.0.vi ‏113 KB

    lightblue,
    Just to make sure we are on the same page, you would like to set the position, then monitor it.  Is that correct?  In that case, you might have a few options.  You could have a sequence that would set the position, and then a while loop that would monitor the position, however this wouldn't allow you to update anything else.  The other option would be to use parallel while loops, which would be similar to the parallel sequence structure you have below.  The only issue with this would be that if you are calling the driver from both loops, you could run into errors.  The Vibration Analysis.vi takes the setpoint, then calculates the actual available position, so it won't serve as a very good example, code-wise. 
    Hope this helps!
    Andy F.
    National Instruments

  • Using an event structure to reset a boolean control with ring menu value change

    I am trying to get two boolean buttons to reset when the value of a ring menu changes.  For this I am using an event structure set to execute with a ring value change.  However I have other code that needs to be executing while the event structure waits for the value change.  I place my event structure inside the while loop the buttons reset as expected but my other code does not run (except at the moment of value change). If I place it outside the loop the rest of the code functions as expected but the buttons do not reset.  Any help you can offer is much appreciated.
    Solved!
    Go to Solution.
    Attachments:
    event structure reset.vi ‏11 KB

    try this
    Attachments:
    event structure reset_edit.vi ‏14 KB

  • Event structure to detect value change of a control within a cluster in an array

    I have 1D array that contains a cluster. The cluster contains a numeric and a boolean control.
    If the user starts to edit the numeric control value i would like to call one subVI, and if the boolean control value is changed, call a different subVI.
    The array control on the front panel allows the user to edit a number of the array elements. 
    I would like to use an event structure to detect a value change in the cluster. When editing the Events, in the Event Sources panel i get the option to select only the array, not the cluster within the array or the controls within the cluster. Can the Event structure be opened up to show controls within clusters and arrays?
    The solution i am using is to detect a mouse up event on the array and then use property nodes to  determine if the key focus is on the numeric, and  a case structure to determine which subVI to call. This works, but is there a better (simpler) way?
    Thanks, Blue.

    Thanks for the responses guys.
    The tricky bit was that i wanted the numeric control values to flag they were going to be edited, so i could call a subVI, before their values were changed by the user. This is done by using the key focus property node, - i need to detect changes on the fly rather than post the event.  Probably didn't make this clear enough in my original post. 
    The array is of variable size depending on if the user decides to insert or delete elements. The user also has the option to click and edit the array without having to do to much scrolling through the array index, as the FP shows several elements at a time. The Event Structure does a good job of automatically determining which element in the array is being edited, and returning those values to the property nodes. Turned out simpler than i thought it might be at one point!
    Cheers, Blue. 
    Message Edited by BlueTwo on 01-15-2009 06:52 AM
    Attachments:
    evstrct1.jpg ‏63 KB

  • Passing values between event structure cases

    Hello everybody,
    I have a question concerning the event structure  - how to pass values (let's say a string / the state of a boolean control / the value of a numeric control value / an array of numeric values) between event cases ?
    There seem to be 2 situations here  :
    - when you need to pass the value of the control that triggers an event;
    - when you need to pass the value of a control which is modified in an event case.
    I have read the documentation but i still do not understand very clearly how to do this. Maybe you can point me in the right direction (maybe some threads on the forum that i have missed).
    Thank you very much !!
    (KUDOS for everyone who is interested in this )

    AndreiN2014 wrote:
    - when you need to pass the value of the control that triggers an event;
    - when you need to pass the value of a control which is modified in an event case.
    The first question isn't worded very well.  What exactly are you looking to do?  Are you looking for an event that specifically relates to that control?  If so, just drop it inside of the event and wire it.  Are you looking to trigger multiple events from the same control?  Ie, you hit the control, event1 is triggered which then triggers event2 ... ?  If so, you might consider taking a look at a different architecture.  I can think of very few cases where I'd prefer do this over something like having the button trigger a state and using the state machine architecture. 
    Others have pointed out the Shift Register.  This is the typical way to pass values between one iteration of a loop to another.  We can assume you have some sort of loop outside of the event structure to make it run a second time.  Put a shift register on this loop and the value wired into it will pass each iteration.  But, if it's just a random control, you can also just leave that outside of the event structure and wire it in as well.  This will provide the new value to the next occurrence of the event structure.
    You really need to define your problem before trying to solve it.

  • Load defaults from file with event structure in vi

    Hi All,
    I've been trying to figure out how to do this but have not quite got there. Taken a look at lots of posts but can't quite find the answer to the question that i've got.
    I've got a vi for controling 4 PCI cards making calls to some DLL's. I've got quite a number of controls on the FP and i use an event structure to update the values on calls to the DLL. On startup, one of the first calls that i make is initalise and that sets the cards up. I then want to load my own set of default values from a file to initalise the cards to my particular set up. While the software is running the user may change the values and wish to save a file with the new default values, or he may wish to load a different file of default values (depending on the test that he is running). I've got the Control Values:Get All [variant] and the Control Valueset [Variant] working to save all the controls values to a file and read that file in and set all the controls values. So far so good. Problem is i'm using an Event Stucture and it doesn't register that the values have changed. I could complish this by using Value(signaling) but the data from the Control Values:Get All is variant data and the Value(signaling) needs the same data type as the control. What do i do?
    One thing i have thought about is to write all the values from the file to all the conrols and then have a read Value and a write Value (signaling) to trigger the events. Problem is i don't want to set this up for every control (it'll take me ages). Can i do it programitically? Is there a better way to do it?
    Thanks,
    Phil

    You could create a boolean control/indicator and signal that value when you've updated the values on the FP.
    Name it something like "update FP". The event case for that boolean will have the code to update the necessary parts of the FP.
    André
    Regards,
    André
    Using whatever version of LV the customer requires. (LV5.1-LV2012) (www.carya.nl)

  • 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

  • Questions on 3D picture control and STL file

    Hi,
    I am currently working on a project in which I load an STL file to vizualise a 3D object (see attachment). I have several problems and questions.
    1) I would like to execute rotations (X,Y,Z) on this 3D object. Unfortunately, Labview executes only one rotation and I don't know why
    2) If I load several objects, is it possible to create links/joints between them? I saw the example with the robot arm provided in the Labview examples, but I don't understand where and how the joints are defined.
    3) Is it possible to import an image (png, jpeg,..) on a scene display? I would like to visualize a graduation to see the number of degrees of rotation of my object.
    Thank you for your answers
    Message Edited by kastillio on 10-23-2009 04:24 AM
    Attachments:
    load_stl_geom_8_6.zip ‏56 KB

    Thank you so much for your post on our forum.
    I created an example based on the VI You send Fact is that we need to use relative rotation. With absolute the previous rotation is cleared and the new rotation is done from the zero point. With your example this means that you first do the Y rotation and immediately the X rotation is done resetting the previous Y rotation. If you swap these two rotations you will notice that only the Y rotations works because the previous X will be reset.
    As said I made an example based on relative rotation so the rotation will be done from the current position. I used the rotate object.vi and used a event structure looking at the value change from the x or y control. The function will be executed when these value changes occur.
    Best regards,
    Martijn S
    Applications Engineer
    NI Netherlands
    Attachments:
    load_stl_geom_8_6.vi ‏18 KB

  • Event applied to control references

    Hello!
    I built a VI that can run on its own or controlled by a superordinated VI. If there are valid references comming into the subordinated Vi these are used exclusivly, otherwise references to the controls of the superordinated VI are used.
    So inside my program I exclusivly use references and property nodes to access or change data.
    My first question is if you think that is a bad solution concerning the performance of the VI and if you have any improvements?
    The next problem is that my VI is quit slow now (there is a while loop checking all the time if there are changes made to the controls (via their references) and acquiring data (using RS232) and updating controls. Thereby I use a 20 frames long sequence inside the loop.
    Is that the reason for slow performence?
    To speed things up I considered to us an event structure instead of the sequence to check the changes and only to do the acquisition every cycle.
    But I don't see a possibility to use the event structure to check events on value changes of controls via their references.
    Any idea?
    Thank you,
    Alexandra

    > But I don't see a possibility to use the event structure to check
    > events on value changes of controls via their references.
    >
    With LV7, it is possible to use an event structure on control references
    to another panel. As for whether this is the reason for performance
    problems, that is hard to say without seeing your application.
    First suggestion is to use the profiler. Tools>Advancec>Profile VIs.
    It should help you start looking in the right place and run informed
    experiments.
    Another way of doing this is to send it to [email protected] and let me use it
    as part of the VI critique going on at NIWeek. We will keep the names
    anonymous and find the best technique we can for the problem you are
    trying to solve. This offer goes for anyone with a VI t
    hat they'd like
    to see NI try to improve upon.
    Greg McKaskle

  • Event structure buffering?

    Hi all,
    A quick question, if i have an event structure with lots of value change events for booleans, if 2 or 3 change at the same time or within a few milliseconds of each other does it buffer this event so that when it comes out of the event structure it knows another one has happened since it last went in? i.e. it could get a trigger for one, enter the event structure pass over a couple of ones that didnt trigger then get a trigger for them whilst its in it, but gone past them, then deal with the one that did trigger it and exit. Or perhaps i am not understanding how event structures process the value change triggers.
    I hope i have explained myself well enough
    Cheers
    Mike

    Pnt wrote:
    Yes. As far as i know, events are buffering and it is NOT possible to miss one.
    I agree here. You cannot "lose" any events. Sometimes this is a problem as demonstrated (and solved) in this old discussion:
    http://forums.ni.com/ni/board/message?board.id=170&view=by_date_ascending&message.id=207811#M207811
    Pnt wrote:
    I agree that you should not have the same event in two different event cases (in parallel), but i disagree that there is possibility to miss an event.
    LabVIEW will not allow you to place the same event in multiple event cases anyway, so there is no problem. However there is also no problem having two different event structures listening to the same event.
    LabVIEW Champion . Do more with less code and in less time .

  • How to handle events for Tab Control

    Hi,
    I have a Tab control with 4 tabs and I would like when I go to a specific tab all the contents of that tab being updated. Could you please help me with this?
    How should I set the event structure
    Thanks

    Tab Control->Value Change is the event you want.  You can then use a case structure to do whatever you need it to based on the "New Value".
    There are only two ways to tell somebody thanks: Kudos and Marked Solutions
    Unofficial Forum Rules and Guidelines

  • 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.
     

  • Generating Event with Subvi Control on Main Vi

    We are creating a code in which on pressing set up button( present on main vi front panel ) we are calling one subvi as pop up window which further contains some boolean controls and every boolean control has further one subvi associated with it, when we press on that button a window comes that has several numeric and string control, what we want is after entering all values on numeric and string control and after pressing ok button, these val;ues should get updated to the sequence list present on main vi front panel, i have tried to do this using queue but what we want is that on pressing ok button( present inside subvi) we need to generate a event on main vi that it should dequeue elements to the list only when that ok button is pressed, i have tried to do it using value signalling property node but this is not working, i am not getting how to do this or there if there is any other better way to do this
    I have attached the code for reference.
    Attachments:
    Automation.lvproj ‏9 KB

    A better way to do this would be to enqueue the state that the event case is calling from the instrument state.  Then you don't have to poll the global variable and worry about signaling the event.
    There are only two ways to tell somebody thanks: Kudos and Marked Solutions
    Unofficial Forum Rules and Guidelines
    Attachments:
    queue up state.PNG ‏9 KB

  • Question regarding event structure

    I made a vi that controls a stepper motor with controls such as relative angle, maximum frequency, and acceleration. I use an event structure to update the values after new ones are entered by the user. However, recently I was given the task of integrating this with a larger vi that controlled other parts for an experiment (I will refer to this as the motor control vi). 
    Would event structures in both vi's be necessary? If I want to have the controls and update button in the motor control vi, does this mean that the event structure should be completely eliminated from the stepper motor vi? I was advised to use local variables to store the values for relative angle, max freq, and acceleration and then pass all of it when the update button is triggered and creates an event. I have found this to be faulty. Would it be possible to have event structures in both vi's then? 
    Basically, now everything will be updated and passed from the main vi to a stepper motor vi that originally depended on an event structure. Does this require the event structure to be present in only one or both vi's? Thanks.

    Hey, sorry for not including it before, I'll try my best to explain all the parts because I didn't want to overcomplicate things.
    For the Stepper Motor vi, I have none of the DAQ drivers on my laptop at home so I excluded it in the file attached and simply put a text box in there place. The program starts after the run button is pressed, and then the acceleration, f max, and relative angle is entered. Afterwards, pressing update displays the appropriate waveform graph. Pressing "next task" (depending on the state of the use task button) will allow the user to input other values. The use task button simply indicates whether anything will be passed to the drivers or not.
     The main Motor Control vi was done by another person. For my part (all on the right side), acceleration could be set to 3 different speeds and pressing the button triggers the event that sets a certain value to the local variable acceleration. When the update button is pressed on this vi, the new values for max speed, angle, and acceleration are sent to the Motor Client vi. The state of the run, stop, use task, and next task are also passed, and my current problem is how do I use the update button in this vi? Would passing its value create an event in the stepper motor vi? Or would it be much better to just send the controls without placing them in an event structure?
    Attachments:
    Motor Interface.vi ‏60 KB
    Stepper Motor.vi ‏33 KB

Maybe you are looking for

  • Oracle 8.0.5 on RH6.0, unable to connect to remote database

    Hi Everybody, I have this problem, i have running oracle 8.0.5 on RH6.0 everything works ok for me. But when i use sqlplus on box where is my Oracle running and try to connect to another database on my site (which is running on HPUX) I got resul ORA-

  • How to upload a file in portal

    Hi, I am using submit resume form in which i have one field upload resume.So how can upload resume while using form portlet.Does any have idea how to do that

  • I installed iworks on my mac pro.  how do i get the disk out of my laptop

    I installed iworks on my mac and I don't know how to get the disk out.  please tell me how to get the disk out of my mac.  thanks

  • Mac didn't recognise Externel Hard Drive

    Hello guys, I have HP external hard drive yesterday I put some files in it but today when I tried to open my drive it says  Mac cannot read this. But the files in drive is very important because of that I can't initialise it please help to open my ha

  • N97(mini) charging problem

    MY MOBILE NOKIA N8(MINI) IS UN ABLE TO CHARGE PROPERLY.. I JUST BOUGHT IT AND AFTER TWO DAYS IT IS NOW WORKING PROPERLY .. WHAT IS THE PROBLEM SHALL I CHANGE BATTERY OR I SHALL SEND IT TO THE SERVICE CENTER . THE PHONE DOES OT CHARGE PROPERLY ..