01-28-2009 01:05 PM
I have found an interesting behavior in the Data Range:Maximum and Data Range:Minimum properties in LV 8.0.1. I have been looking around in a pretty complex application that I am maintaining but did not write to see if the strange behavior the customer is seeing intermittantly is due to our software or something in hardware and I found the following:
*There are some numeric controls which must have a max and min acceptable value for the user to enter which varies by type of UUT tested. The max and min values are in a data base and are pulled into the application by reading a TestStand FileGlobal array which was populated by an SQL query. The array has other things like label and units as well. The min value is the #2 item in the array and the max value is the #3 item in the array.
*During initalization of the user interface the max and min values are applied to the controls using a property node which sets the Data Range:Maximum to the #2 item in the array and the Data Range:Minimum to the #3 item in the array. The Out of Range Action:Maximum and Minimum are hardwired to the constant 1. ** The sentance above is NOT a typo, the Max and Min are really wired backwards!**.
*The code never passes back through this initialization code again during its execution but the numeric controls are updated by the user as needed.
This set up should produce erronious behavior such that it would have been fixed by now but in reality it seems that the values entered into the control behave as intended. That is to say that values larger than the intended max are coerced to the max and values less than the intended min are coerced to the min value. I was able to reproduce this in a simplified .vi by creating a reference to the control and supplying the reference to the property node. The reference and property node are inside a diagram disable structure. I enable the property node once when I load the vi so the numeric "inherits" the max and min behavior. I then disable the structure and the numeric behaves by coercing the too high values to the larger number and the too low values to the smaller number and leaving the values in the middle alone even though the max and min values are REVERSED on the property node!
I know this is a complicated mess but so is the application. Can anyone tell me if this is some kind of bug that might cause instability in the value if it was used as a setpoint for something or has NI put some smarts into the Range Data properties that in effect say "I know you ment to wire those the other way, I will use them as you intended not as you said."????
Here is a picture of my simulator.
Thanks for the help!
Tony
Solved! Go to Solution.
01-28-2009 01:37 PM - edited 01-28-2009 01:38 PM
LaVIEW will sort the inputs fo you so you get a valid range.
01-28-2009 01:54 PM
It appears that NI anticipated that some programmers will forget the order they placed things into an array and made at least this item smarter than the average bear. 🙂
Thanks,