using keydown to trigger an event

Hi all

This is my first question on this forum, and that's probably because I just started learning labview.

I came across a mistake, I could probably solve in another programming using C language, but not in labview.

I was wondering if someone could give me a hand with the following:

I joined the program, which is probably a bit poorly written. Basically, what im try it with the part on the left is read all the values of a controller on a GPIB bus.

This part works like a charm, because I get all the values that I want without any problem. After that, in the last stage of this program, you have a while loop with here a structure of the event. The reason why I took a time to do this is because I don't want the program to start again at step 1. The structure of the event has been used with the mouse clicks on buttons and a value changed with digital controls. Because a changing value didn't work, cause the loop has been constantly reading the values from the initial stages, I wanted to change the way events were handled by a keydown by "Enter". I think that when you change a value in a numeric control and press on enter, this could be perfectly used to trigger events, rather than the exchange value (because every time the program reads the values on the sides, I think that its considered a change in value). The fact is that I don't really have an idea how to use the keydown as a handler, info on this would be greatly appreciated.

I'm sorry if my English isn't the best, it is only my 3rd language. Hope you understand, and I can get help for this question

Thanks in advance

Dashing Thomas

Student

Tags: NI Software

Similar Questions

  • Define a variable with the position of an item and use it to trigger an event

    Hi Edge-heads,

    I want to use the position of a movable object to trigger another object to hide/show.

    I tried implementing a variable using jquery. position() and then by testing this variable.

    It is in compositionReady;

    var pos = ("draggable") .position ();

    If (pos > = 850) {}

    SYM.$("obj1"). Hide();

    SYM.$("obj2"). Show();

    }

    This doesn't seem to work...

    Thank you

    Justin

    Have

    $(e.target) .parent () .position)

    Since you have a symbol empty div containing the image of caterpillar, caterpillars of target position is returned from the enclosing div which is always 0.

  • can I use a structure of the event in another structure of the event

    Hello

    Can use a structure of the event in another structure of the event?

    Thank you

    Viviane

    I would put your waveforms in the registers at offset.  You can then use your structure for the main event to trigger on the Show 1... the value change events and process the data, however you need from there.

  • Trigger several events to a dynamically saved value of signage

    I have different controls for some pumps.

    I want to stop all with an emergency stop button.

    I use the event Structures to manage the user controls.

    In the previous version of my code, I register all events statically in the same vi. But to make the program compact and modular, in the attached version of the code, I use the references to the controls, and I go to a Subvi. In the Subvi I record the events of these references and I link the "event recording refnum" to the terminal dynamic events of the Structure of events.

    Everything works with the exception of the emergency stop.

    I can't use a reference of the emergency stop button to trigger the event, because the emergency stop opens the other files in vi for further confirmation from the user.

    When the emergency stop is confirmed by the user, I use the value property of a signalling to trigger the event stop of all structures event of the subgroup on the screws that control the pumps.

    Previously, I had only a single value of signage to trigger several events, but I saw that I have create the condition of critical competition and the Structure of events first, which handles the event, removes it from the queue, and other Structures of the event can't get the event.

    So, I use as signals of many boolean value pumps as much as I.

    But it does not always raise all events.

    Another detail, it is that I do not use the "Unregister for events function" in all the screws under that have Structures of the event. I saw no difference with this function, or without him...

    Apparently, Miss a clue of a general principle of LabVIEW.

    I join all of the template project.

    The main.vi starts the program.

    The problem of this thread is re-posted more clearly and it is resolved here:

    https://forums.NI.com/T5/LabVIEW/static-vs-dynamic-events-some-dynamic-events-are-flushed/m-p/318239...

  • IMAQ Grab Acquire.vi error when you use an external trigger on a card NI PCIe-1433 (sync problem?)

    According to my recent post on getting up and running with the NI PCIe-1433 camera link card, I ran into a bit of a snag.

    When you use the internal trigger on the camera, everything works 100%. I can view all the data from the camera in MAX as well as in the labview project. However, whenever I have set the mode switch is where things start to fall apart.

    What I have confirmed:

    -Camera is switching between inside and outside triggering.

    -NI PCIe-1433 camera link card is set up properly. While in external mode, I can trigger the camera by using a function generator and check the wire to the MAX. Everything works fine.

    When the unit is in external mode, the function Acquire.vi enter IMAQ - my mistake VI. The error is:

    Code :-1074397150

    The possible reasons for a timeout.

    Now, I have it set up so that a mistake here will not end the LabVIEW file. Sometimes, data of interest makes however (about every 10 seconds-ish). So what seems to be the case, it's that this external trigger signal is not in the lineup when the clamp is attempted. Is it possible to synchronize these? May reference the trigger signal external sort in my LabVIEW project so that the clamp is performed only when that trigger impulses?

    So I solved my problem. He was in time. The external trigger that I used for the device was simply too slow. I was initially using a trigger from 2 Hz to be able to view the values changing on LabVIEW probes. But it was enough to get enough data to move above the camera cable to assemble a picture and kept it in time. Travel up to 9 kHz solved the problem. No adjustment to the camera settings or LabVIEW code was necessary.

  • How to use a Timer and an event with LIFA/Arduino

    Hello world

    I feel that my question is going to sound really stupid, but I can't find the solution. I want to use my arduino to do two tasks at the same time. I want to use a while loop with a timer, read my pins in my arduino. It's really easy. But then, I like to use as a case of event do different type of things. In the example, I downloaded, I just use an event to activate my fan. Again, I have no problem to use it by itself. But I can't find a way to use both at the same time, especially when I want out of my application. Because I use my arduino inside my event, I put it in an another while loop. But I want also an another while loop, but uses the clock. In my example, if you use the tool to highlight run, see you clearly that my signal goes the while loop that contains the case of the event, but not other things that I want to use it as a timer. That's probably because I missed something on the architecture, it's just to give you an idea. I just want to know what is the smartest way to combine my case of the event and my time in a loop using the timer and how to close them correctly. I'm not an expert in Labview, so it is a bit difficult for me. If my comments seems obscure, I'll answer all your questions without any problem.

    I thank very you much for your help and attention.

    FrenchLizard wrote:

    If you use the tool to highlight execution, you can clearly see that my signal goes the while loop that contains the occurrence, but not others

    Because of the LabVIEW data flow model: value of stop button is connected to the first loop for the second loop. You can see "How to stop several loops using the only button" then you can use any implementation. http://digital.NI.com/public.nsf/allkb/267704CDE91156D186256F6D00711AAE

  • How to use a structure of the event in a Subvi

    I am using a structure of the event within a Subvi.  The Subvi has a table constructor that built tables and the structure of the event is used so that when the program runs, it allows you to change the elements of the array.  It works, but when I apply within a Subvi, it does not work properly.  This goes into a Subvi, because it will be part of a much larger progrram, so it must be modular.

    If you are using a structure of the event, it is not a Subvi.  If you worry about modularity, you should not use the structure of the event.

    You seem to have a fundamental misunderstanding of modularity.  An event structure must be placed in a while loop.  If you have a while loop in a Subvi, you have transferred control of your program to the Subvi.  You are not at this stage modular.  Your higher level GUI has no control.  You would have to create a stupid system of variables to pass data down to the loop to stop the loop and return to your main VI.  This is not a good design decision.

    Instead of searching for a way to make something broken, you should spend effort trying to understand what you really want to accomplish.  You should also spend some time to learn how to work the event structures.

    This application is small at the moment and it is already on the way to the unreadable.  It's a terrible thing to do for you.  Break these habits now.  variables are only when absolutely necessary.  Using subVIs to accomplish individual tasks, do not run the entire application.  With the structures of the event, use a value of stop button change event for will not be held hostage to the time-out.  If your variable is '2' in it, you're doing something wrong.  It has to be something different between set points, put it in the name.  If you want to make the subVIs, create an icon.

    But first and foremost, invest time in understanding dataflow

  • Is there a way to trigger an event of the interface programmatically?

    Hi all!

    I'm practical with LabVIEW. Right now I'm dealing with events, the interface events (those that are associated with the controls and indicators) and the user (the ones I created) events.

    When a particular event occurs (not related to the interface), I need to run code that is the same whether I managed in a business event for an event of the interface.

    The question is simple: is there a way to "reuse" code used to manage the interface event it shooting programmatically after the particular event occurs, or I need to create a user with the same code event (wasting time, memory, etc...)?

    Thankz

    It depends on what is the event of the interface.

    If it's something like a button or a change in a digital control, you can use the Value property node (Signalling).  So if you want to simulate the pressure of a Boolean button, you can wire a Boolean constant True to the value of property for this Boolean control signaling node.

    If there are other types of events of the interface you want to manage as a mouse down, Panel reach,..., it might be a good idea to put your real code inside the user event and that the Interface event it has code that triggers the user event.

  • How do I step manually in code that uses a structure of the event, when I want to select a particular event?

    I use an architecture of producer/consumer for an application with a structure of the event in the upper loop. Events are triggered by the user from the control panel using Boolean switches that are "change when you press on" and "release switch. My question is how can I manually step through the code using various events? It doesn't matter what I'm still not in the same event.

    Thank you.

    You can view the code? Is what event still enter? I did have problems step by step in code that uses a structure of the event. You must be patient, but because the application is slowed down a bit and it can take a while to get into the case of the specific event depending on what events you deal. Usually, I place a breakpoint in the case I am interested and run the application as usual. Once I hit the breakpoint is when I turn on highlighting of execution.

  • How to use the structure of the event to sort the listbox data?

    I have a VI that contains two list boxes.  The two list boxes are selectable by the user.  This is how I want to interact.

    When the VI is initialized, the first list box will be filled with data.  If the user double clicks on a cell in the first list box, the second list box will be filled by a sorting of the information contained in the first list box a certain way.  I do not think that the details of how these data are sorted is pertainent here...  Then I want the user to be able to double-click on one of the lines in the second list box.  The double of the item clicked in the second list box will be used in an another VI which will then start.

    I have my VI of work such that the first list box will fill the second list box whenever the user double clicks on a cell in the first list box.  To do this I use a structure of the event.  Here is where the trouble begins.  I have a second structure of the event look for double clicks in the second list box, but when I do this, the program crashes.  In addition, I want only the user to be able to double-click on the second list box, if the first list box has already been double-clicked.

    Generally, my question really revolves around the use of the structures of the event in this application?  Can I use two structures of event at the same time?  Is there a better way to do it?

    No, you probably should not use two structures of different events. One, it should work fine.

    The Subvi immediately execute and return? If not and you have the front locked until the event finishes, which would explain what you see.

  • Error to delete using the Delete Trigger

    Hi people:

    I tried to use the following trigger. She inserts updates, okay, okay, but gives mutating table error when I try to delete the BALES_HARVESTED table...

    The trigger fires when an insert, update, or delete occurs.

    Table, the trigger is set at: BALES_HARVESTED

    Array that receives the entrance of the trigger (insert, update, delete): BALES_STORAGE

    The Code in the trigger that I use is:

    CREATE OR REPLACE TRIGGER FARM. HARVEST_DATA_TRG

    AFTER YOU DELETE, INSERT OR UPDATE

    WE FARM. BALES_HARVESTED

    REFERENCING NEW AS new OLD IN the old

    FOR EACH LINE

    BEGIN

    -your code here

    -(Relaxation model 'Default' could not be loaded.

    IF THE INSERTION

    INSERT into BALES_STORAGE (BALES_RECEIVED_GAINED, HARVESTING, CUTTING, STACKYARD, DATE_MOVED, HARVEST_ID, BALE_YEAR) values(:new.) BALES_RECEIVED,: new. CULTURE: new. CUTTING: new. STACKYARD,: new. DATE_RECEIVED,: new. HARVEST_ID,: new. BALE_YEAR);

    ELSIF UPDATE THEN

    UPDATE BALES_STORAGE

    SET BALES_RECEIVED_GAINED =: new. BALES_RECEIVED,

    CULTURE =: new. HARVEST,

    CUP =: new. CUT,

    STACKYARD =: new. STACKYARD,

    DATE_MOVED =: new. DATE_RECEIVED,

    HARVEST_ID =: new. HARVEST_ID,

    BALE_YEAR =: new. BALE_YEAR

    WHERE BALES_STORAGE.harvest_id =: old.harvest_id;

    ELSIF DELETION THEN

    REMOVE FROM BALES_STORAGE

    WHERE harvest_id =: old.harvest_id;

    END IF;

    END;

    /

    Matthewdelete_error.JPG

    Trigger for update to include all code...

    Is it possible to have a relationship of foreign key between two tables?

    Tables of mutation is not exclusively on the realization of DML on the same table that the trigger is, she also impact tables linked by a foreign key.

    You can consider a trigger made to postpone the operation until after statement.

    Google for "sample table mutation relaxation composed" and you'll find lots of examples

    HTH

    Connor

  • How to reach all children during the use of Propagation of the event?

    Hello

    I use the Propagation of the event in order to change the alpha of each child on MOUSE_OVER and MOUSE_OUT MOUSE_DOWN to help...

    evt. Target.Alpha

    More alpha of the child increases of 0-0.5.

    On OUT it is 0.5-0.

    On down, he goes to 0.5 and stays there even with a MOUSE_OUT.

    I want to do then is add a button to the main stage, that reduces the visibility of all children to 0, a base type of the clear button.

    I have a way to do where I list each child in a function (all 9!). But I can re - write this so that all children are required to write code so much?

    Ideally, I would like to send a request to find the number of children (9), then use this variable to write a function that says (where n is the name of the Instance of each child) than n(0-numChildren).alpha = 0

    Here is my code - very - long breath:

    clearBtn.addEventListener (MouseEvent.CLICK, ContainerAlpaReset, false, 0, true);

    musicContainer.addEventListener (MouseEvent.MOUSE_OVER, onMusicOver, false, 0, true);

    musicContainer.addEventListener (MouseEvent.MOUSE_OUT, onMusicOut, false, 0, true);

    musicContainer.addEventListener (MouseEvent.MOUSE_DOWN, onMusicClick, false, 0, true);

    var i: Number = 0.5

    function onMusicOver(evt:MouseEvent):void {}

    if (evt.target.alpha == 0)

    evt.target.alpha = 0.5;

    }

    function onMusicOut(evt:MouseEvent):void {}

    if (evt.target.alpha == I)

    evt.target.alpha = 0;

    else (evt.target.alpha = 1);

    }

    function onMusicClick(evt:MouseEvent):void {}

    evt.target.alpha = i + 0.5;

    }

    function ContainerAlpaReset(evt:MouseEvent):void {}

    musicContainer.n1.alpha = 0;

    musicContainer.n2.alpha = 0;

    musicContainer.n3.alpha = 0;

    musicContainer.n4.alpha = 0;

    musicContainer.n5.alpha = 0;

    musicContainer.n6.alpha = 0;

    musicContainer.n7.alpha = 0;

    musicContainer.n8.alpha = 0;

    musicContainer.n9.alpha = 0;

    removeEventListener (MouseEvent.CLICK, ContainerAlpaReset);

    }

    Is there a simple way to write the part in bold? That is to say:

    musicContainer. Children? .alpha = 0;?

    Or better yet, can I use numChildren count and then write a generic piece of code that adds each count to the n #?

    Thank you for all the answers!

    Try

    function ContainerAlpaReset(evt:MouseEvent):void {}

    for (var i: uint = 1; i<10;>

    musicContainer ["n" + String (i)] .alpha = 0;

    }

    removeEventListener (MouseEvent.CLICK, ContainerAlpaReset);

    }

  • using the structure of the event in the LabVIEW classes

    Hello

    I'm new in the use of LabVIEW classes, so don't know much how I can use them.

    In my main program, I have clusters with five elements in each. The elements are controls two States and in some groups, there are three States controls. The user will press the buttons (controls), and different things will happen. In my first program were I not using classes, I had a structure of the event and the controls were cases of event in the structure.

    Is it possible to somehow use an event of cases in one of the methods that is created in the classes, so that say, that's not in the main program?

    I have attached two photos: I wanted to have a structure of the event in servoTouchEvent (in left.tri.lvclass) who is a child.

    Let me know if my explanation is not clear.

    Grateful for the help!

    Hello

    Yes, you can have a structure of the event in a Subvi rather in your main VI of top-level UI. The trick is to use the 'Save for events' and passing in references to orders that you want to have the event trigger structure for. The refnum output since the function is entered in the terminal of dynamic event of the structure of the event who could live in a Subvi. You can add instances of event where you will see these control events as dynamic events then you can do something with. These excerpts from shows all the code in a simple diagram, but the stuff in the structure of disable diagram could easily transformed into a Subvi:

     

    All this can be done without classes. What will buy classes you include the ability to encapsulate your screws and also perform different code based on what object on the hierarchy of the parent-child classes is on a wire. If the behavior of your code is different between 2-3 State and controls (which I do not know what state controls 3 you are referring), you can take advantage of the classes.

  • Boolean switch until released by using a structure of the event

    I use a Boolean control with mechanical action to activate the button, I want to return to the original state.

    I use it in a structure of event defined to trigger a change in value. The action to push the button generates two events in the State on one and the other for when he returned to the stop State.

    How can I control this to prevent a single event is triggered and the second event which is put on hold until is ignored, I want the button to return to the original state and not to execute the code twice.

    Thank you

    Jim

    Right, I should have told latch.  Do not forget to place the control button somewhere it will be read to reset the latch.  It does not need to be connected to anything, just read.  Sitting inside the case of the event is very good if you do not use anywhere elsewhere.

  • Need to reset the button by default when you use the structure of the event?

    When you use the buttons with a mechanical action "releasing lock" to only trigger the same structure with the same 'value has changed', the button does not jump upwards as you would expect.  I can get to behave as I want by adding a "default reset" invoke the node, but this seems somewhat exaggerated.  Is there an easier way to get the button to jump to the top after pressing on?

    The button will reset once it is read by the code. This means that the terminal is inside the structure of the event. If you move outside the terminal, it would read only the beginning of the race and then never and it will not be reset.

    If the terminal is learn the structure of the event, it is read by the code (even if it is not connected to anything) and it reset as soon as the event has a chance to run.

Maybe you are looking for

  • programming of my mouse

    Hello, I just bought a very nice gaming mouse, it handles smoothly adjustable weight and is very quiet. The only problem I have is that I have no idea how program additional buttons. If someone saw this issue help will be appreciated.

  • charge indicator

    My hp probook 450 g1 has two sample no1 charge is orange and white 2. What they indicate.

  • the universal jump

    Hi all My program is 35 high and wide enough level VI.   During execution of the program that I pop up a windows progress bar that displays the current status, with this screen comes a Cancel button.  When a user cancels the task, is to force the pro

  • Windows 8 Pro gel on HP Pavilion dv7-1103ea

    Hello Just upgraded my HP Pavilion dv7-1103ea to Windows 8 Pro after using the overview of consumption and it keeps freezing for a few seconds every 5 or 10 minutes. He did it on the beta version as well but I thought it would be fair that the OS is

  • Make the OfficeJet Pro 8500 A909 series printer compatible with Windows 7 (64-bit)

    I was right, but he started from.  Could you please send me the link to make the printer compatible with my computer Windows 7 (64 bit) OJ Pro 8500 A909 series? Thank you