How to use Shift Register?

Hi
Today I spend hours to ficure out how to use a shift register with labview.
I am going to calculate the acceleration of the wheels of an RC-car.
I want to use the simple function to calculate the acceleration.
a=(v1 -v0)/time
From this it follows that I need two speed (ms) values. I was thinking about including a shiftregister that I made before (attached) into the SpeedAngle.vi
But that doesn't work.
Is there maybe an other way to store two following values of the calculated speed? So that I can use it for further calculations.
Thank you!
Attached the two program files.
Bye
Attachments:
ShiftRegister1.vi ‏23 KB
SpeedAngleAdvancedEDIT.vi ‏187 KB

Hi
Thank you very much. Now it works. Attached you will find the program. Now I need to adjust the car with the program. Hope this also works.
One more question. Why isn't it possible to use a Numeric Control twice?
Because I wanted to use the Numeric Control that I use for the time constant (time) also for the calculation of the acceleration.
That doesn't work. Than I placed a Numeric Indicator to display the value of the time constant. But it just displayed the default value.
Bye
Attachments:
SpeedAngleAdvancedEDIT.vi ‏214 KB

Similar Messages

  • How to use shift register in this structure?

    Dear All,
    In order to use less variety of graph, I want to use shift register to manage and send data to graph.
    But there is not only event structure in my vi, for some reason(because I want to use only one button to control running and stop, and this must do through variety of button, I can't put this loop into the event structure) I must use other while loops, I don't know how to use shift register in this structure.
    Please tell me anything helpful.
    Thank you!
    Attachments:
    shift register.vi ‏26 KB

    hi there
    there are a lot of solutions. my favorite one is the usage of a so called "FGV" (functional global variable). this allows you to strore, manipulate and transport data through your app with a minimum of wires. see attachment.. (other users may have other favorite solutions...)
    Best regards
    chris
    CL(A)Dly bending G-Force with LabVIEW
    famous last words: "oh my god, it is full of stars!"
    Attachments:
    Shift Register 7.1.zip ‏20 KB

  • How to program shift register to read only when a new user is detected from user?

    Hi,
    I'm currently developing a program for position control in labview. The program is quite simple, whereby user will input the distance that he wants the table to be in the labview program, and labview will send signal to move a motor that will turn a ball screw to move a table horizontally to the targetted position. The criteria is that the profile of the motor depends on the distance it needs to move, whether a two-phase (acceleration and deceleration) or three-phase (acceleration, constant velocity, deceleration) to reach the target position.
    The problem occurs when the user wants to enter a new position (second input) for the table, as the input by user is position the table needs to be but the input required to determine which profile the motor follows depends on the distance that the table will move to get to the targetted position. Therefore, I would need a function to store the input by user temporarily, and recall it only when a new input from user is detected. By this, I would be able to use the difference of the input (input [n+1] - input[n]) and feed it to determine which profile the motor follows and the input by user can be kept as the position he wants the table to travel to (to compare with encoder).
    I thought of using shift registers to do this, but I am not able to make it to perform the deduction ([n+1] - [n]) only when it detects a new input. When i try using shift register, it travels to the targetted position, and one it reaches it will travel back to the original position. For example, when a user input 90, it means the table needs to move to point 90. As the shift register is initialized to 0, it will move to point 90 (90-0 = 90) but upon reaching 90, the shift register sends a signal of 90 (90-90 = 0) and the table returns to it's initial position.
    Is there any way that I can delay the reading of shift register only when a new input is detected or is there another way for me to achieve what i want?
    I've tried searching the discussion forum and ni website but couldn't find similar problems. Thanks for your help in advance.
    Solved!
    Go to Solution.

    Hi,
    I've managed to get what I needed by using a shift register + event structure as suggested by Adnan. However, I face another problem after implementing SR+event. I've attached two files, first the original program and second the updated program using SR + event. (it's only the jpg file as I've forgotten to save the labview program, will upload the program by tomorrow.
    In the original program, I have an elapsed time that is able to run continuously when I run the program. In the updated program, my elapsed time don't seem to run continuously when I run the program (as shown by elapsed time indicator). I need the elapsed time to run continuously as a input to calculate my motor profile.
    I suppose this is caused by the introduction of the event structure, will adding a case structure to wrap the event structure solve the problem or is there another way to get pass this. Appreciate if someone could drop me a pointer or two.
    Thanks
    Attachments:
    Mar 16 - continuous elapsed time.png ‏12 KB
    Mar 16 - elapsed time not continuous after introducing shift register + event structure.png ‏17 KB

  • Why did I only get a part of wave chart even if I have appended the wave together using shift register?

    It seems only read 200 samples and then stop. Shouldn't I get a continuous wave chart after using shift register on a while loop?
    Solved!
    Go to Solution.
    Attachments:
    trial 4.vi ‏21 KB

    You must remove Start VI out from the loop...
    You cannot 'Start' a task which is already running...
    You also remove the Start VI completely from your code... If you do not use Start VI, a measurement task starts automatically when the DAQmx Read VI runs.
    Find the attached VI.
    I am not allergic to Kudos, in fact I love Kudos.
     Make your LabVIEW experience more CONVENIENT.
    Attachments:
    trial 4 [with START-VI removed].vi ‏15 KB

  • Any way to save data in loop without using shift register or feedback loop

    Hello all
    I was thinking, is it possible to save data in a loop to next iteration without the use of a shift register or a feedback loop?
    I need the possibility to reload data within a loop from a lvm file, but I want to use the same data until i load some new ones.
    The reason why I don't want to use the shift register or feedback node is due to speed, even though I am not sure if the shift register
    actually moves all the data from one register to another, or if it is stationary until a change in the data occur.
    The data I want to reuse is medium-large (6 force measurements, 2 pressure, 1 flow channels)of about 10sec data in each file with samplingsrate of 2kHz..
    In my analysis program I have many CPU demanding calculations and 3D graphs, so I just want to minimize the CPU load as much as I can for each part of the
    software..
    I have attached a small VI to explain what I am talking about.
    I now I shouldn't use the express VI, and I am going to change that as well - this is just a proof of concept! 
    Hope you guys can help me understand this shift register better...
    Thanks!
    - Tommy 
    Running LabVIEW 2009 32bit SP1 on Windows 7 64Bit
    Solved!
    Go to Solution.
    Attachments:
    visual.vi ‏34 KB

    tombech wrote:
    [...]The reason why I don't want to use the shift register or feedback node is due to speed[...]
     Tommy,
    shift register are the fastest you can ever get...........
    Norbert
    CEO: What exactly is stopping us from doing this?
    Expert: Geometry
    Marketing Manager: Just ignore it.

  • Shifter register for array of waveforms

    Hi guys,
    I was trying to use shift register to append waveforms from multiple channels to their previous waveforms correspondingly.
    The problem is when I click the stop button on the front panel and saved the data, the data file contains nothint except for some words like "waveform","t0", and "dt".
    The attachment is the image of my VI.
    Thanks!
    Jude
    Attachments:
    screencap3.png ‏101 KB

    Your problem is your FOR loop at the bottom.  When you first call this VI, the shift register will have the default value for the data type.  In this case it will be an empty array of waveforms.  A FOR loop will iterate the smallest of the size of the smallest autoindexing input array or the N.  Well, the smallest will be 0 because of that empty array.  So the FOR loop actually does not run at all.  It just outputs an empty array.  What you need to do is put a case structure around that FOR loop.  When the loop index of the WHILE loop is 0 (first time reading anything) set the output to the waveform you just read.  If the loop index is greater than 0 run the FOR loop like you have now.
    If you look at the VI I gave you here you will see what I mean.
    There are only two ways to tell somebody thanks: Kudos and Marked Solutions
    Unofficial Forum Rules and Guidelines

  • Problems about shift register

    i am using shift register to detect the change of state of my system. --- to detect when the temperature exist the limit, say 50 degree
    therefore, i want to set a constraint that when the past value is below the limit, and the present value is over the limit, the loop is runned and value, time is recoreded.
    My problem is that the system can't run well.
    here is my sample program
    Attachments:
    shift_regiter.vi ‏225 KB

    Hi,
    Yes I did see your eaxample.
    Your inner loop will only ever get one reading if it is inside your limits because it will never exit and therefore your outer loop will never take another reading. Your limit checking needs to be in a parallel loop for it to have a chance to work.
    Regards
    Ray Farmer
    Regards
    Ray Farmer

  • How to quickly clear an array used in a shift register?

    Hello all,
    I'm sure this is a quick one, but I'm missing the concept.
    I have an array of boolean in a shift register. I have a case where I need to basically 'reset' the array rather than append to it....what is the best way to do this?
    Thank you,
    cayenne
    Solved!
    Go to Solution.

    stevem181 wrote:
    Of course, it is possible that my benchmark program is flawed.
    Yup, disable debugging and you will see that the inner FOR loop is folded in both cases and the time drops to about zero.
    Testing with debugging enabled is potentially unfair, because the reshaping will have more debugging code because there are more potential places to probe a wire, for example. All that said, I don't really know what's more efficient. That would require much more sophisticated testing. My point was just a reminder that there are always many ways to do things.
    (This is under LabVIEW 2012. Constant folding and dead code elimination of course differ between compiler versions)
    Granted, I typically don't use any of these two versions: I also omit the diagram constant, set the tunnel to "use default if unwired" and keep in unwired in the "clear" case. Less diagram clutter and quicker coding.
    Here's how it would look like.
    LabVIEW Champion . Do more with less code and in less time .
    Attachments:
    Folding.png ‏13 KB
    UseDefault.png ‏3 KB

  • Using a shift register to detect input...

    Hi guys,
    I'm creating a LabVIEW VI that needs to be able to detect when a user changes an input. I read a previous post that suggested using clusters and shift registers to compare previous data.
    My question is how do I use shift registers? I've created a shift register on a for loop, but I'm not sure when to compare the "previous" data to the "new" data. Do I need to add an element to the left side and compare it there? Is the right side the output? I'm just not sure how it works. An uploaded example would be nice. Thanks.
    -Mike

    Shift registers are very powerful but difficult to use for the first time.
    The shift register you just created has two "arrows", one on either side of the structure. The arrow to the left is the value from the previous (i:th) iteration and the arrow to the right you have to feed with the (i+1)th value.
    Now, if you want to compare values and look for a change you can compare your old value (the one coming out from the left) with the new value in your for loop. The feed your new value to the right arrow so that it becomes the old value for the next iteration.
    If you have many parameters to compare, clusters are very useful since they make things very compact. If you are comparing clusters, do not forget to change the setting on the comparison to compare aggregates (r
    ight click on it and select that option).
    Also, in most cases you need to set the initial (start) value for your shift register. This is done by feeding the left arrow with the default value from the outside of your loop.
    I attached a simple example, CompareSettings.vi, that shows how it works. Hope this helps. /Mikael"
    Attachments:
    comparesettings.vi ‏32 KB

  • How to generate pseudo random noise(PRN) binary sequence using shift registers?

    what is the block diagram to generate pseudo random noise (PRN) binary sequence of 1's and 0's using shift registers
    please help
     i need 2 submit this project in this week

    This is a fairly simple homework problem. My hints (on the LabVIEW side):
    1- look at while loops
    2- look at shift registers on while loops with multiple input elements
    3-look at the logic components, AND, OR XOR
    Look at this wiki article: http://en.wikipedia.org/wiki/Linear_feedback_shift_register
    Do the work, you won't learn if someone shows you how it is done! The palette that the previous post points to are of PRN and other "noise generators" but I suspect that is not what you are after.
    Know that creating a PRN with a reasonable number of shift register taps produces very pseudo results, as the "random" pattern begins to repeat pretty quickly, thereby making it not a truly random number. 
    When you have an attempt that is sort of working and want additional suggestions, post the code here. We won't do your work, we will help you try to do it, and learn it, yourself.
    Putnam
    Certified LabVIEW Developer
    Senior Test Engineer
    Currently using LV 6.1-LabVIEW 2012, RT8.5
    LabVIEW Champion

  • Problem in using the shift Register

    I have a problem regarding shift register when i was using it in my application.
    During the runing of the application i found that sometime shift register not pass the value to the case structure. at that time result is not displayed.
    i have attached the application in which that problem occur and the process regarding the execution, how bug produce and how to check where the shift register stop. please find the attachment and reply on the same.
    Attachments:
    Shift Register Checking Application.zip ‏173 KB

    I'm sorry but I don't understand your program.  I only see one shift register in Result Display.vi.
    What I do see is a lot of odd constuctions of while loops that only run once in your Main.VI.  Also, a heavy reliance on global and local variables that I suspect are leading to race conditions.
    Have you tried using the debugging tools such as probes and highlight execution to see our your application is behaving?
    I'd also be concerned about how you have "Lock Front Panel Until Event Completes" in the cases of your event structure.  And those event call other subVI's that may take a while to run and rely on user interaction with the front panel.  I also don't understand why when I hit "OK", the subVI front panel remains open.  It just makes running your application that much more confusing.

  • Task out with a shift register using ULx

    This post below describes my same problem of passing a task through a case structure but they are using the DAQmx Library and it has a CreateTask.vi which the ULx Library doesn't have.
    http://forums.ni.com/t5/LabVIEW/passing-DAQmx-task-out-through-a-shift-register/td-p/410447
    Any suggestions as to how to get my task out through the shift register?
    Thanks
    -CC
    Solved!
    Go to Solution.

    I have never had a problem getting ULx task out of shift register.
    This is an action engine that I use to store the ULx tasks ref to use later in the code.
    Omar

  • Iterative addition of 2D array using a shift register

    Hi
    I'm trying to add 2D array iteratively using a shift register.
    However, the indicator for the output of 2D addition shows nothing.
    Do you know Why? and How to fix this problem?
    Thx
    hiyang

    Ok, looked at ur attached VI
    You are not getting any output because, you are adding an array with an empty/blank array
    First, initialise an array of zeroes of required size and pass it to shift register,  Initialise your other array which u are adding inside the loop also of similiar dimension, and later, keep changing its elements
    Do as shown in modification of your attached VI
    Regards
    Dev
    Attachments:
    2DArray_shiftRegister.vi ‏30 KB

  • How to set up a shift register to unsigned 16?

    How do you set a shift register to an unsigned 16?
    It defaults to double but I want it a U16.
    Ron
    Attachments:
    unsigned_init.GIF ‏14 KB

    You'll either need to initialize the shift register by connecting a U16 constant to the left register outside the loop, or place a U16 Convert function from the Numeric>Conversion palette after the Increment function.
    The default numeric data type is Double, so unless you specify what you want, that is what the Increment function will produce.
    Ed
    Ed Dickens - Certified LabVIEW Architect - DISTek Integration, Inc. - NI Certified Alliance Partner
    Using the Abort button to stop your VI is like using a tree to stop your car. It works, but there may be consequences.

  • How can I find what apple ID I used to register my iMac when I first booted up? I am being told that by using this ID I will be able to go on to the App store and down load iPhoto at no cost. Is this true? My iMac does not have iPhoto resident on it now

    How can I find what apple ID I used to register my iMac when I first booted up? I am being told that by using this ID I will be able to go on to the App store and down load iPhoto at no cost. Is this true? My iMac does not have iPhoto resident on it now and I only purchased my new iMac in December 2012
    Thanks....

    Launch Keychain Access and click on Login in the left hand pane and then on Passwords.  Next do search for Apple in the search field at the top and click on Apple ID Authenicication in the list that comes up.  That will give you the ID no. and password.
    OT

Maybe you are looking for

  • Windows Loose Content on Drag after 10.4.6 update on quicksilver

    Ever since the 10.4.6 update i've had a problem where when I open a new window, doesn't matter what it is, and drag it or scroll in it the contents of the window Disappear and are replaced with whatever was behind it. I have to hit expose to fix it s

  • How easy to load microsoft 2011 in Lion?

    I cannot access my Word nor Powerpoint so if I buy 2011 pack will I be able to still use presentations made in 2004 version??

  • Any new Nvidia driver for Macbook pro?

    Hey, after I upgrade to new OSX 10.6.x, my software Houdini (www.sidefx.com) viewport flickers every frame. It used to work fine on 10.5.x. I don't know it's the problem for OSX or Nvidia driver, at least, it worked fine on 10.5.x, so I think it is t

  • Olympus EM-1 raw files look flat in LR 5.3 RC

    Raw (ORF) files from the OM-D EM-1 look much flatter in 5.3RC than with the Olympus Viewer software.  I'm having to add considerable exposure and contrast adjustments to give good results.  Is the support for the EM-1 optimized in the Release Candida

  • Scrpt: Account Statement in Mail or report

    Hi All, There is a standard printprogram and form for account statement in FI. I want this information to be send to customers in mail. Please suggest.