LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

String Control shortcut menu Paste Data doesn't trigger value change event

Solved!
Go to solution

Ctrl + V works fine, but paste using Runtime shortcut menu => Paste Data doesn't trigger value change event when I set the string control to "Update Value while Typing".  It's the default shortcut menu.

 

Is this the expected behavior?

 

LabVIEW 20.0f1 32bit

Windows 7 Pro SP1 64bit OS

 

Currently, I'm using shortcut menu selected event in addition to value change event as workaround.

 

George Zou
Message 1 of 8
(2,800 Views)

Works OK for me.

"If you weren't supposed to push it, it wouldn't be a button."
Message 2 of 8
(2,755 Views)

It seems there is one more condition:

the data is from the OS clipboard, copied from other applications.

 

If you use CopyData before PasteData, then it works.

 

Also tested on Windows 10, LabVIEW 2019

and Windows 7 Pro. LabVIEW 2014

 

George Zou
0 Kudos
Message 3 of 8
(2,749 Views)

I can reproduce this easily (LV20, 64 bit).

 

Steps:

Make a new VI.

Put a string on my FP.

Set it to update while typing.

Add an event structure.

Change timeout event to the string's value change event.

Run the VI.

Copy text from notepad.

Select the "Paste Data" right click menu of the control.

 

The data is pasted, the event is not triggered.

 

Indeed, Copy Data followed by a Paste Data does trigger the event. CTRL+C from LabVIEW, then a Paste Data does not.

 

EDIT: However, Copy Data from another LabVIEW control, then by a Paste Data does trigger the event.

 

Message 4 of 8
(2,728 Views)

When you use a right click context menu, that event is listed "Shortcut Menu Selection" in the Edit Events Window. This is a separate event setting from Value Change Event. 

 

Setup the Shortcut Menu Selection and see what happens. Open your Event Inspector Window to see what event fire.

 

Opps, You already say your using Shortcut Menu Selection as a work around but its the correct way.  

Message 5 of 8
(2,641 Views)

Thanks you for your opinion.

 

I'm using the shortcut menu event as a workaround.  But it's not intuitive.  Because value does change.  So value change event should be triggered in addition to shortcut menu selection event.

Besides, value change event is the mostly used event, and already used in most case.

 

George Zou
0 Kudos
Message 6 of 8
(2,633 Views)

OK, after playing around with the Event Structure, even an Indicator wired inside the Structure reads old data. (I'm using a text indicator).

 

Create a Text Control value change event. Place a text indicator inside the Event Structure wired to a Text Control outside the Event Structure. 

 

Make a new change each event your will see the values lag behind by 1 event. I'm using LV2019... I can't tell you if it should work this way, I didn't expect that.

 

You will see the NewVal ==String Control and OldVal == String Indicator... Since String Control is wired to Strin Indicator, I expected Control and Indicator to match.  SMH.

0 Kudos
Message 7 of 8
(2,625 Views)
Solution
Accepted by zou

@richjoh wrote:

Opps, You already say your using Shortcut Menu Selection as a work around but its the correct way.  


I hope you mean that is a correct workaround?

 

I don't see how this isn't a bug that needs to be fixed, if that's what you're saying.

Message 8 of 8
(2,579 Views)