LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

moving elements from array to array

I tried this, but it still didnt work, so what did i do wrong. (i have it named 'time' instead of tick)

0 Kudos
Message 61 of 84
(1,129 Views)

I think it is better to separate the entry cluster form the queue managements. Here's a quick draft.

 

Extract to a new folder, then open the project, then open the QueueDemo002.vi within the project.

 

Study it!

 

I have separated the queue managements from the entries for scalability.

All important clusters are typedefs, so just edit the typedefs to change the contents.

 

altenbach_0-1646250204949.png

 

0 Kudos
Message 62 of 84
(1,127 Views)

Thank you, but what did I do wrong in the VI attached in my last reply, because im trying to make it so that the time spent in the simulation is also an element in the cluster.

0 Kudos
Message 63 of 84
(1,125 Views)
  • It is not a time, but a relative timestamp. The elapsed time is the difference between two timestamps.
  • Only the relevant timestamp belongs in the cluster.
  • To calculate the time for display, you need to iterate over all arrays and do the subtraction before wiring to the display indicator. Never touch the arrays in the shift register for that.
  • Your "time" It is still not orange in the cluster and the subtraction of zero still makes no sense!
0 Kudos
Message 64 of 84
(1,123 Views)

Ok I changed it into a DBL but how do I fix it.

0 Kudos
Message 65 of 84
(1,117 Views)

@dannn2020 wrote:

Ok I changed it into a DBL but how do I fix it.


You only fixed one of my four points. Did you understand the other points?

 

I strongly (!!!) recommend to not use this architecture, but here's a quick way to fix it using a subVI.

 

altenbach_0-1646252471175.png

 

 

 

0 Kudos
Message 66 of 84
(1,109 Views)

Ok thank you very much this really helped, but that doesn't stop counting when it gets to the 3rd array, So how can I make it stop counting when it gets to third array.

0 Kudos
Message 67 of 84
(1,106 Views)

 


@dannn2020 wrote:

So how can I make it stop counting when it gets to third array.


... just modify the code that updates array 3 accordingly!

 

(I still recommend to not go down that rabbit hole. Use my new code instead!)

0 Kudos
Message 68 of 84
(1,096 Views)

@dannn2020 wrote:

So how can I make it stop counting when it gets to third array.


One possibility? Makes sense?

 

altenbach_0-1646254836092.png

 

0 Kudos
Message 69 of 84
(1,092 Views)

Thank you very much this works perfectly, ( But why isn't the 'time' in the the cluster container orange, even though I changed it to a DBL by right clicking on time in the front panel and changing the representation to DBL) it still works fine though, Also what does the in place element structure function do.

0 Kudos
Message 70 of 84
(1,087 Views)