From 04:00 PM CDT – 08:00 PM CDT (09:00 PM UTC – 01:00 AM UTC) Tuesday, April 16, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Register transfer in Labview

Solved!
Go to solution

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.

0 Kudos
Message 1 of 4
(2,255 Views)
Solution
Accepted by ijustlovemath

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

0 Kudos
Message 2 of 4
(2,252 Views)

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

 

Shift Register.png

 

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

0 Kudos
Message 3 of 4
(2,250 Views)

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

0 Kudos
Message 4 of 4
(2,246 Views)