Jump to content
News about the LabVIEW Wiki! Read more... ×
jackscl

Terminals can't pass current value in event case

Recommended Posts

image.png.c9dd5b3c7373fe72ef8a2a7ff01ba9c9.png 

It's a very easy event case.

The problem is that the String to write (hex display) terminal passes the old value rather than the new value to the String out on my boss's computer when I clicked COM Write Button.But the problem never happens on my computer.Our computers' environment both are win7 and LabVIEW2014-Chinese.

Is there anybody can explicate this phenomenon? Thanks.

Share this post


Link to post
Share on other sites

Please post your actual VI. This will allow us to see if there is race condition or other problem.

Thanks

Benoit

Share this post


Link to post
Share on other sites
1 hour ago, Benoit said:

Please post your actual VI. This will allow us to see if there is race condition or other problem.

Thanks

Benoit

Maybe the mouse down event and the button's mechanical action is the reason? I like using value change event in my code. It's a Retired colleague's program,I delete the subVIs which the company doesn't want show.

Test.vi

Share this post


Link to post
Share on other sites

Here is the problem.

When displaying in a Hex format, the update value while typing cannot be activated.

Since the value is updated only when you click somewhere else on the front panel, if the first click is on the button COM Write, the value is updated after the Event mouse down is fired.

Benoit

  • Like 1

Share this post


Link to post
Share on other sites
1 hour ago, Benoit said:

Here is the problem.

When displaying in a Hex format, the update value while typing cannot be activated.

Since the value is updated only when you click somewhere else on the front panel, if the first click is on the button COM Write, the value is updated after the Event mouse down is fired.

Benoit

Thank you very much. I find if i use value change event,it will be pass current value.(I usually use it).I will search the different between value change and mouse down.

Share this post


Link to post
Share on other sites

The difference is that Mouse Down is generated first for the control that the user clicks on, then if that processes successfully the Key Focus is changed to the new control which commits the value to the control that had previously the Key Focus, which results in the Value Changed event for that control.

So at the time the Mouse Down event is processed, the Value Change event for the previous control has not been processed yet. When you use the Value Change event for the button instead, it is guaranteed that the Value Change event for the string that is a result of loosing the Key Focus for that control, has been already processed.

Edited by Rolf Kalbermatter

Share this post


Link to post
Share on other sites
12 hours ago, Rolf Kalbermatter said:

The difference is that Mouse Down is generated first for the control that the user clicks on, then if that processes successfully the Key Focus is changed to the new control which commits the value to the control that had previously the Key Focus, which results in the Value Changed event for that control.

So at the time the Mouse Down event is processed, the Value Change event for the previous control has not been processed yet. When you use the Value Change event for the button instead, it is guaranteed that the Value Change event for the string that is a result of loosing the Key Focus for that control, has been already processed.

Thank you for your explanation.I get it.I will convince my boss.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×

Important Information

By using this site, you agree to our Terms of Use.