Shift register to replace local variables

Hello

I'm looking for a way to make a marquee on a Boolean LED. Currently, I use a local variable to make the scrolling action (see the code, the loop For on the right). However, this method requires CPU more power and also prone to several other error. Therefore, can someone help me to replace local variables with shift register? If possible, do not change the other loop. Thank you.

-l' scrolling action must be continuous

-use the attached config. file

-allows to test with any text message

Why do you think that you need so many loops?

Try this, perhaps this may give you some ideas...

(Look at buffer allocations. My table of Boolean 2D works at constant size and completely in place. Not only were constantly read and write to and from the local variables, you were also constantly growing and reducing the size of the table. It's very ineffiicient. I don't see the purpose of your outside while loop or FOR your first loop. None of your shift registers makes a lot of sense. You probably want to close the file of configuration (not shown in my modification)).

Tags: NI Software

Similar Questions

  • Change the shift register

    I hope someone can direct me on that. I'm stuck.

    The NTC, I want that it start at zero, enter the nested loop

    and when the case statement is equal to one, add 3000,

    so I have a lag on "undesirable" elements in the 1 d

    table I'm parsing...

    TIA!

    the nested loop shift register is not initialized, it is best to initialize it with a constant 0

    Then, the index entry Array subset function is connected after or before the function incriment? I can't decide...

    in any case, if it is connected before the incremint function then the nested loop iteration 1 will send a 0 at the entrance to the function of the subset of the Array index.

    EWW! , a lot of entries, words of functions in the above paragraph lol , can u get me here?

    now I can just understand the problem what exactly you're talking about. the sequence of events for your code will be like this:

    After the nested loop is complete, the output will be available (1 d the function add array element table) to the structure of the case where you want to add 3000 to the value of the shift register and start the loop nested with initialized again records with value = 3000? Am I wrong?

    If I'm right, you must reset the shift by using a control register, create a local variable to him and place it in the business structure then her manipulate it as shown below:

    Since the default data of "N" type digital command value is 0, then initially the shift registers will be initialized with 0 as the guy above

    Thank you

  • Table of shift register

    I need to create a program that takes an array of six elements and the use of shift registers if he pulled out a table that maintains the first element of the same thing, and then adds the second and third elements together, and then adds the second to the 6 ° element.  So if the input array is 2, 12, 10, 5, 20 and 25, the output array is 2, 22 and 72.  I think that using shift registers and a loop would work, but I can't make it work.

    Thanks for any help

    Ok.  Given that it is for a class, I will do more than any code.

    Comments.

    1. a shift register is a local memory form. So, ask yourself what this problem needs to be recalled?

    2. entry and exit tables are different sizes. No sense to wire the table via the shift register because the shift register will 'remember' how the input array is large.

    3. Reflection on comment 1, how you will get the information in the table to put it in the register shift?

    4. what happens if apply you the same rules but allowed the input array having a size greater than or equal to 6?  That's what is meant by an evolutionary approach to a problem. The code I posted works for length 6.  For any other length program must be changed. A scalable program work without modification for any input of size.

    It is often very useful to begin with a series of conditions, which you said we now clear. Then plan how you would the problem with pencil and paper. Then implement this plan in the software.

    Lynn

  • Functional Global Variables: an indicator can be used instead of a shift register?

    It is a simple question, but I can't find an answer to it. The model agreed to a functional Global Variable is to use an uninitialized as in this example shift register:

    ('Référence IN' and ' Reference to "is actually a pile of references.) There is also a "Se Refnum" case, which comes the straight through the tunnels shift register.

    My question is, why can't we do store the indicator data? It is much simpler to use a shift register (IMHO a non obvious way to store global data!):

    The case "Se Refnum" does absolutely nothing. Other functions such as erasure of data can be implemented just as easily. The advantage of the FGV to help avoid race conditions is maintained because you always use the VI to access the data.

    JonP says:


    Not so much, the Inidicator can happily live outside the case structure, together and Clear would be just assign different values.

    If you have only a case structure, the indicator could not live outside of it.  In order to maintain the indicator data, your design requires that it is not written in for a case of Get.  If you have an exterior structure deal that decides on 'Get' or 'set or clear' and (in the case of "Set or clear") contains the terminal of the indicator and a classiquee case that decides on 'Set' or 'clear '.  However, I would consider this a design below using the standard template of the FGV.

    The difficulty with retrieving the value if you want to do a read operation / writing change. But LV provides many ways to retrieve data from an indicator (one you don't mention is the 'Value' property), do you mean that's all "incorrect"?

    Yes (I mean that they are all incorrect).

    You could hack your way around the design to work with a single structure of matter and the terminal of the indicator being outside using a method to read the value of the indicator and through a tunnel to the structure of the case through wiring for the tunnel of writing indicator in the case of 'Get '.  However, who will require a local Variable or value of property node.  As I said, these (I only mentioned the local Variable originally) are not good choices for performance and scalability.  If you are not aware of the functional differences between the terminals, local Variables and nodes of property value, refer to this article (obviously advantages/disadvantages such as redraw objects on the front panel are not relevant here).

    I guess you could say that indicators should only be written, but it is difficult to be pure!

    No, it's not, just use the classic design of the FGV!

  • replacement for the shift register chart

    Hi, I have a problem with my program. When I want to compare graphic legend with my present graphic it just overwirite with my graph.when this I add new data and then run my program it does not work. I tried to use shift regoster but my program eror. where should I put the register shift in my program? Thank you

    The shift register is on the outer loop. There is no need for inside while loops. The shift register should contain a table of two parcels of xy. Replace one of the accrding of two plots to the key using "replace the subset of the table".

    You don't need to a simple shift register, you have far too much code.

    (Please attach the screws with a suitable name. My Downloads folder already contains dozends of files "x.vi no title")

  • How to replace the more local variables

    It seems that I had far too many local variables in my VI.  Is there a way I can replace it with a database server?


  • Replace the subset of table w/Shift Register too slow for my Application

    This is similar to other posts, but I have not found one that addresses the limitations of an approach of shift register.

    I have a part of an application that I'm turning to 500-1, 000Hz.  The process extracts a block of data from the ADC, and I need to store this data, then collects more of the ADC.

    I've set up what seems to be the bottleneck of the present in the attached .zip file.  When I run the attached code with profiling (see. PNG file), it tells me that it takes on average 3.8ms for the Subvi to run.  At this rate, I can only run around 260 Hz.  I have a Subvi similar to this in my code and the code can run at 1000 Hz without this Subvi, but slows down to about 160 Hz when it is activated.

    Is it possible that I may collect data about 1.7 KB tables and run at the speed I need?  Any input would be appreciated.

    For purposes of reference. Debugging should be disabled on the sub - vi.

    Looking at the code you provided - don't just disable debugging -! you have some other options of "exécution" to reset.

    This should speed up the Sub - vi SR will be your friend again!

  • Local variables are comparable to the value property of a control or indicator?

    I use the buttons / switches mechanical locking action, event structures and local variables to track the status of my switches.  I used local variables with indicators, too.  Now I see that this could be done via the node property of a switch or an indicator.  Should I use the nodes property instead of local variables?  Should I use "switch" mechanical action and control the State of the control buttons / switches?  I used a mechanical locking action because it automatically reset when it is read, but who pushed me in the use of local variables.

    I know the property values to adapt the data flow model, while local variables might be placed in a sequence structure to ensure the order of execution.

    I just don't want my program all except if it is a correct approach.

    Thank you

    DH

    Dark Hollow says:

    Well, I'm changing the properties of user interface in my state machine.  For example, when you push a button to START the TEST, I want to disable and gray this button and activate the button to STOP the TEST.

    No engineer too much. In this case, you can use a single button and label the FALSE case a 'start Test' and the REAL case as TEST 'STOP '. No additional code needed at all. At the same time, you only use the half-Panel space! (and 10% space diagram!)

    Dark Hollow says:

    Another example... I have a couple of dozens of LEDs on the front panel to show the TEST SUCCEEDED.  If I have the wiring all of them, my state machine diagram gets messy.

    Define disorder! In my mind, code is not held together by wire is much messier because it is impossible to determine the order of execution and so program logic. A thread is a small 1 d object. A property node is a significant 2D object. 20 wires are much less messy than 20 knots of property, especially given that each property nodes still hanging by a thread in one way or another!

    In order to reduce the number of threads, use the most appropriate data structures. Instead of a few dozen sighted use a single Bay of LED. A single wire! Keep the table in a shift register and update alone LED as necessary by using "replace subset of the table".

  • Using local variables to 'clean up' diagram

    I have attached a photo with red circles indicating my use of local variables to 'clean up' a block diagram. If I meet problems this? I leave this task and the unwired error?

    -Sarah

    I see a few maybe really bad race with your VISA resources conditions.  For example, if the task on 3 is empty (default), it is likely that the local read will happen before the local write.  What this will turn into is lose you your reference VISA in the register shift.  Use threads.  Locals clean up very rarely in your diagram.

  • LabVIEW 2010 local variable behavior

    HI -.

    I upgraded to LabVIEW 2010 of 2009SP1 and the attached sub that VI no longer works correctly.  It is a case of State machine structure that is called inside a loop.  I will put a Boolean variable true local, then on the next appeal when the case changes the variable has been reset to false. He has not done this in LV2009.

    Someone tell me immediately I have a race condition, but these local variables are not be written anywhere else, just in these separate cases.

    See the attached code, specifically, the local variable 'Activate' is to reset during the passage of the 'turn on' case for case "power."

    Anyone else seen elsewhere deliver, or can shed some light?

    I've corrected the VI by writing the value in each case, but this different behavior I wonder what are the other issues lurking in LV2010?

    Thank you

    This code looks more like a kind of a motor of Action that a state machine, but not quite.  It is called several times since a state machine, and he decides who will be the next State according to the entries.  Instead of using all local variables, I would use shift registers not initialized (Nothing cable on the left side).  They hold their value of one call to the other.  A case more will need to be added in this case.  An event of default without a name, which would set the initial values of all the shift registers.  Make the default case and does the same name.  It will be called first automatically because the shift register is not initialized, then the default value will be called.  Inside the default case, set all the shift fits to the desired values.  Next time the Subvi is called, these values will always be there.  As long as nothing is wired on the left side, everything is wired for the shift state register will be the next case called.

    See attached vi.  It's broken because I have this thread not to indicators.

  • How to find the steps associated with a local variable?

    In a sequence, we have to write or read from a local variable. Is it possible (for example right-click the variable) to find out related measures?

    Thank you!

    Are you talking about discover what steps use the local variable.  Because the measures are not really "related" variables.  Either they are or they aren't.

    You can use the search/replace tool.  Edit > find/replace

    In the look for:, enter inhabitants.

    You can check her search for: box, and then select the order in which you want to search.  This should show you a list of all instances of the local variable.

    Hope this helps,

  • Code to skip the steps: initialization of local variables failed

    Hi all

    I'm upgrading some software LabVIEW RT I inherited LabVIEW 2011 to 2015 LabVIEW (32-bit) on a host Windows 7 Professional PC. The target is an SMU-8135. The software ran well when it is compiled under LabVIEW 2011.

    I modified the code to enable the monitoring of what is happening by looking at screen on the target outputs. The initial error that brought me here is that a local cluster variable initialized in the first window of the flat sequence described below have been appearing as the in windows later.

    The code begins with the initialization of local variables in the first window of a flat sequence and provides a quick line of text output to the display of the target (call this text #1) (using RT Debug String.vi) I send two lines of text so that a new row is created and later text does not replace it. . It then writes to the next window in the sequence flat screen two groups of text output to the target. Second text in the window 2 (#3 text) output is equipped with a wire entry from the error from the first text output in the second window (text #2). That is the second exit must wait for the first exit to complete before being sent to the screen.

    I see now some weird symptoms:

    1. when I connect to the target under a remote debugging session I see expected display outputs. Not remotely connected, text #2 is displayed. The code passes to the third window in the flat sequence, so everything in the two window should have executed.

    2. the text #1 appears on the target screen * before * I get the message "Welcome to LabVIEW Real-time 15.0." Is this normal? Whence this message? I searched my screws and subvis to this text and it is not there then it mucst come LabVIEW screws somehow.

    This all started with local variables no initialization in the first window, so apparently, I have a problem of data flow. Given that the problem disappears under the remote debugging, I'm a bit of a loss.

    Thanks in advance for any help,

    Eamonn McKernan

    EamonnMcKernan wrote:

    Text 2 appears only when remotely connected it does not appear when running at startup.

    Your "text 2" seems to be powered by a collection of nodes comments to "initialize on compile or load.  This will return once the empty string the first and therefore should not be display nothing until the code I run a second time.  That is the crux of feedback for?

  • How to make shift register init happens only once, so that the data can persist across multiple tracks of a loop?

    Here's the situation:

    We are repeatedly followed eight real-world signals and comparing them to a threshold value.  We do this via a loop For inside a While loop.  The loop For runs eight times per pass.  We have implemented a binary table 1 d and the use of the index of the loop For as the array index, by putting a Boolean result in the table using the function replace table subset.  We want to keep the data in the table to be 'sticky', in the sense that any True value is locked, so even if a fake comes later, this array element true.  However, since we initialize the array in order for the replacement to the work table, we see that whenever the loop For again, it resets the table and destroys the history.

    I have attached a simple VI to illustrate the concept, using a random number generator as a stand-in for the real world signals.  How we change this VI do and entered real lock through multiples for loop runs, indefinitely?

    In case it is not obvious, I am a relative beginner, so please keep count in your response.

    Thank you

    B

    scottbbb wrote:

    For B, although I love the simplicity of it, I have a question: it solves the problem of the re-initialization?  What the shift of the While loop register get initialized - only once during its launch?

    Yep, the shift register Initializes only at the beginning.  You could say that every time the while loop is called (not each iteration) the shift register is reset with the wrong table.

    And, Yes, GOLD will always keep a REAL when it is TRUE.

    Usually, the simplest solution is the best.

  • Increment of the counter without using the shift register

    Is there a way to count = count + 1, with using a node registry or feedback shift?  I have a structure of the event within a while loop (see table).  When the button is touched (kickoff event), a test is carried out.  Based on the test in the case of a string is passed outside of the event to a case statement of success/failure.  The user can run one of these 'events' as many times as he or she wishes.  And in an order any... Test1 (fails)... test 1 (fails)... again... test1 (go) again... test 2 (pass) then test 1 (pass).  When the stop button is reached, I would like to know how many times each pass/fail is produced for each test.  Try to stay away from shift registers, as I have 18 w key so a possible failure for each, so I would need 36 shift registers.

    In my example, the printed final statement would be:

    TEST PASS/fail # x test was performed

    test1 failure 1

    2 in case of failure test1

    Test1 pass 3

    Test2 pass 1

    4 passes test1

    etc.

    Do not see an attachment.

    You can use a shift register to store a table.

    Each button would be mapped to an array index. For each button pushed you the value of the index table, + 1, replace the array element and pass out back for the shift register.

  • How 'local' are local Variables?

    I avoid local variables at any price so don't have much experence with them. Local only 'local' to the subvi in what they are or if you have used the local variable from sale in several subvi in the same program would be that they all share the same varaible?

    I got the task of determining a LabView program that we had subcontracted out. The device, on which he works has three identical modules that are used for the profile and discharge profiles for different types of batteries. In any case, the program has a bug in it where all three on screen V / I charts show the same V / I have curves.

    My original thought CD was the subcontractor got the program works on a module, then reproduced the code to the other two. But did not take a new graphics or was referencing the V / I module of measure 1 in charts 2 and 3. First glance on the code it looked like it should work fine.

    Digging deeper, I see the contractor makes this sup - vi to build the cluster for a waveform graph. In this sub - vi he used a table variable local, called "local".

    When he repeated this for the other two modules, he used the same variable local "local array. Since all three "programs" (one for each module) operate within a larger loop would not all be read and write to the same variable local "local array?

    I have attached the origonal sub - vi (V_WFM.vi) and one of my replacements (V_Wave_1.vi), I've made three copies of my vi and each module will get its own sub - vi.

    I'm not doing correctly?


Maybe you are looking for

  • Possible virus from safari?

    Hi all I've recently updated to 9.3.2 and I noticed that on every Web site of ads and also videos of youtube embeeded change bad ads (first load the original site it changed virus pledging), this problem is not a specific Web site and occur on all si

  • Any browser compatible with windows 98? Any OS capable of upgrade of windows 98 on a system with 6.4 GB HD and 64 MB of ram?

    Old computer card 64 MB ram & 6.4 GB of free hard drive of 75%. Eager to work, but can no longer access the internet. Running under windows 98 (old version)Any browser firefox that I can install that will work with windows 98?Any OS, I can switch the

  • connection of users and configuration of MAX

    I searched the site for 3 days and finally found a post titled; "IAK login user and configuration MAX" on 04/21/2009 who has asked pretty much the same problem, I'm going to. I wonder if there is something new on this subject because I need a solutio

  • file association

    OK, I got the idea on how to fix my USB but may not try it because my son has change a file sort of association. Whenever I try to open an application EXE file it comes up to save it as downloads. It does not open I want to just record under download

  • Update to Windows 10

    I have Windows 7 and wanted to update Windows 10. I've not been successful I get the message that there is an error with a reference 80070002. I can't find any information on this error code. If anyone has experienced this before? Thank you very much