LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Problems with data range/increment in numeric control

Hello everybody,

I found a problem with numerical controls:
In the applied example I change the datarange and value of a numerical control according to a user choice. When I select "PCS400" (see example) I can set values between 0.1 and 5.0 with increment 0.1. Then I change to (let's say) DPI500 with programmed values of 400 to 1000 with inc of 100. Then I try to change the tolerance and get values of 605, 705 and so on instead of 600, 700,... Then I select EPK3X with same range and inc and the tolerance values are ok, when changed.
Why is this? How can I avoid this behaviour?
A question to NI: First I used unit Pa for the tolerance control. Then I have to give the property "value" as constant with unit
Pa (or compatible), but data range/inc as values without unit. When the user changes the unit I get totally wrong values (example: 400 bar instead of 400 Pa as minimum). Why is the datarange/inc without units, when the control uses one?
Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 1 of 6
(3,623 Views)
Hi GerdW

This is a normal way of working.
If you want your increments to go from 100, 200 etc instead of 105, 205 etc.. you need to set the minimum value either at 0 either at 100 : it must be a multiple of your increment, otherwise you have this offset that bothers you.

Cheers
Doc-Doc
http://www.machinevision.ch
http://visionindustrielle.ch
Please take time to rate this answer
0 Kudos
Message 2 of 6
(3,623 Views)
Hello Doc-Doc,

I set the minimum to 400 and the inc to 100: so how do I get values of 605 etc.? (Look into the example please.) Do I have to set the properties in a special order?

Best regards,
GerdW
Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 3 of 6
(3,623 Views)
Hello Doc-Doc,

I also attached a picture for demonstration.

Best regards,
GerdW
Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 4 of 6
(3,623 Views)
This has to do with the order you setup the properties.

You set the order as "min, max, inc, value".
So for example, if currently the values are "0.1, 5, 0.1, 0.3" and you try to change them to "400, 1000, 100, 500", then the minimum will be set to 5 instead of 400. At the instance you try to set the minimum to 400, the maximum was still 5, so the minimum value is coerced to 5. And thus you get the values like 605.

One way to correct your problem here is to include the property nodes in the case structure, and set them in different orders for different cases.

Dan
Message 5 of 6
(3,623 Views)
As a suggestion for NI, it'd be nice if an error code number greater than zero can be set in the error out when the property value is coerced. And keep the error boolean false so it returns as a warning not an error.

Dan
0 Kudos
Message 6 of 6
(3,623 Views)