LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to save a value change without leaving the control

Hi everybody,

 

I have a problem with an event structure. In fact, I have some value change events on string controls and in order to save data, I use an event (which is triggered by an option on a custom menu or by Ctrl+S). For example, when I am writing something in a string control, if I click on the save option or use Ctrl+S without leaving the string control, the data from this control are not saved.

 

I understand that the save event is executed before the string control event but I would like to know if there is a way to fix my problem.

 

Thank you in advance for your answers !

0 Kudos
Message 1 of 12
(3,226 Views)

It is nothing to do with event structure, its to do with your string control. Select this option: http://zone.ni.com/reference/en-XX/help/371361J-01/lvhowto/update_value_while_typing/


CLA CTAChampionI'm attending the GLA Summit!
Subscribe to the Test Automation user group: UK Test Automation Group
0 Kudos
Message 2 of 12
(3,217 Views)

Thank you for your answer.

 

I know this option, but I just hoped that there was an other way to fix the problem because the event of the string control may trigger an error depending on the value of the string and I don't really want to pop an error each time the user type a letter.

0 Kudos
Message 3 of 12
(3,210 Views)

Ok.

One method I can think of is:

Set the update value while typing to true (property node) in your Ctrl + S case and then read the value and then set update value while typing back to false again.


CLA CTAChampionI'm attending the GLA Summit!
Subscribe to the Test Automation user group: UK Test Automation Group
Message 4 of 12
(3,194 Views)

I tried your method. It works but there is another problem. To complete my explanation, I have a VI which contains the save event, and this VI uses a subPanel to execute a subVI which contains the string controls (which needs to match a regular expression). So I need to use a global value in order to know in which control the user is typing. But there is a lot of string controls, so that means that I have to wire each control to the global value (because each control triggers an event). And It might take a lot of time, can you think of another way ?

 

I am sorry to bother you.

 

Thank you.

0 Kudos
Message 5 of 12
(3,179 Views)

Ok.

One other way I can think of is to enable update value as you type and then to filter out unwanted value change events. Something like this: http://forums.ni.com/t5/LabVIEW/Labview-slider-event-handling-problems-revisited/td-p/208121/page/2

You may have to use the mouse leave event instead.

More examples can be found here: https://www.google.co.uk/#hl=en&tbo=d&sclient=psy-ab&q=ignore+multiple+event+for+slider+labview&oq=i...


CLA CTAChampionI'm attending the GLA Summit!
Subscribe to the Test Automation user group: UK Test Automation Group
0 Kudos
Message 6 of 12
(3,157 Views)

Alright, thank you for all your answers.

 

I can see than in all cases (except the one where the only thing to do is to use the update while typing option), the references of the controls are used, so all the events triggered by the controls needs to be modified (even if it is just to add a wire for the reference). In my case, it will just take to much time (yes, I have that much events... Smiley Sad).

0 Kudos
Message 7 of 12
(3,147 Views)

We may be able to provide some more information if you can post your code / or even a simplified version of it.


CLA CTAChampionI'm attending the GLA Summit!
Subscribe to the Test Automation user group: UK Test Automation Group
0 Kudos
Message 8 of 12
(3,144 Views)

Ok.

 

I am goign to make a very simplified version of my code and post it.

0 Kudos
Message 9 of 12
(3,138 Views)

Here is a very simplified version of the code. You need to launche Parent.vi, then go to (the menu is in french) Fichier -> Ouvrir. The subVI is opened in the subPanel, then for example if you type something in "Chaine 4" and use Ctrl+S without leaving the "Chaine 4" control, the value won't be saved in the "File.bin" file.

 

In order to understand my problem, you need to imagine the subVI with much more string controls (therefore muche more events). I mean, much more than you can actually imagine... I have my reasons for having used so many string controls.

0 Kudos
Message 10 of 12
(3,118 Views)