LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Passing data to subvi on every loop iteration

So, this is my first time using LabVIEW and I'm stuck writing my testbench for an ASIC (applications specific integrated circuit) I have to test in the lab. I need to send different commands via SPI and use different test scenarios. As you can see in my front panel screenshot, I have a test scenario enum control that switches between different test cases. In the block diagram I have a Desktop Execution Node which simulates the Verilog code of my ASIC that includes an SRAM and accepts the data from the controls of the front panel. 

 

In my screenshot "Labview Case 1" I show the simple test case where I write one 32-bit word to a single SRAM address location. In "Labview Case 2" I want to use a for loop to write the data 1, 2, 3, 4, etc in consecutive address locations, e.g. write 0 at address 0, 1 at address 1, and so on. The problem is that my vi crashes if I have the Desktop Execution Node inside the for loop. To solve this, I placed it outside, but then realized that the for loop only exports the data of the last iteration. On every iteration a new SPI word is generated but the ASIC only reads the last one when the loop is finished...

 

My question is how do I make sure that the Desktop Execution Node reads the data generated after each iteration while the loop is running? Please, note that my ultimate goal is to replace the Desktop Execution Node with a Multifunction RIO FPGA that implements the SPI protocol. I have written another vi that works with the RIO device but only for Case 1...

Download All
0 Kudos
Message 1 of 7
(2,104 Views)

There's no for loop, nor a Desktop Execution Node in the screenshots?

 

If I had to guess, the problem is near the for loop and the DEN...

0 Kudos
Message 2 of 7
(2,060 Views)

screenshot Case 2 shows the for loop with the DEN inside. My issue is that this arrangement causes LabVIEW to hang...

0 Kudos
Message 3 of 7
(2,058 Views)

@TurboCostas wrote:

screenshot Case 2 shows the for loop with the DEN inside. My issue is that this arrangement causes LabVIEW to hang...


If you say so.

 

I have no idea what a DEN is actually, but I'm sure I'd recognize one when I see it.

 

Obviously the One Button Dialog will stall execution until OK or Cancel is pressed.

0 Kudos
Message 4 of 7
(2,054 Views)

@TurboCostas wrote:

So, this is my first time using LabVIEW and I'm stuck writing my testbench for an ASIC (applications specific integrated circuit) I have to test in the lab.


Suppose I came to you and said "So, this is my first time using Visual Studio 2017 C++ and I'm stuck writing my testbench for an ASIC I have to test in the lab."  I am willing to bet that your best advice would be "Go take a course and learn both C++ and the Visual Studio environment, doing as many simple programs and exercises as you can until you gain a certain level of expertise -- expect to spend at least several weeks getting up to speed."

 

LabVIEW is no different.  If you are just starting out, you need to spend several weeks learning how to use LabVIEW, how to design LabVIEW routines, how LabVIEW differs from many text-based languages like C++, what the Principle of Data Flow really means, how the concept of time is treated in LabVIEW, etc.  Then you can start to think about your problem.  You will also realize how silly it is to show a picture of part of your code and expect us to comment on how it works (we can certainly comment on how it looks ...).

 

Bob Schor

 

Message 5 of 7
(2,048 Views)

@Bob_Schor wrote:and expect us to comment on how it works (we can certainly comment on how it looks ...).

Actually how it doesn't work Smiley Wink.

0 Kudos
Message 6 of 7
(2,041 Views)

@TurboCostas wrote:

screenshot Case 2 shows the for loop with the DEN inside. My issue is that this arrangement causes LabVIEW to hang...


What happens when you run it in Highlight mode?

/Y

G# - Award winning reference based OOP for LV, for free! - Qestit VIPM GitHub

Qestit Systems
Certified-LabVIEW-Developer
0 Kudos
Message 7 of 7
(2,031 Views)