12-01-2023 03:31 AM
Hello everyone,
I would like to connect two numeric controls, meaning I need 2 controls on the front panel that will perform the same function. If I change the value of one of them, the other should automatically change as well.
Please note that one of these controls needs to be within a cluster (which I will define beforehand).
I am still very much a beginner in LabVIEW, so if you could send me a VI to show me a small example of an application, that would help me understand what I need to do.
Thank you!
Solved! Go to Solution.
12-01-2023 03:54 AM
Hi sasquatchd,
@sasquatchd wrote:
I would like to connect two numeric controls,
You cannot connect two controls as both are data surces. (THINK DATAFLOW!)
But you can set one control (using a local variable of that control) with the data of the other control.
And you can use an event structure to (re)act upon value changes of your controls…
@sasquatchd wrote:
I am still very much a beginner in LabVIEW, so if you could send me a VI to show me a small example of an application, that would help me understand what I need to do.
As a beginner you should take note of the Training resources offered at the top of the LabVIEW board - and all those example VIs in the example finder!
12-01-2023 04:50 AM
Can u send me an example who do this work please ?
12-01-2023 04:53 AM
@GerdW a écrit :But you can set one control (using a local variable of that control) with the data of the other control.
And you can use an event structure to (re)act upon value changes of your controls…
do u mean that I can change the value of the two controls by changing only one of them ?
12-01-2023 05:12 AM
I did this, for what I see it does what I want to do, but I dont know if it will always work
If u can verify it for me please
12-01-2023 06:34 AM
Hi sasquatchd,
@sasquatchd wrote:
I did this, for what I see it does what I want to do, but I dont know if it will always work
If u can verify it for me please
Basically you implemented what I suggested.
(You may delete the TimeOut event case and and a "Stop" button value change event case.)
Why do you fear the VI will not "always work"? Why should it fail after one hour?
12-01-2023 07:38 AM
@GerdW wrote:
Why do you fear the VI will not "always work"? Why should it fail after one hour?
Not after one hour, but after approx. 49.7 days, when the 2^32 tick counter will overflow... 😁
12-01-2023 07:44 AM
Hi GerdW,
Haha,
Why do you fear the VI will not "always work"? Why should it fail after one hour?
It's not about duration.
I was wondering if there is some prohibited cases for this VI, that's why i wanted to take your opinion
12-01-2023 08:03 AM
@sasquatchd ha scritto:
I was wondering if there is some prohibited cases for this VI, that's why i wanted to take your opinion
Yes, there is one. If you assign a value to one control via a local variable in another part of your program, the Value change event will not be triggered.
Those events will be executed, other than by direct user interaction, by a Value(signaling) property node assignment :
12-03-2023 02:13 PM
You can put multiple controls of the same data type in an Event case.
This prevents the maintenance problem of duplicate code.