LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Nested for loop

Dear ,

 

I would like to build an array of 8192 value which comes from sweeping a 13 bit DAC.

The outer loop will iterate from 0 to 31 (5 bit) and the inner loop from 0 to 255.

 

So for every outer for loop I will need to add code from inner loop untill I reach 8192 value.

 

every code from 0 to 8192 will be place in the 8 bit array any idea how to build such a fuction?

0 Kudos
Message 1 of 4
(1,798 Views)

Hi malkowski,

 


@malkowki wrote:

I would like to build an array of 8192 value which comes from sweeping a 13 bit DAC.

every code from 0 to 8192 will be place in the 8 bit array any idea how to build such a fuction?


For storing data of a 13 bit DAC you cannot use an "8 bit array"!

Why do you need an outer and an inner loop to handle 8192 array elements?

 

What have you tried and where are you stuck?

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 2 of 4
(1,774 Views)

HiGerdW,

I did express myself correctly I guess,

Here is not a matter of where to store data but to sweep digital code from 0 to 8191 to an internal Digital block which does the job inside a CHIP.

Data must be stored in two different 8 bit register then concatenate internally then sent the DAC block unit.

So I will need to use a nested loop where the MSB part is a 5bit string Nloop=32 then inner loop N=255.

So for every Nouter loop I need to sweep 255 bit, at the end I will get 8192 swept code to the DAC block.

0 Kudos
Message 3 of 4
(1,713 Views)

Not sure what you want exactly, but it sounds like a complicated way to do it.

 

8191 LSB MSB.png

0 Kudos
Message 4 of 4
(1,707 Views)