Showing results for 
Search instead for 
Did you mean: 

need help on array initialization

Hello everyone,


I am new in LabVIEW and trying to implement my python-based code into the LabVIEW


The code is simple where I created an array of 1000 initialize zeros and later on for loop to store some data and once that data will cross the threshold level then reset the array, 


here is part of python code, 


Vth = 1
Vreset = 0
V = zeros([1000,1]) 

for k in range(1,999😞 
V[k+1] = V[k] + dt*(I/C)
if V[k+1] > Vth: 
V[k+1] = Vreset
the output is in python is a graph. which I am trying to use a runtime graph in LabVIEW. 
I tried a couple of things in LabVIEW but have not yet received any success (please find the attached current progress)
any help will be highly appreciated,
0 Kudos
Message 1 of 3

You should learn about Autoindexing Tunnels on loops.  They can build the array for you.


This code does not implement your threshold, but it should get you started.

There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
Message 2 of 3

I think this implements the Reset capability


Test with Reset.png



Message 3 of 3