How do you subtract different values for specific array elements?

Hi LabVIEW Community,
I am new to LabVIEW and Im working on my first application. One of my challenges that I am having problems solving is how to  subtract specific values from specific elements in an array.
My aplication is to measure the distance between a sensor and a magnet, however the initial distance for each sensor  to magnet is different. I have converted the voltage to a distance using the Math Node for each element and now need to  correct these values by subtracting their individual initial value.
The source is a 1D array of DBL64  consisting of 32 elements and each of these values needs to have a different value subtracted.
eg:
Element 1 - 5.557
element 2  - 2,34
element 3 - 7,654  and so on
I have tried to seperate (index the array) and subtract the values from each element and then combine them again. This has not been effetive. I need to write these values to an .txt file and also use them in another calculation.
I have attached my attemted sub VI.
Any advise would be really apprecieated.
Solved!
Go to Solution.
Attachments:
Sub VI Split Array_Correct Distance.vi ‏36 KB

You don't need to overthink it. There's a really simple method. Generate an array that contains all your offsets you want.  Then subtract it off.
It's the same VI with this change:
Attachments:
Sub VI Split Array_Correct Distance_LV12_MOD.vi ‏24 KB

Similar Messages

  • How do you set RGB values for colors in Numbers?

    We are trying to set a specific RGB value for the background cell shading in Numbers.   Please help me on how to accomplish this?

    And another way is with short scripts.
    This one gets the RGB values of the background color of a selected cell:
    --get background color of cell -- like a "dropper"
    --if none set, returns 'missing value'
    tell application "Numbers" to tell front document to tell active sheet to tell (first table whose class of selection range is range)
              tell the first cell of the selection range
                        set bkgrRGB to its background color
              end tell
    end tell
    And this one sets the background color of selected cells to the RGB values defined in myBackGroundColor:
    --sets background color of a cell
    property myBackgroundColor : {8607, 65513, 1548}
    tell application "Numbers" to tell the front document to tell active sheet to tell (first table whose class of selection range is range)
              repeat with aCell in the selection range
                        tell aCell
                                  set its background color to myBackgroundColor
                        end tell
              end repeat
    end tell
    SG

  • How do you assign a value for Products in a Pop-up menu?

    I am preparing production cost spread sheet. In one column I2 - I have a pop up menu with lamination types to be selected - ie: None, Standard Film, Vehicle Film, Liquid Coating. I want to be able to associate values of these costs in column J2 - On another table (Laminating Costs) I have set values for each product ie: None = 0, Standard Film = $1, Vehicle Film =$2 and Liquid Coating =$0.5 -
    Therefore if I select Liquid Coating from the from the Pop-up menu in I2 on the main spread sheet - I want to see the associated cost of $0.5 appear in J2 by referencing the Laminating Costs table - I have tried various SUMIF formulas with no luck - Could someone point me in the right direction please.
    Thanks

    You can assign values to the items using a lookup table.
    http://discussions.apple.com/thread.jspa?threadID=2539456&tstart=0

  • Different values for threshold array?

    Hi, I am collecting measurements from 8 fluxmeters in an array of 8 elements and graph them in a multi line chart.
    The fact is that some measurements return bad values due to bad transmission or bad reading from the (OLD) instrument. So, those wrong values are under or above the 50% of the real value (or the same, of the setpoint value).
    Only a wrong value between 2 good values is collected (only a peak at time), so my goal will be:
    if a > or < 50% of the real value (or the setpoint) is collected and both the value before and the value after this wrong reading are good I would replace the wrong with a correct value (say: with the previous or with the setpoint) in order to have a smooth chart shape.
    I started to use threshold array vi but I need different threshold values for all 8 array positions because all 8 fluxmeters could have different setpoints.
    Not able to solve...and probably I will need to collect at minimum 3 readings before filter wrong values, so I suppose I'd have to fill a 8x3 matrix (?)...

    I don't think that the threshold array primitive is the right choice.  This function interpolates the array and finds the fractional index.  It assumes that the data has a slope.  It doesn't sound like your data would meet this criteria.
    You just need to find the "bad" data points and replace the value with a reasonable value.  (maybe the average of the two data points on either side)
    "There is a God shaped vacuum in the heart of every man which cannot be filled by any created thing, but only by God, the Creator, made known through Jesus." - Blaise Pascal

  • Type defined array of clusters for holding configuration data - setting default values for each array element

    Hi,
    I was wondering if I could get some information and opinions about using a type defined array of clusters to hold configuration data.  I am creating a program to test multiple DUTs and wanted to have a type defined control for each DUT containing the information needed to create the DAQmx tasks for all of the signals for that DUT.  I am wanting to do this so that the data is hard-coded and not in a file that the user could mess up.
    The type def controls are then put in a subVI that chooses the appropriate one based on the DUT Type enumeration wired to a case structure.  
    I am having problems with the type defined control.  I am seeing issues when attempting to save a unique configuration to each array element in the array of clusters.  Somehow it worked to begin with, but now clicking "Data Operations --> Make Current value default" on individual elements of the cluster or the entire cluster (array element) is not saving the data when I re-open the type def control.  What am I doing wrong?  Am I trying to do something with arrays of clusters that I should not be doing?
    I have attached one of the type defined controls for reference.  I tried changing it to Strict to see if that helped, but no luck.
    To reproduce, change the resource string for array element 0 and make the new value the default value.  Then close the type def, and re-open it.  The old value is still present in that element.  The VI is saved in LabVIEW 2012.
    Solved!
    Go to Solution.
    Attachments:
    CM_AnalogInputs.ctl ‏11 KB

    Values of a typedef are not proprigated to instances of the control. THey will pick it up if created AFTER the data values have been changed. THey will not get updated with future changes. You should either create a VI specifically for hardcoding your values or implement a file based initialization. The file based would be much better and more flexible. If you don't want users to modify the data simply encrypt it. There is a noce blowfish library you can download.
    Mark Yedinak
    "Does anyone know where the love of God goes when the waves turn the minutes to hours?"
    Wreck of the Edmund Fitzgerald - Gordon Lightfoot

  • I new to java but how do you load different settings for different browers?

    Let's say i want the page to be font size 6 on FF but size 8 on IE. I know there is a code like "if firefox" but i'm not sure how to set it up.

    I agree with the previous posts. I think it would be better to learn the fundamentals rather than spend time tweeking a web page for different browsers.
    A java web site is made up of several technologies in addition to java such as javascript, xhml, sql, tomcat, etc, etc in addition to java specialties such as JSP and Servlets that you should learn before tweeking a web page. I suggest reading whole books on these topics such as starting with 'Thinking in Java' (I wonder if I can get a commission from the authors for recommending their book so often in these posts?)

  • How do you assign multiple values to a single element in an array?

    I'm probably not wording the question right.
    I have an array, let's call it M[], and for each element in the array (we'll say M[1]), I need assign three integers: row, col and value.
    I need to set it up so I can do something like this:
    A.row = M[i].col;
    A[i].col = M[i].row;
    A[i].value = M[i].value;
    The algorithm isn't what I need help with, it's assigning .col, .row and .value to an index of an array.
    Please help if you can.

    You are right. You did not word your question perfectly, but I still think I get what you want.
    First of all: A single element in an array always has exactly one value. No more, no less.
    But that's not a problem. The element in an array is either of a primitive type (boolean, byte, char, short, int, long, float, double) or it's a reference (to a Object, String, MyClass, ...).
    You can simply write a class that holds your three values and create an array of that type:
    public class SomeData {
      public int row;
      public int col;
      public int value;
    // somewhere else:
    SomeData[] a = new SomeData[10];
    a[0] = new SomeData();
    a[0].row = 10;
    a[0].col = 5;
    a[0].value = 42;Note how you only assign a single value to the element (a[0]) itself. All other assignment actually go to fields of the object refered to by that element in the array.
    Also note that in Java types (such as classes, interfaces, ...) should start with a upper-case letter, while variables (local variables, members, parameters) and method names should start with a lower-case letter.
    Edit: I'm getting old ...

  • From two given tables, how do you fetch the values from two columns using values from one column(get values from col.A if col.A is not null and get values from col.B if col.A is null)?

    From two given tables, how do you fetch the values from two columns using values from one column(get values from col.A if col.A is not null and get values from col.B if col.A is null)?

    Hi,
    Use NVL or COALESCE:
    NVL (col_a, col_b)
    Returns col_a if col_a is not NULL; otherwise, it returns col_b.
    Col_a and col_b must have similar (if not identical) datatypes; for example, if col_a is a DATE, then col_b can be another DATE or it can be a TIMESTAMP, but it can't be a VARCHAR2.
    For more about NVL and COALESCE, see the SQL Language manual: http://docs.oracle.com/cd/E11882_01/server.112/e26088/functions119.htm#sthref1310
    I hope this answers your question.
    If not, post a little sample data (CREATE TABLE and INSERT statements, relevant columns only) for all tables involved, and also post the results you want from that data.
    Explain, using specific examples, how you get those results from that data.
    Always say which version of Oracle you're using (e.g., 11.2.0.2.0).
    See the forum FAQ: https://forums.oracle.com/message/9362002

  • How to apply Software Restriction policy for specific user in local group policy object ?

    I am working on implementing user based software restriction policy programmatically for local group policy object.
    If i create a policy through Domain Controller,i do have option for software restriction policy in user configuration but in local group policy editor i don't have option for that.
    When i look for the changes made by policy applied from Domain Controller in registry, they modifies registry values for specific users on path HKEY_USERS\(SID of User)\Softwares\Policies\Microsoft\Windows\Safer\Codeidentifiers
    They also have registry.pol stored in SYSvol folder in Domain Controller. When i make the same changes in registry to block any other application, application is getting blocked.
    I achieved what i wanted but is it right to modify registry values ?  
    PS:- I am using Igrouppolicyobject API

    I achieved what I wanted but is it right to modify registry values ?
    You also can modify a registry programmatically based policy. Check this:
    http://blogs.msdn.com/b/dsadsi/archive/2009/07/23/working-with-group-policy-objects-programmatically-simple-c-example-illustrating-how-to-modify-a-registry-based-policy.aspx
    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click
    HERE to participate the survey.

  • How do you set the duration for multiple stills in iMovie 2013?

    How do you set the duration for multiple stills in iMovie 2013?
    Before upgrading to the latest version of iMovie last month, I was able to set the duation of all of the stills included in an iMovie project at one time by clicking the apply to all still box in the adjustment pop up. That option is no longer apparent. If it is available I cannot find it, and I have tried several different ways to accomplish it. I have tried the iMovie help section and can find nothing to help.
    Apple, do I really have to adjust close to 500 pictures to a 5 second duration individually???
    REALLY??!!

    ...why wouldnt people want that level of accuracy when animating, especially when working to music at a specific duration?
    Because often people are animating to words or beats in the music.  Music is rarely performed with a computer-precise beat and tempo.  Musicians aren't robots: they swing the beat sometimes.  They use rubato.  They change tempo.  They change time signatures.  As a result, you have to FIND those words and beats.  It's not a situation where you can say, "There!  I've found the duration of one beat!  Now it's easy to find the rest of them!" 
    If you try it, you will be very disappointed.
    Try finding the precise end of a piece of music that fades or ends on a big chord with a ring-out.  You'll see that it's trial-and-error: what's the point where it becomes inaudible?  It depends on how high your speakers are turned up.  You might have them way up, you set an end point for the layer, and then you do a RAM Preview at a more reasonable volume.  You might say, "Hey!  The music ends before the layer ends!"...  but you KNOW you set the layer's out point when the audio file goes silent.
    AE has layer markers that can be used on an audio layer to mark beats, words, etc. They come in very handy.
    I guess it comes down to this: because AE can do so much different stuff, there are very few automated procedures.  Oh, Adobe tries with effects that convert audio levels to keyframes, but they're not 100% reliable... especially on something like a capella choral works.  For true accuracy, you need  find the timings yourself. 
    If you want something simpler, try a different application. But be prepared for lower level of accuracy.

  • Profile values for specifically if  enter section name and product name

    I have tried to get Profile values with the following query,
    SELECT *
    FROM fnd_profile_options_vl po,
    fnd_profile_option_values pov,
    fnd_user usr,
    fnd_application app,
    fnd_responsibility rsp,
    fnd_nodes svr,
    hr_operating_units org
    WHERE 1 = 1
    AND pov.application_id = po.application_id
    AND pov.profile_option_id = po.profile_option_id
    AND usr.user_id(+) = pov.level_value
    AND rsp.application_id(+) = pov.level_value_application_id
    AND rsp.responsibility_id(+) = pov.level_value
    AND app.application_id(+) = pov.level_value
    AND svr.node_id(+) = pov.level_value
    AND org.organization_id(+) = pov.level_value
    Suppose I need to populate the profile values for specifically if I enter section name and product name.
    How can I do that ???

    Hussein Sawwan wrote:
    Thanks, I have gone through the documentation,I can get all profile values.But how can I get the profile values and names that is related to/affects a particular product.
    Is there any connection between products/items with profile option.No. However, you may run the same queries using the follows:
    For example ..
    For GL --> PROFILE_OPTION_NAME like '%GL%'
    For AR --> PROFILE_OPTION_NAME like '%AR%'
    And so on.
    Please note that the above will not return all profile options that affect (or related to) specific module.
    You can also get the list of profile option which are set at the Application/Responsibility level.
    Thanks,
    Hussein
    >
    Thanks, I have gone through the documentation,I can get all profile values.But how can I get the profile values and names that is related to/affects a particular product.
    Is there any connection between products/items with profile option.No. However, you may run the same queries using the follows:
    For example ..
    For GL --> PROFILE_OPTION_NAME like '%GL%'
    For AR --> PROFILE_OPTION_NAME like '%AR%'
    And so on.
    Please note that the above will not return all profile options that affect (or related to) specific module.
    You can also get the list of profile option which are set at the Application/Responsibility level.
    Thanks,
    Hussein
    Hussein ,
    Can I use following query to retrieve the profile values for an item with m.msite_id  =10218 AND s.section_id    =10591 and i.organization_id = 204 and i.inventory_item_id =66567
    select distinct *
    FROM fnd_profile_options_vl po,
    fnd_profile_option_values pov,
    fnd_user usr,
    fnd_application app,
    fnd_responsibility rsp,
    fnd_nodes svr,
    hr_operating_units org,
    ibe_msites_tl m,
    ibe_dsp_sections_tl s,
    mtl_system_items_b i
    where
    pov.application_id = po.application_id
    AND pov.profile_option_id = po.profile_option_id
    AND usr.user_id(+) = pov.level_value
    AND rsp.application_id(+) = pov.level_value_application_id
    AND rsp.responsibility_id(+) = pov.level_value
    AND app.application_id(+) = pov.level_value
    AND svr.node_id(+) = pov.level_value
    AND org.organization_id(+) = pov.level_value
    and m.msite_id =10218
    AND s.section_id =10591
    and i.organization_id = 204
    and i.inventory_item_id =66567
    Anything wrong here???
    Thanks

  • How to know the dynamic values for this :AND category_id_query IN (1, :3, )

    Hi Team,
    R12 Instance :
    Oracle Installed Base Agent User Responsibility --> Item Instances -->
    Item Instance: Item Instances > View : Item Instance : xxxxx> Contracts : Item Instance : xxxxx> Service Contract: xxxxx>
    In the above page there are two table regions.
    Notes.
    -------------------------------------Table Region---------------------------
    Attachments
    -------------------------------------Table Region---------------------------
    --the attachments are shown using the query from the fnd_lobs and fnd_docs etc...
    I want to know what are the document types are displayed in this page ?
    --We developed a custom program to attach the attachments to the  services contracts and the above seeded OAF page displays those ..as needed.
    But after recent changes..the Attachments--> table region is not showing the attachments.
    I have verified the query..and could not find any clue in that..
    but i need some help if you guys can provide..
    SELECT *
    FROM
    *(SELECT d.DOCUMENT_ID,*
    d.DATATYPE_ID,
    d.DATATYPE_NAME,
    d.DESCRIPTION,
    DECODE(d.FILE_NAME, NULL,
    *(SELECT message_text*
    FROM fnd_new_messages
    WHERE message_name = 'FND_UNDEFINED'
    AND application_id = 0
    AND language_code  = userenv('LANG')
    *), d.FILE_NAME)FileName,*
    d.MEDIA_ID,
    d.CATEGORY_ID,
    d.DM_NODE,
    d.DM_FOLDER_PATH,
    d.DM_TYPE,
    d.DM_DOCUMENT_ID,
    d.DM_VERSION_NUMBER,
    ad.ATTACHED_DOCUMENT_ID,
    ad.ENTITY_NAME,
    ad.PK1_VALUE,
    ad.PK2_VALUE,
    ad.PK3_VALUE,
    ad.PK4_VALUE,
    ad.PK5_VALUE,
    d.usage_type,
    d.security_type,
    d.security_id,
    ad.category_id attachment_catgeory_id,
    ad.status,
    d.storage_type,
    d.image_type,
    d.START_DATE_ACTIVE,
    d.END_DATE_ACTIVE,
    d.REQUEST_ID,
    d.PROGRAM_APPLICATION_ID,
    d.PROGRAM_ID,
    d.category_description,
    d.publish_flag,
    DECODE(ad.category_id, NULL, d.category_id, ad.category_id) category_id_query,
    d.URL,
    d.TITLE
    FROM FND_DOCUMENTS_VL d,
    FND_ATTACHED_DOCUMENTS ad
    WHERE d.DOCUMENT_ID = ad.DOCUMENT_ID
    *) QRSLT*
    WHERE ((entity_name    ='OKC_K_HEADERS_V'-- :1
    AND pk1_value          IN ( 600144,599046) --:2
    AND category_id_query IN (1, :3, :4, :5, :6, :7) )
    AND datatype_id       IN (6,2,1,5)
    AND (SECURITY_TYPE     =4
    OR PUBLISH_FLAG        ='Y')))
    --='000180931' -- 'ADP118'
    The above seeded query is the one which is used for table region to retrieve the data..
    how to know the dynamic values for this : AND category_id_query IN (1, :3, :4, :5, :6, :7) )
    --Sridhar                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           

    Hi Patricia,
    is it working for restricted key figure and calculated key figure ??
    Note Number Fisc Period Opening Days
    1 1 2
    2 1 3
    3 1 0
    because I have other restriction, so I create two restricted key figure..
    RK1  with restriction :  Total Number of Note,
    RK2  with restriction :  Total Opening Days ,
    then I Created a calculated key figure, average opening days in a period
    CK1 = RK2 / RK1..
    in this case, I am not sure if it will work or not..
    for example, during RK2 calclation, it might be this   2+3 = 5, the line with 0 will be ignored..
    during RK1 calcualtion, it might be 1 + 1 + 1 = 3. ---> Not sure in this case, the line with opening days 0 will be calculated or not..
    could you please confirm..

  • SRM 4.0- How to set the default values for product type (01) only for SC

    The radio button “Service” should not be visible.
    Also for search help (e.g. search for internal products) where a search should only be possible for product type 01 (goods). The system should not display the product type and internally always search for goods only.
    How to set the default values for product type (01) only for SC
    We needs to use Search help BBPH_PRODUCT which having parameter PRODUCT_TYPE
    Here we can set defalut value 01 but it is not correct one since same search help is using several places.
    We need to limit the search help results only for SC.
    Kindly help out me ASAP.

    The easiest way to set defautl values is to edit the batch class.
    Goto the characteiristic and go to update values.
    In here you probably have something like 0 - 100 as a spec range.
    On the next line enter the default value within this range.  At the end of the line, click in the box in the column labelled "D".  This indicates the defautl value for the characteristic.
    If you need to you can do this in the material classification view as well.
    Just to be clear, these values will only show up in the batch record.  You can not have defautl values in resutls recording screens.
    FF

  • How to set a default value for particular field in SRM PO Portal

    Dear Gurus,
    Im desparetly need a help in web dynpro on how to set a default value for a field(flag) in PO header tab in portal.
    My requirement is whenever the user press the edit button in PO screen,automatically a flag field should be set as abap_false.
    I dont think this will handle in check badi or change badi. i tried this part in onbuttonpressed overwriteexit in CNR_VIEW views,i can get the function EDIT in debugging mode,but dont know how to proceed further.....
    Many of them suggested to go with get attribute and set attribute for changing any particular field in web dynpro,but im not very familiar in using those get and set attributes.I request you people can give me sample code on how to identify my target field in the node and set the values while pressing EDIT Button.
    Thanks in advance...
    Regards,
    Sathish

    Dear Laurent,
    Thanks for your response,
    But i searched in enhancement spot of WD_BADI, but couldnt get the exact way to change the coding,
    My real requirement is, that particular flag should be enable and disable dynamically by checking a condition in my header values.So in that case i dont know how to proceed further to handle in the PO screen.
    Kinly guide me how to get the particular node of field in the Purchase order screen.
    Thanks you in advance,
    Sorry for the inconvenience if any
    Regards,
    sathish

  • How do you stack different photos in the editor layers pallet

    How do you stack different photos in the editor layers pallet? I can get different photos in the editor, but I cannot figure out how to get different photos into the layers pallet at the same time.  Please help!!!!!

    Just to clarify, you can never see the layers panel for more than one photo at a time. The suggestions you got will show all the photos, but because they are now combined as layers in one image.
    If you want to see more photos in the editor at once, go to the preferences>general and turn on Allow Floating Documents, then go to Window>Images>Float all in windows, then Cascade or Tile.
    But you will still only see the layers panel for the image that is active at the moment.

Maybe you are looking for

  • Mail "unexpectedly quits" -- connection to iCloud migration?

    I'm stumped. I upgraded to 10.5 iTunes recently and since then, my mail, iCal, and address book are all on the fritz. Mail is a constant bomb... 3 seconds up and crash. iCal and AddressBook are a bit more stabile. Running 10.6.8, MacBookPro 2010. Rei

  • Am not able to open time machine data due to 'insufficient privelages.'

    Try to explain easy. - Have an old mac system backed up with time machine on an external hard drive (from a mac tower i was using last year.) - Usually I can go into hard drive and take stuff off and put it on this one (laptop). - decided today that

  • Nitro pdf reader advertisement / vuzit, how to delete the add

    Whenever I try to view/download a .pdf file: a Nitro Pdf Downloader advertisement file banner takes up a inch of the screen, and the file is shown on the screen but not downloaded. It takes 40 seconds to get the view and then downloading the file is

  • 2008 MBP -- DVI out -- DVI/HDMI converter -- HDTV ?

    Hi guys, I'm gonna go ahead and apologize in advance if this has been asked before, I'm having a bit of an emergency. The backlight on my 2008 MBP (model A1260) has gone out -- I can still somewhat see the screen but it's extremely dim. I'm wondering

  • Facetime with multiple students

    Does anyone know how I can set up the iPDADS on a cart so multiple students can Facetime with multiple students at another school at the same time?