Graphics

 View Only
  • 1.  range in xpression using visual logic

    Posted 05-29-2019 06:22

    Hello Experts,

    is there any way to out range value using visual logic in xpression . like.... if out range is 0-100 and input range is 0-200 then when i input 50 the out range should be 25 likewise when i put 100 then out range need to be 50... etc... i didnt get any range node in xpression thank you ...  



  • 2.  RE: range in xpression using visual logic

    Posted 05-29-2019 09:36

    Well... While a range block would definetly be usefull...
    In your case it's a simple math sollution (and I assume most of these functions could be solved as such).

    But in this case, it would be just a simple divide by 2 and you'd get your answer wouldnt it?

    100 = 50
    200 = 100
    10 = 5
    30 = 15

    So on so forth?
    The only problem I can see is if you input 0 perhaps?


    #XPression


  • 3.  RE: range in xpression using visual logic

    Posted 05-29-2019 11:05

    yeap i was searching for range block but didnt find it on function blocks.. and as per 100=50 and etc this just example and yeap i can divide with it but i was searching that block which can convert upon range what i input it .... is there any block there in xpression. you mention range but didnt find it can you please suggest more about it thank you ...


    #XPression


  • 4.  RE: range in xpression using visual logic

    Posted 05-29-2019 11:09

    what if i put  101 what if i put 102 ... each and every time i need to divide when i chance input value but there should be range block to convert it. but still iam searching it .


    #XPression


  • 5.  RE: range in xpression using visual logic

    Posted 05-29-2019 11:35

    As I said, there is no "range" block as far as I know in Xpression.

    But if you have an input range of 0-200, and your result should be in the range 0-100 all you need to do in your example is to add a DIVIDE by 2 in visual logic in between. And you will get exactly what you want as a result.

    101 = 50.5
    102 = 51
    50 = 25
    72 = 37,5
    0 = 0 (i tested)
    200 = 100

    No matter what you put IN will divide by 2, and give you the correct OUT in this case.
    In THIS case it can be solved by a divide, nothing more, nothing less...


    #XPression


  • 6.  RE: range in xpression using visual logic

    Posted 05-29-2019 12:38

    All in all... A "range" block would be the same as a %-block...
    Find % of X, this should be the same as X% of Y-value...
    So while there is no "range" block. We can create our own range using maths...

    Example:
    If you have 50 out of 200, that is the same as 25% of 200.
    25% of 100 = 25.

    If you have 100 out of 200, that is the same as 50% of 200.
    50% of 100 = 50.

    Sollution:

    1. Find the % of the value you have, based on the max value.
      (50/200)*100 = 25. --- This means that 50 is 25% of 200.

    2.  Take the max value of the range you end up with. Divide by 100, and multiply by the % you got in step 1.
      (100/100)*25 = 25. --- 25% of 100 is 25.

    Now you can change the max value of your input-range (200), and you can set the max value of your output range (100) as you see fit, and you will allways get the correct result in the end.


    #XPression


  • 7.  RE: range in xpression using visual logic

    Posted 06-12-2019 18:38

    thank you i will give try now 


    #XPression