02-18-2016 07:08 AM
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?
Solved! Go to Solution.
02-18-2016 07:16 AM - edited 02-18-2016 07:17 AM
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).
02-18-2016 07:19 AM
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!
02-18-2016 07:53 AM
Thanks guys, that explains a lot 🙂
02-18-2016 12:00 PM
@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