LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Numeric control - using data entry limits with global variables

Solved!
Go to solution

Hi!

 

I have a SubVI with several numeric control sliders. These control framerate, pixel clock and exposure of a camera, and their min/max/increment change every time one of them is changed - they are interdependent and get their information from the camera continuously during run-time.

I'm trying to remote control this VI, but when I pass a value using global variables, it doesn't "stick".

 

Example:

The allowed value for exposure is 237.48 ms. Different values are coerced to the nearest allowed value. So if I pass 240.00 ms to the SubVI, it should know that this is not a valid value and change to 237.48 ms.

But it doesn't do that and I don't know why. When I enter the values manually, it works just fine.

 

Any suggestions?

0 Kudos
Message 1 of 5
(3,572 Views)
Solution
Accepted by topic author joptimus

The limits on the controls only apply when controlling them from the front panel and not when passing the values in through the connector pane.

You should use something like 'in range and coerce' inside the VI to validate the values coming in are within range (perhaps coercing the data or returning an error).


LabVIEW Champion, CLA, CLED, CTD
(blog)
Message 2 of 5
(3,563 Views)

Hi joptimus,

 

the control's valid range and rounding options set in the control property dialog ONLY applies, when the use is inputting values in the front panel.

These settings do NOT apply when the value comes from a wire (aka MainVI)!

 

When you want to limit your values to certains setpoints you need to apply your own program logic to do so!

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
Message 3 of 5
(3,555 Views)

Thanks guys, that explains a lot 🙂

0 Kudos
Message 4 of 5
(3,534 Views)

@joptimus wrote:

Thanks guys, that explains a lot 🙂


And to to put a ribbon on the package...

 

Yeasr ago in VI far far away the limits for a control called as a sub-VI were applied. But somewhere around LV 6, NI tossed that behaviour in the interest of improved performance.

 

I think it ws a good move becuase in most cases the limit checking is not required and the it slowed down passing data into a subVI.

 

Done with the trivia,

 

Ben

 

 

Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
Message 5 of 5
(3,508 Views)