Using DMA to update values in an array

Good afternoon, 
I've been running into a few problems with my vi, and I'd like to give a bit of the background information before I ask my questions. I'm using Labview 8.5 and the NI USB-6009 DAQ. I want to use an encoder to control values that are being written to a file for DMA. I found that I couldn't use the encoder as an external clock since the 6009 DAQ doesn't have this capability. So I've been trying to go a differenet route by using a case structure with a True/false statement to allow me to input values from a simulated signal into a write vi (each time the encoder pulses, a value from the simulated signal should be inputed into the write data storage vi). From there, I want to then read those values and put them into an array. So the plan is to have a 10 element array that reads in values from the storage file (just like in FIFO for FPGA). As I continue reading values, the oldest value of the 10 element array will leave the array and be replaced by a new value. 
 Now here come the questions, I'm using the Write/Read data storage vi's and I keep getting errors. First, if I'm wanting to use DMA to read these values am I using the correct vi's, or is there a different route? Also, once I read these values into the array how would I be able to constantly update the array in a descending order from begining to end of the stored values? 
I'm posting my most recent vi that I've been editing. Also, in advance, thank you!
-tjm
Attachments:
Using Encoder as an analog input 10_9_13 - Copy - Copy.vi ‏390 KB

Thank you for your reply.
First, I'm ultimately trying to use the array as input into a visual display for a meter (to display the mean of the array). I've been successful (in the past) with inputting into an array by not using DMA and using the Sort 1D Array point by point vi. The only problem is the timing mechanism with the encoder, and you are correct with stating that there is uncertainty with the encoder when trying to retrieve values from the input signal (sine wave). I thought about going down the route of using the encoder as a counter (since I am able to see the counter increase by a single digit with each pulse).
My question would then be how to control the case structure with a counter input? 
I'm posting both my setup with the Sort 1D Array Point by Point and the simple vi for the encoder as a counter. My idea is to try to merge the two and have the counter control the case structure. 
Is there a way I can do this? 
Attachments:
Sort 1D Array Pt by Pt.vi ‏189 KB
Using Encoder as a counter input 10_9_13.vi ‏123 KB

Similar Messages

  • Workflows use function to update value.

    As part of a workflow I'm trying to update an object value using Function Evaluator.
    However when I set the Workflow parameter to "Target" and look through the list of attributes (Parameter attribute), I don't see the attribute I'm after. This attribute is created in the FIM portal and when I look at the extended properties of
    an object in the portal I can see this property.
    Thanks for ur help.

    Hi,
    This attribute is binded to a custom object? There is an old issue that attributes are not listed in Function evaluator if they are not binded to Person or group object..
    But you can simply write it in the field, like [//Target/MyAtt]
    Regards,
    Sylvain

  • How to display updated values in an array of clusters?

    Hi all!
    I am designing and coding a LabView application. In one of the modal dialog boxes of the application, I have to dynamically create an array of a cluster in the front panel. The array of the cluster is one dimensional. The number of rows of the array control containing the clusters is dynamic, depending on the user input. I have selected number of rows of the array as 4 in the test vi. The number of columns is fixed to 1.
    The cluster comprises of two elements - a numeric indicator labeled "Machine #" and a radio button control with three choices. The three choices are "Pump", "Compressor", and "Fan". I am assigning a machine number to the numeric indicator in the cluster during initialization of the screen. Similarly, I am assigning a default selection - "Compressor", among the three choices of the radio buttons of the cluster. This is done for each element of the array.
    As far as I can figure out, I am assigning these values correctly. However, I am unable to see the changes on the front panel in the values of the elements within the cluster during the run time. What am I doing wrong? How can I solve this problem?
    I am uploading the test vi that I have written till now. Any help is much appreciated. Thanks a lot in advance.
    Sincerely,
    Aninda

    Hi!
    Maybe, I forgot to attach the VI in my previous posting. Here it is.
    Sincerely,
    Aninda
    Attachments:
    SetupScrn2.vi ‏59 KB

  • Update value Process Data

    Dear all,
    i wan't asking about process data. Can i update value process data during task create user running. and so the task of dependence using the new value .
    thank's

    i'm sorry rajiv, i'm open this thread again. because i'm still confuse
    i want asking again about setProcessData or can be idm change the value in during create user running.
    in my Task Create user code have to checking user in target system, if the USERID already in target system , my code will be the USERID+ INCREMENT 1.
    so if the USERID+ INCREMENT 1 is OK . my code will be inserted to target system.
    my problem is :
    The Task to Generate have any task can be running if my task create user is successfully. the name of the task is CreateUserDB
    why in my task CreateUserDB . the UserID Value still used USERID not USERID+ INCREMENT 1
    can i used setProcessform to update value USERID in my Task Create user code or .??
    thank's
    darvesth

  • How to set the value of an array element (not the complete array) by using a reference?

    My situation is that I have an array of clusters on the front panel. Each element is used for a particular test setup, so if the array size is three, it means we have three identical test setups that can be used. The cluster contains two string controls and a button: 'device ID' string, 'start' button and 'status' string.
    In order to keep the diagrams simple, I would like to use a reference to the array as input into a subvi. This subvi will then modify a particular element in the array (i.e. set the 'status' string).
    The first problem I encounter is that I can not select an array element to write to by using the reference. I have tried setting the 'Selection s
    tart[]' and 'Selection size[]' properties and then querying the 'Array element' to get the proper element.
    If I do this, the VI always seems to write to the element which the user has selected (i.e. the element that contains the cursor) instead of the one I am trying to select. I also have not found any other possible use for the 'Selection' properties, so I wonder if I am doing something wrong.
    Of course I can use the 'value' property to get all elements, and then use the replace array element with an index value, but this defeats the purpose of leaving all other elements untouched.
    I had hoped to use this method specifically to avoid overwriting other array elements (such as happens with the replace array element) because the user might be modifying the second array element while I want to modify the first.
    My current solution is to split the array into two arrays: one control and one indicator (I guess that's really how it should be done ;-) but I'd still like to know ho
    w to change a single element in an array without affecting the others by using a reference in case I can use it elsewhere.

    > My situation is that I have an array of clusters on the front panel.
    > Each element is used for a particular test setup, so if the array size
    > is three, it means we have three identical test setups that can be
    > used. The cluster contains two string controls and a button: 'device
    > ID' string, 'start' button and 'status' string.
    >
    > In order to keep the diagrams simple, I would like to use a reference
    > to the array as input into a subvi. This subvi will then modify a
    > particular element in the array (i.e. set the 'status' string).
    >
    It isn't possible to get a reference to a particular element within an
    array. There is only one reference to the one control that represents
    all elements in the array.
    While it may seem better to use references to update
    an element within
    an array, it shouldn't really be necessary, and it can also lead to
    race conditions. If you write to an element that has the
    possibility of the user changing, whether you write with a local, a
    reference, or any other means, there is a race condition between the
    diagram and the user. LV will help with this to a certain extent,
    especially for controls that take awhile to edit like ones that use
    the keyboard. In these cases, if the user has already started entering
    text, it will not be overwritten by the new value unless the key focus
    is taken away from the control first. It is similar when moving a slider
    or other value changes using the mouse. LV will write to the other values,
    but will not rip the slider out of the user's hand.
    To completely avoid race conditions, you can split the array into user
    fields and indicators that are located underneath them. Or, if some
    controls act as both, you can do like Excel. You don't directly type
    into the cell. You choose w
    hich cell to edit, but you modify another
    location. When the edit is completed, it is incorporated into the
    display so that it is never lost.
    Greg McKaskle

  • How to get the values of an Array using JSP Tags

    Hey guys,
    I need some help. I've splited a String using
    fn:split(String, delim) where String = "1,2,3,4" and delim is ,
    This method returns an Array of splited Strings. how do i get the values from this array using jsp tags. I don't wanna put java code to achive that.
    Any help would be highly appreciated
    Thanks

    The JSTL forEach tag.
    In fact if all you want to do is iterate over the comma separated list, the forEach tag supports that without having to use the split function.
    <c:set var="list" value="1,2,3,4"/>
    <c:forEach var="num" items="${list}">
      <c:out value="${num}"/>
    </c:forEach>The c:forTokens method will let you do this with delimiters other than a comma, but the forEach tag works well just with the comma-delimited string.

  • Finding a minimum value in an array without using loops

    I can find a minimum value in an array using a loop, but I am unsure of how to do it without any type of of loop
    Here is what I have using a loop:
    // This method searches for the minimum value in an array
    public static int min(int a[]){
    int min = a[0];
    for(int i = 1; i < a.length; i++){
    if(a[i] < min){
    min = a;
    return min;
    How do I covert this to do the same thing, using no loops?
    Thank you for replies
    Edited by: kazmania on Feb 7, 2008 12:26 PM

    public class Test112 {
    public int recurse(int[] x, int i, int n)
    if (i==x.length-1) { return (x[i] < n) ? x[i] : n; }
    n = (n < x[++i]) ? n : x;
    return recurse(x, i, n);
    public static void main(String[] args) {
    int[] nums = {3, 1, 56, 2, 99, 34, 5, 78, -400, 2383, 201, -9, -450};
    Test112 t = new Test112();
    int min = t.recurse(nums, 0, nums[0]);
    System.out.println(min);

  • Finding the largest values of an array without using if condition

    Hi,
    I am trying to find the largest values of an array without using any if condition. Can any one tell me the solution for that..
    Thanks

    I am trying to find the largest values of an arrayThe 'S' to values suggests that you want not only the largest one, but multiple ones among the largest ones. The best way, I think, is to sort the array, so that its largest values are grouped topgether. If the type is already Comparable, the following single line does the job:
    Collections.sort(myArray);After this, the last values of the array are the largest ones.
    Jerome.

  • Data transfer from RT to FPGA using DMA FIFO

    Hello all,
    My question is "How do you stream data from RT target to FPGA target using DMA FIFOs?"
    I would like to control some indicators (or controls) in FPGA vi using controls in the RT vi using DMA FIFO.
    I have used four controls in my RT vi, but I get only one indicator out on my FPGA vi. (I would actually like to use some controls on the FPGA target using controls on the RT target)
    Is this possible?
    Can anyone help me with this?
    I have attached my vi s. 
    Attachments:
    fpgatest.vi ‏28 KB
    rt_test.vi ‏73 KB

    Based purely on your example, I see two options:
    1. Do as RavensFan suggests and use Boolean Array To Number to send a single number down to the FPGA.  Your FPGA can break up the number easily enough to update the indicators.
    2. Just write dirctly to the indicators.  I do not see a need for the DMA.  Again, based purely on your example.
    There are only two ways to tell somebody thanks: Kudos and Marked Solutions
    Unofficial Forum Rules and Guidelines

  • Using COUNTIF on time values in pop-up menu (employee schedule template)

    I have modified the Numbers employee schedule template to my liking and it works very well. I would like to add a column to the beginning which shows, at a glance, how many people I have scheduled for AM shifts and PM shifts on a given day. My AM shifts start at 9:00 AM and my PM shifts end at 6:30 or 8:30 PM.
    So I thought I could use COUNTIF, but after I set the array, I cannot get the condition right to return anything except "0". How do you make it detect the appropriate times? The times in each cell for In and Out times are selected using a pop-up menu, just like the template.
    Here is what I tried: =COUNTIF(E3:AE3,"9:00 AM")
    What should the condition be to return a proper count?

    ac,
    You shouldn't feel badly about having trouble with this template. It is a rather tricky one. The values in the Pop-Up menus are Date/Time values. That is to say, they have year, month, day, hour and minute components, even if only the hours and minutes are displayed. So if you only compare to the hours and minutes, you will never get a match.
    I don't know if you have experienced this yet, but when you changed the Pop-Up menu content, you probably entered the current year, month and day unknowingly and will have trouble doing math against the Pop-Up content that was originally in the template.
    My suggestion in your case would be to convert the time references to decimal hours before doing a comparison. For instance, if the time you wish to compare to is in cell C4, you could extract the decimal hours with =HOUR(C4)+MINUTE(C4)/60
    Remember that the hours will reflect a 24-hour day, so times in the afternoon will run from 12.0 to 23.99...
    Then after converting to decimal, instead of using "9:00 AM" for the COUNTIF criteria, use 9.
    There are probably ways to do this using the Duration format as well, but I prefer the decimal hours.
    Hope this helps.
    Jerry

  • Not able to view actual Price updated 'Value' in Change Tracker

    I was able to get my Change tracker to work and it is functioning. (SRM 5.0 MDM5.5 )... Configured Portal iViews for change tracker.
    If I change a description I can see it in the change tracker application. But if I try and track a Price change it only shows me a date-time  and user as to I when the price was changed it doesnu2019t show me the actual value changed, for my audit purposes.
    On the portal the change tracker "Field" dropdown shows -> Price Updated. this is what is tracking any change of price.
    In MDM Console-> Admin->Change Tracker I am tracking under Catalog Items: Price information, Price Updated, Special search terms, long description.
    When I look at the Data manager in the Record Detail, I see  u2018Price Updatedu2019 and it only has a Date and time stamp. In this same Record Detail,  I see the field Price Information that contains :Lower bound, Purchasing Info record ID, Purchasing Organization, Amount and Currency.  Amount-> contains the actual price value. This is what i want to see in the portal iView as Old value and New value....this is what I am unable to view? theres one small step i am not doing...
    I am trying to track the actual change in the filed u2018Amountu2019u2026 I have tried to search for it in the Portal iView fields (table, record contains, fields, record)
    cheers
    alex

    Hi Alex,
    I would not here comment on change Tracking functionality but can you suggest another workaround to achieve this requirement. If it fits in your requirement you can go ahead with it.
    In MDM, Create another field in Main table say Initial Price and for already existing field Amount replace its name with Updated Price in Qualified table Price.
    now after this you will see that your by default Updated Price has values as it was your Amount field earlier and Initial Price field as empty. Now for next time, if any record comes using Import Manager then MDM workflow should trigger at Record Import.
    This workflow contains following steps.
    Start(Checkout)>Assign>Stop(CheckIn)
    Assign step should have below expression and assignment:
    Price Information.Updated Price
    Where I am assuming Price Information is the field in main table which is look up to this qualified table Price.
    So in this way you can maintain both existing and updated values of Price and cant then show in your Catalog.
    suppose you have already existing record say 1 which has value of Amount as 20.
    So that means you have Updated Price as 20 and Initial Price as empty(Null)
    Now when same record 1 updates with new Amount say 40, it triggers this workflow on record import which will then assign value of existing updated Price 20 to Initial Field after that Updated Price will update by 40.
    Note: This Assignment works well only if your main table record has this Qualified table link as single record. If your main table record contains more than one qualified links then this Assignment would not work fine. So use only if it fits.
    Regards,
    Mandeep Saini

  • Get distinct values from plsql array

    Hi,
    I have declared a variable as below in plsql proc.
    type t_itemid is table of varchar2(10);
    inserted set of items in to this using a program
    now i want distinct values from that array how can i get it.

    I am using 9i so i cannot use set operator and more over my problem is that i am declaring the variable inside the plsql block . when i tried i am getting the below errors:
    SQL> r
    1 declare
    2 type t_type is table of varchar2(10);
    3 v_type t_type;
    4 begin
    5 v_type := t_type('toys','story','good','good','toys','story','dupe','dupe');
    6 for i in (select column_value from table(v_type)) loop
    7 dbms_output.put_line(i.column_value);
    8 end loop;
    9* end;
    for i in (select column_value from table(v_type)) loop
    ERROR at line 6:
    ORA-06550: line 6, column 41:
    PLS-00642: local collection types not allowed in SQL statements
    ORA-06550: line 6, column 35:
    PL/SQL: ORA-22905: cannot access rows from a non-nested table item
    ORA-06550: line 6, column 10:
    PL/SQL: SQL Statement ignored
    ORA-06550: line 7, column 22:
    PLS-00364: loop index variable 'I' use is invalid
    ORA-06550: line 7, column 1:
    PL/SQL: Statement ignored

  • Get Updated values in valueChangeListener of af:selectManyShuttle

    I am using Jdeveloper 11.1.1.3.0
    I have applied the valueChangeListener in selectManyShuttle to get the values in backing bean.
    But the problem is, it's not giving me the updated values.
    For example, for the 1st time, the left side list is empty. So, 1st time when I moves some values, it doesn't give me any value but next time, it gives me the the ID of previously moved items.
    How to resolve this problem?

    You can try to put the following line as the 1st line in your valuechangelistener method.
    valueChangeEvent.getComponent().processUpdates(FacesContext.getCurrentInstance());
    Thanks and Regards,
    S R Prasad

  • How to get updated values from the loops while they are running

    Hello,
            I am having difficulty solving a very basic problem, how to access the updated values from the 'FOR loop' while its running?  Basically, the VI  I am currently working on calls two sub VIs. Each sub VI has a for loop, and both VIs may or may not run for same number of iterations. My goal is to read the values at each terminal inside the loop of both sub VIs, in the Main VI. I tried to achieve it using Global Variables, but in main VI it displays only the last iteration value from both sub VIs. Could anyone please tell me whrere am I going wrong? Is there any other/better way to achieve this.
    I appreciate any input on this issue.  
    Kudos are (always) welcome for the good post. :-)
    Solved!
    Go to Solution.

    Dennis,
                In attached VI, I can see the values changing in the sub VI from the main VI with the numeric indicator whose reference is passed on to the sub VI. Now if I wanted to store or use those values how do I do that? I tried to chnge the indicator to control and read from it (in the attached VI) , but the the indicator updates only once. Tried to create a property node and read the Value from it and it didn't work either.
    Thanks in Advance!
    -Nilesh
    Kudos are (always) welcome for the good post. :-)
    Attachments:
    main-1.vi ‏8 KB
    sub-1.vi ‏9 KB

  • How to update values in ValueChangeEvent..

    Hi Everyone,
    I am using Jdeveloper 11.1.2.0.0.
    I have a scenario as follows. I have 2 input fields as Password and Confirmpassword.
    I wrote a ValueChangeListener for the field Password to do some validations and I wrote another ValueChangeListener for the Confirmpassword field inorder to compare the values entered in both fields.
    But here.., In ValueChangeListener event of Confirmpassword field, iam unable to fetch the value of Password field to compare.
    The reason is ..., ValueChangeListener  occurs in ApplyRequestPhase/ProcessValidationsPhase, and values get updated in UpdateModelPhase, hence values are not updating and unable to fetch in ValueChangeListener  event.
    In order to update values to the component tree in ValueChangeListener event, i tried using below code
    valueChangeEvent.getComponent().processUpdates(FacesContext.getCurrentInstance());
    But values are not updating..Kindly suggest me to achieve my scenario. Do the needful. Thanks in advance.
    Regards
    Alekhya

    Hi Nitish...
    Thanks for the response...
    I tried fetching password field value in Confirmpassword field by 2 ways as follows
    1. I binded value of the field as #{backingBeanScope.LoginPage.pwd} and tried to get value using getPwd() method.
    2. I fetched Ui component of  password inputfield and tried to get value using password.getValue()
    By both ways Iam getting null value in ValueChangeListener event of Confirmpassword.
    After clicking a button on the page , as usual the setters, ValueChangeListeners are executing and during this sequence..Iam getting value . But my scenario is this validation should be performed bu tabbing out of the field , not after clicking on a button .
    autoSubmit property is set to true.
    Kindly suggest me to proceed further. Thanks in advance.
    Regards
    Alekhya

Maybe you are looking for