NumericUpDown Minimum

I'm having trouble with my numericUpDown boxes. No matter what I have tried, the minimum value is always zero. I have tried setting the minimum to a Rapid variable (set at 1), to an application variable (set at 1) and just setting the value to 1. All attempts still see the box allowing the user to decrement down to zero, which is a problem as I have a trigger using the numericUpDown box's value to access an array (and rapid arrays start at 1 and give a "System.IndexOutOfRangeException" at zero).

I should point out that this is all through robotstudio, I haven't looked at the result when run on the physical controller.

Anyone got any ideas of what I'm doing wrong?

Comments

  • Abhishek PM
    Abhishek PM Bangalore


    Hello,
     
    May i know which version of RobotStudio you are using and with what controls has your screen been designed and based on what information is the event triggered.
    Are there any items in the array which are zero ?
     
    The behaviour as i see is if minimum value is been set the value does not go below it.
     
    Thanks

  • I am using robotstudio 5.14 currently, but also had this problem with 5.13. There are no items in the array at the zero position as RAPID as far as I know starts from 1 for arrays. The array is filled with nums (none of which are zero)

    PERS num numLayers{numZones} := [8,9,5,6,10,7,8,9,5,6,10,7,3,7,3,7];

    where the index is taken from the NumericUpDown so that I use numLayers{thisLayer} where "thisLayer" is the same as the value in the NumericUpDown.

    Resident2011-07-12 03:52:48
  • Nobody has come across this before? Could someone please quickly test this to see if it is always an issue or just my computer?
  • Hello:
     

    This is a known issue and will be fixed in a future release. There is a workaround of using action triggers ( described in release notes also). Thank you

     

    From release notes


    *Data Binding to an index of array item

    The data can be bound to index of array item, but the binding mechanism does not work at run time for the index. Use Action Trigger as a workaround. Use Application Variable to bind to index of array.<?: prefix = o ns = "urn:schemas-microsoft-com:office:office" />

    So when index value changes notify Action Trigger control (by triggerring signal or RAPID bool), which writes the index value to application variable.

    Since, application variable is bound to index property, the array item changes.

  • Hi,

    Thanks for the response, but that is not the issue. I am already doing as you suggested to allow it to allow access to an array by using the index as set in the NumericUpDown. The problem is that I cannot seem to set the minimum property on the NumericUpDown to stop it decrementing to zero, which causes an index out of range exception when the associated trigger tries to access the array at the position zero. Every other part of this NumericUpDown works, i.e. it can happily access the data in the array. The only problem is that it will decrement to zero, even then the "minimum" property is set to 1 (it ignores the value set in the minimum property)
  • Abhishek PM
    Abhishek PM Bangalore


    Hi,
    Could you please verify what is the default value of the index when the array is bound. Is it similar to the screenshot as shown below. Would it be possible for you to share your issue with a simple screenmaker project.
     
     
     
     
     
    image
     
    Thanks
  • Hi Abhishek,

    I made a test station and GUI that shows the problem (http://forums.robotstudio.com/webwiz/3979/ArrayTest.zip).

    As you'll see, the minimum property on the NumericUpDown is set to '1' but it can still increment down to zero which when an associated trigger accesses the elements of an array, this causes an Array index out of bounds exception.

    Any help you could provide would be very appreciated.

    Regards,
    David.
  • Abhishek PM
    Abhishek PM Bangalore


    Hello David,
     
    I had a look at your project.
    You can bind the minimum value of the numericupdown to an application variable or rapid data instead of specifying the value directly.
    This should not cause Array Index out of bounds exception.
    Hope this helps.
     
    Thanks
     
Sign In or Register to comment.