LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Working in LabView using Excel data

Hi LJM,

 

one possible solution (among others):

  1. use a loop
  2. have it run for "ArraySize-4" times
  3. use IndexArray to get the elements with index "i" and "i+4"
  4. do your calculations
Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 11 of 12
(168 Views)

Do you know about For Loops and what they do if you bring an Array into them with the default "Indexing" tunnel, and out of them also with the Indexing tunnel?  This gives you an easy way of working with X(i) and Y(i) to give you Z(i).

 

Next question -- do you know about Shift Registers, and how they can be used to give you previous values of inputs to a loop?  That is, if you are bring X(i) into an Array, how a Shift Register can give you X(i-1), X(i-2), X(i-3), and X(i-4)?  [You don't want to do it this way if you need, say, 20 "lags", but for 4, where you ignore X(i-1) .. X(i-3), it should work just fine?].

 

Here's a suggestion for you to "do it yourself" (which will ensure you never forget how to do this):

 

Use the Web or LabVIEW Help or Tutorials (see first page of this Forum) to learn about For Loops and about Shift Registers.

 

Write a small Test VI.  Create an Array (use a For loop) with the numbers 0 .. 9 in it (hint -- start with a For Loop with 10 wired to "N", and add one wire and one indicator that gets "wired into").  Use this Test array with your test For Loop and Shift Registers and see what happens,  Can you get it to subtract 0 from 4, 1 from 5, 2 from 6, and give you a bunch of 4's?  Do you see anything you might have to do with the output (i.e. do you have 10 "reasonable numbers" or only 6?).

 

Bob Schor

0 Kudos
Message 12 of 12
(157 Views)