LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

how to display last element in a dynamic 1d array

Solved!
Go to solution

hi..

i want to display the value of last element in a 1d dynamic array.../ i mean ..if i stop the vi run, i need to display the last element in the array..how can i do this?

 

and is there any way to use a button to start the vi...instead of using the Run button on the vi front panel??

0 Kudos
Message 1 of 4
(4,757 Views)
Solution
Accepted by topic author pri2686

Index array!.  Use array size to determine the size of your array, subtract 1, feed that in the index terminal of Index Array.

 

You have to start the VI running somehow.  It could be set to run when opened.  Assuming what you want is a means to type values into a front panel, hit a GO button that you created on the front panel, then have the real part of the VI execute.  You could use an event structure.  Or put a while loop at the beginning with a small wait statement in side that basically just polls the GO button.  When that button is pressed, the true boolean stops the while loop and allows the program to proceed to the main body of your program.

Message 2 of 4
(4,754 Views)

hi..i actually figured it out how to display the last element....

 

n thnks for u help...

 

I  am facing a problem in formatting the x-axis( time stamp) in the waveform chart. I am using this to display my generated waveform with the time stamp...... I want to have the system time as the x- axis ...when ever i format the x-axis with the system date format...it is showing some randon date and year...

how can i get the real time on the x-axis??

 

 

0 Kudos
Message 3 of 4
(4,740 Views)
What datatype are you feeding to the graph?  Is it an array of doubles or a waveform?  If it is an array of doubles, it has no timing information of dT or T0.  You can set those values in the properties of the graph.  Or write the Start Time and dT value to property nodes of the graph.  If it is a waveform datatype, that information is in the cluster that makes up the waveform, but perhaps the data is wrong for some reason.
0 Kudos
Message 4 of 4
(4,729 Views)