# LabVIEW

cancel
Showing results for
Did you mean:

Solved!
Go to solution

## Register transfer in Labview

Hi guys,

Forgive the question, but I'm completely new to Labview and have recently inherited a rather large codebase that I will be working on over the next few months. The code is quite complex, so I'm sure I'll be referencing the documents available to their fullest extent while trying to figure it out.

My question is this. The previous grad student, who built out the code originally, couldn't figure out something that seems to be very simple. We have several discrete variables that we're using, and at each time step, the two previous values are held. In a kind of functional assignment form, it might look something like this:

x(t-2) = x(t-1);

x(t-1) = x(t);

x(t) = sensor(t); the value is read off from an external sensor.

Currently, all current and previous values must be recorded to be fed into the dataflow at each time step. Ideally, this would be done automatically, but I haven't the slightest clue how to do it. Any help here?

I'm proficient in VHDL, C, Javascript, and Mathematica, if that helps at all.

Message 1 of 4
(1,714 Views)
Solution
Accepted by ijustlovemath

## Re: Register transfer in Labview

Shift Registers.  You can expand the terminals on the left side of the loop downwards to get older values of the shift register besides just the previous iteration.

I would recommend looking at the online LabVIEW tutorials
LabVIEW Introduction Course - Three Hours
LabVIEW Introduction Course - Six Hours

Message 2 of 4
(1,711 Views)

## Re: Register transfer in Labview

Use a shift register. Drag down the left side to expand to get the two previous values.

I recommend that you work through the on-line tutorials for Getting Started with LabVIEW. You will save far more time than it takes you to do that.

Lynn

Message 3 of 4
(1,709 Views)

## Re: Register transfer in Labview

I think you are describing a Shift Register, which hold values between iterations of For or While loops.  If you open LabVIEW Help and do a Index search for "Shift", you can see the "official" description of this very useful LabVIEW construct.  You can also type "Whte Paper shift register" in a Web search to get a nice tutorial from NI on this topic.

BS

Message 4 of 4
(1,705 Views)