Local variable for an Array of fixed size

Hello,
I have a two multirate loops in a VI. 
In one loop, I want to refer an fixed sized array initialized in the other loop.
But I coudn't name the array, so I can't refer it.
Is there any way to refer it?
Thanks,
Young.

If you need a local variable, there is no other way than to create an indicator for it.
In LabVIEW there is no "fixed length" array : you can always add or remove an array element, and you don't need to declare it as in other languages. They are intrinsic dynamic objcets. Of course, the memory manager has to cope with this, that's why it's often better to initialize an array, to give it its final size immediately, resulting in faster running programs. However, this is only noticeable with relatively large arrays (> 10000-100000 elements).
May be you should explain in more details what you intend to do, because trying to reproduce a C approach in LV is probably not the best thing to do. For instance, you said that you are initializing your array in a first loop. You mean that you re-initialize the array at each iteration ? I suppose no, so may be you could put the initialize step out of the loop, and wire the array to your two parallel loops.
Remember also that local variables are not always good programming solutions, since using them will generate copies of their content each time they are refered to. And that can low down your program very significantly...
Message Edité par chilly charly le 11-05-2005 05:05 PM
Chilly Charly    (aka CC)
         E-List Master - Kudos glutton - Press the yellow button on the left...        

Similar Messages

  • Local variables for clean code

    A question of style and LV correctness: 
    I'm quite aware of the risks of these guys, but I see no option here. Right now I have a program with ~35 events in an event structure. I have a wire that contains many device settings that only 2 of these events can change. About 6 events in total require the use of the data on this wire.
    Now, I see two choices:
    1) I can use a shift register and drag the stupid wire across 35 frames and then remember to do it in any additional frames when I add more
    2) I can use a local variable.
    This seems much, much cleaner to me, and I see no better way of doing it. My question is, is there? I've looked up feedback nodes, but I think I can only use them in single event cases. Their data doesn't seem accessible beyond one event case. is there some better option? The data on the wire is an array of objects (classes), if that helps. 

    pobrepablo1 wrote:
    Still though, I object on principle to having a wire across every one of my diagrams, it's cluttersome .
    I thought of a compromise, how about I use a shift register but wire it around my event structure, through a case structure breaking the wire only when I need to? i.e. see attached
    So a single thin 1D object across all event cases is more cluttersome than an additional external 2D case structure, partially wired extra tunnels, and all the extra convoluted logic holding it all together? You priorities seem to be biased.
    A nice wire across all cases is much better. It can be read and written in any event case that needs to, and can always be found in exactly the expected location. Remember that a shift register is very efficient. If the data size does not change, it operates fully in place for the duration of the run. It also often contains data that is not directly of interest to the operator so it does not need a display. A local variable requires a front panel object that needs to be updated in the UI thread. In needs a data copy in memory memory for the control/indicator itself as well as another copy for the transfer buffer (because the FP update is asynchronous). Then we have a third copy in the wire itself. Than makes it three copies of your potentially large array. Add another copy for each local variable instance, and you probably end up using 10x more memory compared to a simple shift register. It all adds up!
    Local variables can be placed anywhere and keeping track of them is like herding cats. The next programmer to work on your project will have a hard time tracking them all down. In properly designed code, it is just "follow the wire". Much more clear and almost self documenting.
    LabVIEW Champion . Do more with less code and in less time .

  • Shall I use global or local variables for my program?

    Hello,
    1) I am using 2 while loops in parallele. One 50 ms timed and the other one 1000 ms. The 50 ms one gets data from a sensor. I want to display that data every 1000ms in the 1000 ms loop. I have used global variables to do that. Should I better use local variables?
    2) This question deals with the VI I have attached
    a)  Shall I initialise the "  Quitter programme " global variable in the main VI aswell ? Or is what I have done enough?
    b)
    I want the sequence to continue ( finishes the last sequence and goes back to the first one without any delay if possible ) until the user presses Quit. I am concerned about the " wait until " icon of the exterior main while loop ( set to be 250 ms at the moment ). This time, 250 ms, is the time it takes between the end of the last sequence and the beginning of the first sequence? Is that right? Once u start the first sequence, the while loop doesn’t do anything until the end of the last sequence ( my 3 sequences can take several minutes ) ?
    Hope I am clear… lol
    Don’t hesitate to ask any questions if not clear enough
    thanks a lot,
    David
    Attachments:
    Example1.zip ‏28 KB

    Bonjour Marc.  You will definitely have a race condition because you are writing to the global in a parallel loop.  You could click the stop button in the quitter program, then before it is read in the main loop, the lower loop writes a false to it, and your click is lost.  Why do you want a separate quitter program?  You may have a good reason but it isn't clear here.  I would not use globals or locals for this, just put your stop button on the main vi.  You already have one, so why do you want another one in another vi?  If you must do it this way, eliminate both lower loops.  They are not necessary.  The global default is set to false, so when you run the vi, it is false.  The button mechanical action is set to latch when released, so after clicking it will turn true until the main vi reads it, then it will automatically turn false.  So you don't need the lower loops to keep writing false to it.  If you just eliminate both lower loops, it will work fine.  The only purpose I could see for the quitter vi is to have one button cause several vi's to stop.  Instead of doing it this way, put one stop button in your main vi, create a reference (right click - create - reference), and wire this reference into all subvi's that the main calls.  The subvi's must be changed to accept the reference and use it.  This would be a much better method to close all vi's with one button.
    You could also get rid of the sequence structure (it hides code and makes it more difficult to read).  Just put all your code side by side.  The error in/out wire will ensure that the execution order will be fixed, just like in your first sequence with the open file and write file functions.  Just wire the error out of the write vi to the second write vi, and then the error out of the second write vi to the close vi.  No sequence structure needed, and all your code is viewable on one screen.
    - tbob
    Inventor of the WORM Global

  • How to add a new Local Variable for DataBase Logging?

    Hello
    I need to add a Local sequence variable to my STEP_RESULT table, i know i need to modify the schema by adding a new column but not sure on what to write in "Expression" to access the value of local variable. 
    Please reply asap, as its a little urgent.
    Regards
    Nitin Goel

    Hi
    you can read this here:
    http://digital.ni.com/public.nsf/allkb/F5ADBC61222343B586256CE00055E6D6?OpenDocument
    Regards
    DianaS

  • Attempting to Save data from an access database file into a local variable for use.

    Hello! i'm trying to develop a small text based game in Visual Basic 2013 and I've recently decided i need to use a more sophisticated data storage system then dozens of .txt files and stream-readers. i'm using Microsoft access and i completed my database
    last night. it stores the stat and skill values of the player-character and the non-player characters. the problem is i cannot bring the data into visual basic in a usable way. using ado.net i can bring a single record into the system as a detail view and
    then read the data in from the labels but i'd far prefer to have it done purely through code. the book i purchased only covers data grid views and detail view and I've spent several hours searching for a solution online. 
    for clarification. i need to read each value in a record into a variable so i can calculate the stats for the games combat system.

    So, you want to select from MS Access?
    Private Sub Form1_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
    Dim connectionString As String = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\Users\Ryan\Desktop\Coding\Microsoft Access\Northwind_2012.mdb"
    Dim selectCommand As String
    Dim connection As New OleDbConnection(connectionString)
    selectCommand = "Select * From MyExcelTable ORDER BY ID"
    Me.dataAdapter = New OleDbDataAdapter(selectCommand, connection)
    With DataGridView1
    .AutoSizeRowsMode = DataGridViewAutoSizeRowsMode.AllCells
    .AutoSizeColumnsMode = DataGridViewAutoSizeColumnsMode.ColumnHeader
    .AutoSizeColumnsMode = DataGridViewAutoSizeColumnsMode.ColumnHeader
    End With
    Dim commandBuilder As New OleDbCommandBuilder(Me.dataAdapter)
    Dim table As New DataTable()
    table.Locale = System.Globalization.CultureInfo.InvariantCulture
    Me.dataAdapter.Fill(table)
    Me.bindingSource1.DataSource = table
    Dim data As New DataSet()
    data.Locale = System.Globalization.CultureInfo.InvariantCulture
    DataGridView1.DataSource = Me.bindingSource1
    Me.DataGridView1.AlternatingRowsDefaultCellStyle.BackColor = Color.Aqua
    Me.DataGridView1.AutoResizeColumns( _
    DataGridViewAutoSizeColumnsMode.AllCells)
    End Sub
    Then from DataGridView to a text file, right.
    Private Sub button1_Click(ByVal sender As Object, ByVal e As EventArgs)
    Dim dt As DataTable = New DataTable
    Dim DBAdapter As OleDbDataAdapter = New OleDbDataAdapter
    Dim connection As OleDbConnection = New OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\\Users\\Excel\\Desktop\\Coding\\Microsoft Access\\Nor"& _
    "thwind.mdb;Jet OLEDB:System Database=system.mdw")
    Dim query As String = "SELECT * FROM Orders;"
    connection.Open
    Dim command As OleDbCommand = New OleDbCommand(query, connection)
    Dim adapter As OleDbDataAdapter = New OleDbDataAdapter(command)
    adapter.Fill(dt)
    Dim writer As StreamWriter = New StreamWriter("C:\\Users\\Excel\\Desktop\\FromAccess.txt")
    For Each Row As DataRow In dt.Rows
    For Each values As Object In Row.ItemArray
    writer.Write(values)
    Next
    Next
    writer.Close
    End Sub
    Knowledge is the only thing that I can give you, and still retain, and we are both better off for it.

  • RE: local variable cross-talk?

    Jeff
    A global can be considered as a variable to the entire code, where lots of
    different vi's can operate it. Locals only have any meaning within their
    own vi, or instances of their own vi.
    If anything writes to a particular global, whether in reenterent vi's or
    not, it's available everywhere in the code.
    What you were asking was about locals though. If a vi is non-renentrant
    (i.e. as they come out of the box) then the values in the locals are vi
    specific, no matter where the vi is, where it was last used, it retains the
    data from it's last operation. If it is re-entrant, then the values in the
    locals for each occurance of the vi are its own for EACH instance, i.e. just
    like different locals in different vi's, it doesn't matter where else the vi
    is used, the data held is that from the last operation of that specific
    instance.
    Simple way to demonstrate this. Make a vi that has one numeric control,
    then code in +1 and get it to write to a local variable for that control.
    Throw in an indicator to wire out the result of what is written to the local
    for the control.
    Then take this vi, put it in a for loop, then put another copy in the for
    loop as well. Wire the indicators to the side of the for loop and create
    indicator arrays for them. Get the loop to run 6 times say. Now try
    running this with the vi in the for loop non-reentrant and then reenterrant.
    One way the arrays will contain either all the odd no.s 1,3,5,7,9,11 and
    then the other array 2,4,6,8,10,12 (don't know which array will be which,
    depends which executes first in the for loop of this example). The other
    way they will both be 1,2,3,4,5,6. In the first example, the same vi has
    run 12 times, i.e. one copy of the vi which retains its info and is called
    in many places and therefore only has one set of values, and the other with
    two re-enterant copies where they have their information specific to that
    instance of them i.e. effectively they are different vi's. Both ways are
    useful, depends what you want.
    If you're looking for a use for non-reenterant vi's then consider this:-
    For instance. Supposing you get many things to try to write to a global
    array of numbers, and you have two vi's one "A" writes to the first element
    in the array and the other "B" writes to the second element. Because in LV
    you have to read a global first and then write to it to perform a change,
    these independant vi's "A" and "B" (be they re-enterant versions of the same
    vi, or different vi's), can be performing the tasks simultaneously in the
    code. I.e. "A" reads, "B" reads, "A" writes, and "B" writes over the top
    with a modified version of what it read, and "A"'s changes are lost. This
    is what's known as a "race condition" as "A" hadn't finished and "B" needed
    to know what "A" was going to write before "B" performed "A" read. Try it,
    hours of fun if you code this kind of thing in inadvertantly!
    If the same vi is used, and is not re enterant, it can only run in one
    instance at a time, hence two read / write operations cannot be performed
    together, problem solved. Unless that gives you timing issues of course,
    waiting for one to finish, to write the other......but that's another whole
    can of worms.
    cheers
    Tim Price
    This e-mail, its content and any files transmitted with it are intended
    solely for the addressee(s) and are confidential and may be legally
    privileged. Access by any other party is unauthorised without the express
    prior written permission of the sender. If you have received this e-mail in
    error you may not copy, disclose to any third party or use the contents,
    attachments or information in any way.
    -----Original Message-----
    From: [email protected]
    [mailto:[email protected]]On Behalf Of Jeffrey W Percival
    Sent: 29 November 2001 21:12
    To: [email protected]
    Subject: Re: local variable cross-talk?
    Another useful reply! What a great news group this is.
    One last thing I wanted to ask about, though, is global vs. local. I see
    you talk about globals, but in fact the variables in my subVI's were locals.
    I can easily understand the behavior I observed accompanying the use of
    global variables, But I guess the use of the word "local" stumped me.
    Should I interpret "local" in LabVIEW's sense to mean "local to all
    instances of this VI"? And global to mean "visible to all instances of this
    VI as well as other VI's"?
    -Jeff
    Tim Price wrote:
    This facility is actually very useful, for instances where you want to
    encapsulate some code so that it can only run in one place at a time,
    i.e.
    global arrays that are written to in more than one place. This method
    can
    eradicate race conditions completely for example when used like this.
    There
    are multiple other uses as well.
    However, using a vi as a module of code, to run in more than one
    instance at
    a time simultaneously, re-entrant is the way to go. Just make sure you
    debug it first!!!
    Remember though, just because a vi may be re-eneterant, doesn't mean
    that
    everything inside is; sub-vi's, Globals etc. The classic one I've seen
    is
    where people think that a re-enterant vi is talking to it's own copy of
    any
    Globals used within it, i.e. counters etc., where in actual fact of
    course,
    they are all using the same Globals.
    Worth playing with a few examples to get familiar with it.
    Tim Price
    Jeffrey W Percival, Senior Scientist and Associate Director
    Space Astronomy Laboratory, University of Wisconsin - Madison
    1150 University Ave, Madison, WI 53706 USA
    608-262-8686 (fax 608-263-0361) [email protected]
    http://www.sal.wisc.edu/~jwp

    Tim Price wrote:
    Tim, thanks very much. I'll try the experiment you suggest.
    Thanks for taking the time.
    -Jeff
    Jeffrey W Percival, Senior Scientist and Associate Director
    Space Astronomy Laboratory, University of Wisconsin - Madison
    1150 University Ave, Madison, WI 53706 USA
    608-262-8686 (fax 608-263-0361) [email protected] http://www.sal.wisc.edu/~jwp

  • How to set multple values in cluster with local variable?

    Hello all,
    Ok, I've made my way through Labview for everyone, and have some basic concepts down. I can see with a cluster, if acting directly upon it, you can unbundle, change values, rebundle, etc.
    I'm trying something a bit more complex...and just not sure how to get started on this.
    I have a drop down menu ring. I have set this up as a typedef, with 4 values.  I have used this typedef 7 times, plus some LED bools, in a cluster. I have made this cluster a typedef.
    So, in my main vi I"m starting to design, I've set up an example posted here....and in it, I have two instantiations of the cluster typedef, Left Selector and Right Selector.
    I have dropped into this vi, a copy of the menu ring typedef (same typedef as in the clusters, same values)....called reset all tubes.
    I'm trying now, to figure out how, with an event on the change of value for 'reset all tubes'....that I can start with the left selector, and change all the tubes (these are the menu ring selector)  to the same value as what has been selected with the 'reset all tubes' menu ring.
    I've created a local variable for the left selector. It is set to read values. (I'll be doing the same with the right one too, but just starting with the left).
    In examples I've seen where directly accessing a cluster, you could unbundle the cluster...loop through and change the values...maybe pull out all of the 'tubes' into an array and move through that to update the values.  And when you bundle or unbundle the cluster...you can see the values, etc, when you stretch them out on the block diagram.
    With the local variable..I can't see to 'stretch' it out like I was expecting..so I can access the values for the 'tubes'...and set them all to the value of the 'reset all tubes' ring menu value.
    Can someone put me on the path on the best way to do this....or is there a structure of component I'm missing here ?  Am I on the right track to begin with here?
    This would seem pretty basic to me, but I'm just missing something here on how to start...
    Thank you in advance,
    cayenne
    Solved!
    Go to Solution.
    Attachments:
    example_select_dropdown.ctl ‏5 KB
    public_selector_cluster.ctl ‏6 KB
    laptop_test_public.vi ‏12 KB

    nathand wrote:
    You can't do this with a for loop the way the cluster is structured, but why make it so complicated?  Just bundle the new value into the cluster as shown below:
    If you do want to use a for loop, consider restructuring your cluster.  Group the ring and a boolean into a cluster, then drop 7 of those into the selector cluster.  Then you can use "cluster to array" and "array to cluster" since all elements in the outer cluster will be of the same type.
    Also, be careful using rings as type definitions.  You probably want to use an enumeration instead.  The items in a ring do not update when you update the type definition because they're considered to be cosmetic; the items in an enumeration type definition do update, because the items in an enumeration are considered part of the data type.
    Oh my goodness!!
    What was MUCH easier than I was trying to make it!!
    I was attempting to do this reset, in an incremental fashion, as that later, I'm going to need to change values in this cluster by individual elements....and was using this as a way to try to understand how to iterate between cluster elements, and change the values of each one.
    This solution works much better for this 'reset' all solution.
    One question on this....with regard to the enum vs the ring menu.
    I was actually going to go with the enum, however, I could not find a way to make it LOOK like the ring menu...with the arrow to the side that a user would know to click to present the menu list of choices.
    I see with the enum, that you can remove the increment/decrement indicator.....and if the user clicks the control, it will indeed pop up a menu of choices...but there is no 'arrow' on that control to indicate to the user that it is a menu choice there.....
    Is there a way to make and enum look like a ring with the "drop down menu" control look?
    Again, thank you !!
    This helps!
    C

  • Does a large amount of "local variable" within a vi cause problems?

    Hello -- I am using Labview 7.0 and have a vi where I am going to end up using about 100 "local variables" for indicators that are displaying data. Since I have a lot of true / false case structures I decided to use these local variables instead of having a mess of wiring all over the vi block diagram. It is intimidating though and I was wondering if it causes slowness in vi's?

    I actually only have about 8 indicators -- but I am in the process of creating control algorithms so I have to use many case structures if I want to keep the code all within Labview (simplicity). I am simply referencing the 8 or so indicator values many many times (100 X) I am attaching a copy of the vi like you asked but just take a look at the right hand side of the while loop on the right -- it shows an example of an algorithm I created today that has to reference the data from sensors. I would love to know what a better way to do this. Thanks!
    Attachments:
    ucb drill control daq 1_7.vi ‏666 KB

  • How can I use local variable in LabVIEW-Action?

    Hi All!
    There is local variable (for example "MyVariable") in local scope of project. There is Action-step, created by LabVIEW. One of input terminals step is "Sequence Context".
    How can I access to MyVariable by Sequence Context? Unbundle? It does't work.
    Thank you.

    On the TestStand palette there is a VI called TestStand - Get Property Value.vi.  Use that.  Attached is an image showing how to use it.  The trick is making it produce the correct data type.  Do that by right clicking on the VI and selecting Select Type.  Then you can choose the type.  I think in LV 2010 and TS 2010 it is a polymorphic VI and you can just change it.  I wrote an example here for Chaz: http://forums.ni.com/t5/NI-TestStand/How-to-execute-two-steps-in-parallel/td-p/1449874
    It's the second example that's attached.
    Hope this helps,
    jigg
    CTA, CLA
    teststandhelp.com
    ~Will work for kudos and/or BBQ~
    Attachments:
    AccessLocalVar.JPG ‏67 KB

  • Create New Variable for COPA Drilldown Reports in KE3E

    Hi,
    How can we create a formula variable for COPA Drill down reports in KE3E? In standard global variables formula variable is not avaiable, I need to create a formula variables like ...from period, to period, last fiscal year and next fiscal year..
    While creating report in KE31/KE35 trying create local variables, but it doesn't.
    Can any body advise how can we create a new variables for  "from period, to period, last fiscal year and next fiscal year.."
    Thanks
    VS Rao

    Hi Rao
    For Period (From &To)
    1. KE3E
    2. Type of Var = Char Value
        Enter variable name, say, ZPERIOD
        Field Name = PERDE
        Replacement type = Entry
        Enter Description
        Parameter/selectop = Selection Option
    For Fiscal Year
        Type of Var = Char Value
        Enter variable name, say, ZGJAHR
        Field Name = GJAHR
        Replacement type = Entry
        Enter Description
        Parameter/selectop = Parameter
    For Next and Last Fiscal Year
    When you define your form in KE34/KE35
    Use the variable ZGJAHR in your report
    In the column for Next Year, Enter "ZGJAHR+1" as the local variable for GJAHR
    In the Column for Last year, Enter  "ZGJAHR-1" as the local variable for GJAHR
    Regards
    Ajay M

  • Best way to remove local variables

    Hello,
    I have been told that I need to remove all the local variables in my VI, because they are slow.  I can not seem to find a good option for replacing them but keeping the same functionality.
    What I am using the local variables for is to update 3 different graphs on the front panel from 3 different sources.  Each of these sources are located in while loops so that data can be acquired asynchronously.  In closing these 3 while loops is a case statement.  The case statement is for switching between acquiring and saving the data or just acquiring data.  The local variables are used to update the indicators and graphs from the acquiring and saving data case.  It is these local variables that I need to remove.
    Does anyone have any suggestions?
    -- Z

    Zurvan wrote:
    I have been told that I need to remove all the local variables in my VI, because they are slow.
    Who told you that?
    As others have said, local variables typically don't cause slowdown (They cause additional datacopies in memory, have the potential of causing race conditions and cause messy code).
    What is "slow" in your definition? (missing data, cannot keep up with the instrument, slugging UI, etc.).
    What is the CPU use when your program runs?
    So apparently you have a loop that updates all indicators from local variables. What is the loop rate of that display loop? Do you spin that millions of times per second or pace it at a reasonable rate? How much data is in the graphs?
    Remember, a graph does not need to update unless the data changes.
    LabVIEW Champion . Do more with less code and in less time .

  • How to call a local variable from another component controller

    Dear Experts,
           I have created 1 component controller(Controller Name as B)and methods.In that methods I Have declared Local variable(For ex data: Lv_flag). I have Created 1 more component and name as A. I used Component B in Component A(Using component usage). In A component controller I have created methods.Now I want to call a local variable Lv-flag in this method from B controller Method. Please reply your valuable answer.

    Karthikeyan,
    Please make sure that flag attribute is under some node, say NODEA. NOW please select the interface node property and input element  of NODEA.
    now NODEA will be available in interface controller. Interface controller acts like a global  controller between two different components.
    So from interface controller you can take that flag value.
    pls reply back if you have any confusion.
    Regards
    Srinivas

  • Create local variable using labview scripting

    I am trying to use labview scripting to create a control and a local variable for that control.  I want both the local variable and the control contained inside a case structure.  My problems are twofold:
    1. the local variable is left blank/unnamed
    2. the local variable is wired outside of the case structure, even though I set it's owner to be the same as the owner for the control (which is placed inside the case structure).
    The flat panel is there because I thought that my problem might be a result of the local var being created before the actual control, so this just forces the control to be created first.  The other thing I wonder about is the VI Object Class for the local variable.  I have tried 'Node' and Control->Boolean, but neither worked.
    I have attached a jpg of the code I'm talking about.  The picture on thetop is of the code in question.  The picture on the bottom is of the resulting code that's created....
    Can anyone offer any help?
    Thank you...
    Attachments:
    vi_scripting_lv.png ‏95 KB

    The reason your locals aren't tied to a control, is because you didn't make a local variable from any control.  Use the Boolean reference wire and wire it to an Invoke Node and select the Create >> Local Variable method.
    Unofficial Forum Rules and Guidelines - Hooovahh - LabVIEW Overlord
    If 10 out of 10 experts in any field say something is bad, you should probably take their opinion seriously.

  • What is the need to break a VI when a local variable in read mode is unconnected?

    What's wrong with an unconnected "read" local variable?
    A control terminal (or indicator terminal for that matter) can exist on the BD without issues!
    Use case: When I create a new control, I may want to drop a few local variables in different cases of an event structure to be connected later.
    If in addition, I am planning to create a few controls, to be used in several cases, this is quicker than dealing with each case one at a time.
    I'll just grab the terminal, create a local variable for it, copy it and then paste it in all the cases I need it in.
    Then repeat with another control and finally, deal with the bunch of local variables in each case later on.
    I would like to be able to run the VI without having to treat all cases, which I can't right nowm because the VI is broken as long as there remains at least one unconnected "read" local variable.
    Again, I cannot fathom why the compiler would be unhappy with a "read" local variable unconnected to anything. Generate a copy of the data if you wish, don't use it, that's all!
    I can see the problem with a "write" local variable, although I would wish an unconnected "write" local variable would be simply ignored. And probably the same should be done with an unconnected local variable: no copy should be generated.
    Of course, a warning would be useful.

    Then put it on the IE (assuming it's not already there) and see how it fares. Personally, I think I prefer the current situation for safety (i.e don't forget to use the code you actually put in), but I wouldn't be terribly broken up if it behaved like you want.
    Try to take over the world!

  • Are the read and write operations atomic for an array in a local variable.

    Hi,
    I would like to know when you access an array in a local variable, is it an atomic operation?
    Thanks,
    Mat

    Thanks for the comments. I agree with you. However, I my case, race conditions and synchronization are not issues. Therefore, the only thing that matters to me is that the write and read operation of the array must be atomic. I know that I can implement that with a LV2 style global but I want to avoid it if possible.
    If writing and reading to an array are atomic operations then I can simply use local or global variables.
    All I need to know is: Is reading or writing an array in a local variable an atomic operation?
    Thanks,
    Mat

Maybe you are looking for

  • Has anyone tried to have their glass screen repaired on the ipod touch

    I've gotten a lot of results searching for repair on the glass screen, even sites that have kits for doing it yourself, has anyone tried to have their screen repaired this way?  I know about the trade in offers, but I've seen repairs as low as $25.

  • File conversion during loading in database

    Is there any way to convert the file using a particular character encoding set during its loading in database tables? Any help is highly appreciated.

  • Converting videos

    When I convert my music videos or any other videos, I don't get any sound with it after it is done converting. What do you think is the problem? If you know what is wrong you can post here or email me at [email protected]

  • Download Adobe Reader 10

    I tried to download Adobe Reader 10.  I got "This program can't start because sliprt.dll is missing from your computer.  Try reinstalling the program to fix this problem." I am runnung on Windows 7 with dialup internet connection, and this is a new s

  • Create Contact Person via BAPI / CMD_EI_API (TCode VAP1)

    Hi everybody, I have to develop a function module, which has to be called from an external application (java). This function module should, create contact persons for customers (like Transaction VAP1 does). I did not find any function module or bapi