VI for 18-48 48-18 value flip

Hello, I am looking for a sollution to my problem. I have a PID, and the output is 0 to 100%. The low position of the servo is 48, the highest position is 18. I would like to have a vi that corresponds to 0-100% to 48-18 range of values.

So 0-> 48 100-> 18.  I'm using the PID to EGU percentage, but it is does not seem to work with low value high and 48 18.

Or I need a vi that "flips" between 18-48--> 48-18.

I guess that's an easy task for experienced users.

He is a math problem.  You want a function f such that f (0) = 48, f (100) = 18.

We will choose the easier logic function, a linear relationship, who says that f (x) can be written f(x) = mx + b.  We will replace in extreme conditions and see if we can determine m and b.

f (0) = m * 0 + b = 48, b = 48

f (100) = 100 m + b = 18, 100 m + 48 = 18, 100 m =-30, m = - 0.3

It looks like f (x) = - 0.3 x + 48 should work, that is, if we set 0, we get 48 and if we put in 100, we get 18.

Let's try with 0, 50, and 100.

f (0) = 48 (it was easy and 'correct')

f (50) = - 15 + 48 = 33 (OK, we knew that before)

f (100) = - 30 + 48 = 18 (also "correct").

If f (50) has a meaning?  50 is to halfway between 0 and 100, and 33 is located at between 48 and 18, then maybe it does.

Now, write a LabVIEW Subvi that supports x (which should be between 0 and 100 - you might want to think about adding code to deal with numbers outside this range, either by throwing an error, 'compel' values in this range, or whatever you think is appropriate) and display the position of the Servo.

Bob Schor

Tags: NI Software

Similar Questions

  • For loop tunnel exit "Last value" output of default values

    Salvation OR community,

    Today, I came across a probem of LabVIEW stange. A tunnel of release of "Last value" to a for loop back the default values instead of the last real value. The code is below:

    Below as screenshots of probes 44 and 45.

    When the probe 44 contains al the data (all the planks are present (and the correct "Testrack Module" is used)) probe 45 is empty.

    I already tried to remove the complete thread and it rewire. The result was the same.

    However, I also tried to use registers with shift instead of the tunnels and the code works now (see below for the code).

    The used version of Labview is 2013 SP1.

    I hope you can help,

    Tim

    Edit: If the images are too small, you can drag it to a new tab, and they become the original size.

    Tim,

    My first assumption: the because the loop never executes as you pass an empty array to an entry of automatic indexation.

    Another option, which is difficult to see in the screenshot: are there two entries of tunnels over the probe nr 42?

    Norbert

  • How can I apply an opacity for the blending mode Script value?

    Hello

    How can I apply an opacity for the blending mode Script value?

    Is this something like?

    theLayer.blendingMode = BlendingMode.SOFT_LIGHT;  Add blendingMode with opacity for selected layers

    var opacity41 = opacity

    Thank you

    It seems that you have the right merge mode part. The other part of your question how to set the opacity of the layer value?

    It is like this:

    theLayer.property("Opacity").setValue (41);

    Dan

  • Check for multiple users with the value of the UID 0

    Hi gurus,

    The runclufvy.sh gives the warning below can I ignore this or need to fix for the installation of the 11202 RAC on RHEL 5?

    Check for multiple users with the value of the UID 0
    PRVF-4132: several users 'root, jnftsi0' with '0' the UID exists on "hwvpa6".
    PRVF-4132: several users 'root, jnftsi0' with '0' the UID exists on "hwvpa2".

    Thank you

    Hello

    The runclufvy.sh gives the warning below can I ignore this or need to fix for the installation of the 11202 RAC on RHEL 5?

    Check for multiple users with the value of the UID 0
    PRVF-4132: several users 'root, jnftsi0' with '0' the UID exists on "hwvpa6".
    PRVF-4132: several users 'root, jnftsi0' with '0' the UID exists on "hwvpa2".

    User jnftsi0 cannot be used by the Oracle Installer or start the Oracle process, because what is the root group.

    If the user jnftsi0 is used by Oracle install or start Oracle process should then be removed from the root group, otherwise you can ignore it.

    Kind regards
    Levi pereira

  • Can I use an alias for parameter such as 'The value of parameter value VI' entry in the palette of models?

    I played with the example Veristand 2015 "Set model Parameters.vi.

    Is it possible to use a parameter alias as the input string to the function 'Set parameter 2D Array Values.vi'? I tried to do this, but get the following error:

    Error 307662 has occurred to define model Parameters.vi > NI_VS ModelManager ExecutionAPI.lvlib: NI VeriStand - Set parameter 2D Array Values.vi

    Possible reasons:

    NEITHER VeriStand: The node is not found in the system.
    =========================
    NOR VeriStand: Could not find expression of parameter

    I am convinced that the alias has been implemented in the system definition correctly.

    If not, what the point of having an alias for parameter? Model workspace calibration controls don't seem to be able to use them. Am I missing something?

    Thanks in advance for any help on this matter.

    The alias parameter access is just for reading.

    To write to the parameter, you ned to use control of Calibration of model or the model parameters Manager API. Alias as the parameter cannot be used to write.

  • Look for the logic find the value of m and c of this equation y = mx + c.

    Hello

    I have 4 points for example = 3.38276, 0.375866 xi

    Yi = 3.37749, 0.281924

    using this tip, I want to find the value of m and c.

    You please suggest me some logic to solve this equation using labview programming.

    I tried with one solution, but in this case I do not have the correct answer. Here as an attachment, there is vi help I tried to solve my equation, but in this case the value that never got as a response it is dissatisfied with the equation, means if I replace the value of m and c eqation then it must be L.H.S = R.H.S, but I don't have the right solution.

    You please guide me.

    Thank you very much.

    Why do you think that the results are incorrect? I put your numbers in your code and the result on a XY Chart Wescott, I then bunk which with more than 20 values with a value ranging from 0.6 to 3.2 x and use factors calculated in your code to generate values of Y. The two overlap almost exactly...

    Mike...

    BTW: There is a linear adjustment integrated into LV VI

  • Financial statement for line above a certain value

    Hello

    How can I do for the analysis of an array of strings of x and are data and output the line containing the data exceeding a certain value. I have attached a vi that I started to work on, but don't know how to do for x and y of output data above - 80.

    Any help will be greatly appreciated.

    Thank you

    hiNi.

    LV82.

  • What are the optimal values for mac and arp timeout values

    Hi guys.

    What are the best values for 'mac address-table-time of ageing' and "arp timeout" by following scenarios? :

    -single sg300-10 as hosts Layer 3 - with a maximum of 10 local switch (directly connected)

    - and a 3750 x-stack with 100 local hosts + hsrp with a battery of the same kind

    or for asa 5520 as internet gateway for 500 customers?

    I use now a time of aging mac 300 seconds and a time-out of the arp of 3600 seconds.

    Is - this okay.?

    Thank you.

    These values should be fine. I don't know why the switch is layer 3 since you have of the 3750 and the ASA5520. If you start to see overflow errors, you should consider using the layer 2 switch.

    -Tom
    Please mark replied messages useful

  • How to select id when same id has several lines, but I'm looking for ideas lacking a particular value

    I have this my_table_c in the table with the values below

    SELECT * FROM my_table_c
    ID GROUP_ID GROUP_VALUE
    121
    332
    341
    541
    521
    222
    232
    241

    I'm looking for this output where to get only the ID that did not have group_id 2. Besides, I don't want to get the ID where group_id 2 is missing, but the other group IDS are present.

    Group_id if 2 is absent, it is my target id.

    So with the values indicated in the table above, I expect just ID = 3 or returned as other lines ID 1, 2 and 5 have each where group_id = 2.

    Can someone please help with a query to retrieve this result.

    Select *.
    Of
    (
    SELECT id, group_id, group_value, count (case when group_id = END 2 then 1) over (partition by id) as cnt
    of my_table_c
    ) where cnt = 0

  • Used in forms for rule of rounding decimal values

    I am trying to determine what district to separate the rule using forms of round numbers decimal, extracted from the database to display in a shorter length field. Specifically, when a number is equidistant from its neighbours (e.g. 0.5 is equidistant between 0 and 1), which rule is used to determine if she is rounded upwards or downwards (see this for a reference of the standard rounding rules)? The online help documentation addresses rounded, but does not specify what rounding rule is used (for example half away from zero, even half or 'Banker of the borough', etc.).

    I tried to figure this out by trial and error, but make me inconsistent results. Here's my test case...

    In the two test cases:

    Database field is NUMBER (20.4)

    Form field is numeric, length 30

    Form field format mask, programmatically, set is FM999G999G999G999G999G999G999G999G999G999G999G990D90PR (i.e., round to 2 decimal places)

    The form field displays the value of the field database directly

    Test 1:

    Database field value is 1.4445

    Result: The screen displays the value as 1.44

    Test 2:

    Database field value is 1,445

    Result: The field of the screen shows the value of 1.45

    It's completely inconsistent. If 'half away from zero' or 'half of the odd' district were used, then the value 1 of the trial must be displayed as 1.45 (because the last 5 will round the previous 4 to 5 and repeat). On the other hand, if 'half zero' or 'half similarly' district were used, the value of Test 2 should be displayed as 1.44.

    I understand that the values stored in the form are not rounded, and that this will not necessarily errors of calculation. However, it is necessary for purposes of documentation that I determine what the current rule used to display rounded values.

    I use forms GR 11, 2.

    I thought about it (by another user). My hypothesis rounded is not accurate: 1.4445 would like to round up to 1.44 mathematically, not 1.45 because 1.0045 is closer to 1 than 2. Therefore, Forms uses the standard rounded technology Oracle, which is:

    1. If n is 0, then ROUND returns always 0 regardless of the integer .
    2. If n is negative, then ROUND (n, all) returns - ROUND (-n, whole).
    3. If n is positive, then ROUND (n, integer) = FLOOR (n * POWER(10, integer) + 0.5) * POWER (10, - all over)

    Source: incompatible tie rounding rule used in Oracle Forms to the decimal values - Stack Overflow

  • Looking for a script based on values

    Hi all

    I was wondering if someone might be able to help with a script (I guess) to populate a field based on the value of another field.

    What I want is;

    If 'A field' had a value of 0.1 or 2 then 'field B' will automatically get a C

    If 'A field' had a value of 3 or 4, then 'field B' would get automatically a and B

    If 'A field' had a value of 5 or more then 'field B' will automatically get an A


    I know that this is probably a simple script but I have no idea how to reach and when I look at 'how to' books I can't understand how to create.


    Thank you in advance.

    Hello

    When you say: ".. masse automatically get a C' means 'field B' should get some 'field C' value present in pdf form or a string of characters "C"?

    Based on what I understand it please try the following:

    Set Variables for text fields

    var a = this.getField ("Text1");

    var two = this.getField ("Text2");

    if(One.Value == null)

    Two.value = ";

    ElseIf (one.value == 0 | one.value = 1 | one.value == 2).

    Two.Value = 'C ';

    ElseIf (one.value == 3: one.value == 4)

    Two.Value = 'B ';.

    ElseIf (one.value > = 5)

    Two.Value = "A";

    If you want to set the value on the basis of another value instead of the string, and then only the changes that you need to do is use the variable of this field.

    For example,.

    Another variable, the value

    var 3 = this.getField ("Text3");

    Two.Value = three.value;

    I would like to know if it works for you.

  • The call for objects with specific CMYK values?

    Hello

    I'm trying to create a script that seeks paths that have specific CMYK values within a document and then changes the opacity of this path. I can clarify that he only looks for objects that have a CMYK color, but not getting anything once I have try to specify CMYK values, that I'm looking.

    In addition, should I specify that the output will be a "new CMYKColor", or is it sufficient to say "paths [i].fillColor.back = 100.0", for example, in the output. Here's what I have for this particular function:

    var docRef = app.activeDocument; 
    var paths = docRef.pathItems; 
    
    for (i=0; i< paths.length; i++) {
    
    if (paths[i].fillColor.typename == "CMYKColor" ) {
    
    if (paths[i].fillColor.cyan == 0.0 &&
    paths[i].fillColor.magenta == 0.0 &&
     paths[i].fillColor.yellow == 0.0 &&
     paths[i].fillColor.black == 20.0 &&
     paths[i].opacity == 100.0) {
    
    var NewColor = new CMYKColor ();
    
    NewColor.cyan = 0.0;
    NewColor.magenta = 0.0;
    NewColor.yellow = 0.0;
    NewColor.black = 100.0;
    paths[i].opacity = 20;
    }
    
    else {
    alert ("Object(s) not recognized.")
    }
    
    }
    else {
    alert ("Object not CMYK.")
    }
    }
    

    Thank you.

    Hi Silly-V,

    No, it's isn't weird.

    Illustrator is a bit crazy. Most of the values should be rounded off during playback. (as in this thread: Re: working on a script that will add a new work plan and remove the old if it is not a specific size)

    And if Luis Oyola can do something like this:

    var docRef = app.activeDocument;
    var paths = docRef.pathItems;
    
    for (i=0; i< paths.length; i++) {
        if (paths[i].fillColor.typename == "CMYKColor" ) {
            if (Math.round(paths[i].fillColor.cyan) == 0.0 &&
                Math.round(paths[i].fillColor.magenta) == 0.0 &&
                Math.round(paths[i].fillColor.yellow) == 0.0 &&
                Math.round(paths[i].fillColor.black) == 20.0 &&
                Math.round(paths[i].opacity) == 100.0) {
                    paths[i].fillColor.black = 100;
                    paths[i].opacity = 20;
                    } else {
                        alert ("Object(s) not recognized.");
                        }
                    } else {
                        alert ("Object not CMYK.");
                        }
                    }
    

    Have fun

  • With the help of case condition for the date of distinct values is does not

    Hello PL/SQL gurus and experts.

    I use Oracle Database 11 g Enterprise Edition Release 11.2.0.1.0 - 64-bit Production version
    I followed two tables

    TT3-
    create table TT3(FeesCntlr,CommCntlr,LatePayCntlr,Name,Age) as select
    1,11,21,'Mike',25 from dual union all select
    2,12,22,'Clark',26 from dual union all select
    4,17,27,'Ussan',28 from dual union all select
    5,13,21,'Linda',29 from dual union all select
    6,14,24,'Obrek',35 from dual union all select
    7,15,25,'Batty',45 from dual union all select
    8,16,26,'Nicky',38 from dual;
    TT4
    drop table TT4;
    create table TT4(TRNID,BlockID,FeesCntlr,CommCntlr,LatePayCntlr,BookDate) as select
    221,625,1,11,21,20121101 from dual union all select
    223,625,2,12,22,20121101 from dual union all select
    224,625,1,11,21,20121101 from dual union all select
    225,627,4,17,27,20111001 from dual union all select
    226,628,5,13,21,20120701 from dual union all select
    227,628,6,14,24,20120701 from dual union all select
    334,628,7,15,25,20120701 from dual union all select
    339,629,8,16,26,20120701 from dual union all select
    393,629,1,11,21,20120701 from dual union all select
    432,629,2,12,22,20120701 from dual union all select
    347,629,1,11,21,20120701 from dual union all select
    556,629,4,17,27,20120701 from dual union all select
    558,629,5,13,21,20120701 from dual union all select
    974,629,6,14,24,20120701 from dual union all select
    976,629,7,15,25,20120701 from dual union all select
    980,629,8,16,26,20120701 from dual union all select
    1223,650,2,12,22,20110415 from dual union all select
    1224,650,1,11,21,20110415 from dual union all select
    1225,650,4,17,27,20110415 from dual union all select
    1226,650,5,13,21,20110415 from dual union all select
    1227,650,6,14,24,20110415 from dual union all select
    1334,650,7,15,25,20110415 from dual union all select
    1339,710,8,16,26,20120115 from dual union all select
    1393,710,1,11,21,20120115 from dual union all select
    1432,710,2,12,22,20120115 from dual union all select
    1347,710,1,11,21,20120115 from dual union all select
    1556,710,4,17,27,20120115 from dual union all select
    1558,711,5,13,21,20111231 from dual union all select
    1974,711,6,14,24,20111231 from dual union all select
    1976,711,7,15,25,20111231 from dual ;
    Now, if I use the following DML for the year 2012, then the result is as follows-
    SQL> select t3.Name,t3.age,count(t4.TRNID),count(distinct(BlockID)) from
      2  tt3 t3,tt4 t4
      3  WHERE     t3.feescntlr = t4.feescntlr
      4           AND t3.commcntlr = t4.commcntlr
      5           AND t3.latepaycntlr = t4.latepaycntlr
      6    AND t4.bookdate between 20120101 and 20121120
      7  GROUP BY t3.name, t3.age;
    
    NAME         AGE COUNT(T4.TRNID) COUNT(DISTINCT(BLOCKID))
    ----- ---------- --------------- ------------------------
    Mike          25              12                        3
    Mike          27              12                        3
    Batty         45               4                        2
    Clark         26               6                        3
    Linda         29               4                        2
    Nicky         38               6                        2
    Obrek         35               4                        2
    Ussan         28               4                        2
    
    8 rows selected.
    Now, if I use the following DML for 2011, then the result is as follows-
    SQL> select t3.Name,t3.age,count(t4.TRNID),count(distinct(BlockID)) from
      2  tt3 t3,tt4 t4
      3  WHERE     t3.feescntlr = t4.feescntlr
      4           AND t3.commcntlr = t4.commcntlr
      5           AND t3.latepaycntlr = t4.latepaycntlr
      6    AND t4.bookdate between 20110101 and 20111120
      7  GROUP BY t3.name, t3.age;
    
    NAME         AGE COUNT(T4.TRNID) COUNT(DISTINCT(BLOCKID))
    ----- ---------- --------------- ------------------------
    Mike          25               2                        1
    Mike          27               2                        1
    Batty         45               2                        1
    Clark         26               2                        1
    Linda         29               2                        1
    Obrek         35               2                        1
    Ussan         28               4                        2
    
    7 rows selected.
    But by using the condition if I use the following dml and results do not match-
    SQL> select Name,Age,sum(Trn),sum(CurYrOrdr) "2011 Order", sum(LastYrOrdr) "2012 Order"
      2  from
      3  (
      4  select t3.Name,t3.age,count(t4.TRNID) Trn,(case when t4.bookdate between 20110101 and 20111231 
    then count (distinct(BlockID)) else 0 end) CurYrOrdr,
      5  (case when t4.bookdate between 20120101 and 20121120 then count (distinct(BlockID)) else 0 end)
     LastYrOrdr
      6   from
      7  tt3 t3,tt4 t4
      8  WHERE     t3.feescntlr = t4.feescntlr
      9           AND t3.commcntlr = t4.commcntlr
     10           AND t3.latepaycntlr = t4.latepaycntlr
     11    AND t4.bookdate between 20110101 and 20121120
     12  GROUP BY t3.name, t3.age,t4.bookdate
     13  )
     14  group by Name,Age order by Name,Age;
    
    NAME         AGE   SUM(TRN) 2011 Order 2012 Order
    ----- ---------- ---------- ---------- ----------
    Batty         45          8          2          2
    Clark         26          8          1          3
    Linda         29          8          2          2
    Mike          25         14          1          3
    Mike          27         14          1          3
    Nicky         38          6          0          2
    Obrek         35          8          2          2
    Ussan         28          8          2          2
    
    8 rows selected.
    As the expected output, that I expect - is
    ----------------------------------
    
    Expected Output -
    NAME         AGE      "2012 TRNID"       "2011 TRNID"     "2012 ORDERID"     "2011 ORDERID"
    ----- ---------- --------------- ----------------------------- ---------- ------------
    Mike          25        12          2               3          1
    Mike          27        12              2          3          1
    Batty         45        4               2              2          1
    Clark         26        6               2              3          1
    Linda         29        4               2              2          1
    Nicky         38        6               2              2          1
    Obrek         35        4               2              2          1
    Ussan         28        4               4              2          2
    I sincerely thank each of you in advance for the input/comments that I fight with it for some time now.
    Kindly help.

    user555994 wrote:
    Hi JAC
    Thanks for the comments and certainly once I comment out the following line.
    - AND t4.bookdate between 20110101 and 20111120

    then the values are adapting, but at the same time why do we need to comment the date range condition as case is just a filter and not the condition.

    filter should be-

    AND t4.bookdate between 20110101 and 20121120 --"made it 12"
    
  • For each function with a value of Concat

    Hello:

    The scenario is, need us two elements unbounded concat and map it to an element target using for each feature.

    For example

    < bookStore >
    < book >
    Name1 < name > < / name >
    author1 < author > < / author >
    < ID > 1 < / BookId >
    < quantity > 2 < / quantity >
    < price > < price / >
    < status > < / status >
    < book >
    < book >
    name2 < name > < / name >
    Author2 < author > < / author >
    < ID > 2 < / BookId >
    < quantity > 2 < / quantity >
    < price > < price / >
    < status > < / status >
    < book >
    < / book >

    I need concat 'Name' and 'Author', which is under the element without terminals "Bookstore" and map it to a single element called "Sample" on the target side.

    I am not able to use the XSLT "for-each" function to get the multiple value of the name and author, because the concat function is used. Y at - it another way to concat and get the different values of the element 'Name' and 'author '?

    Concerning
    RK

    Maybe that's what you want...

    
    
    
    
    
    

    See you soon,.
    Vlad

  • Install a custom configuration for ESXi Installer for server 28 - Scsi.CRTimeoutDuringBoot value to 1

    Hello

    First off I will say that I installed ESXi 4.1 in about 6 servers to date.  I have a large ESXi Cluster that contains the MSCS virtual machines.  I have the problem that described in http://kb.vmware.com/selfservice/microsites/search.do?language=en_US & cmd = displayKC & externalId = 1016106.  Now, workaround for the value Scsi.CRTimeoutDuringBoot value 1 works fine and shorten time of start of 40 + minutes to 8 minutes after post.  Now, what to install it?  Well, they suck.  Basically before you can actually adjust this via the gui VI client, you must go through 2 trunk of ESXi 4.1 (1 ffrom the CD and 1 after initial installation).  So, basically, to install ESXi on servers 1 takes me about 2 hours.  That sucks.  Anyone know how I can make a customized CD that includes the fix 'Scsi.CRTimeoutDuringBoot value to 1' already?  28 more servers to go and I'm not looking forward to that!  Please help...

    Brett

    And some good links here

    http://www.virtuallyghetto.com/2010/11/how-to-inject-custom-drivers-into-ESXi.html

Maybe you are looking for