LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

moving elements from array to array

You did not change it in the diagram constant! It is still blue there! All your clusters are separate and don't know about each other!

 

(That's why typdefs are better. You edit the typedef and all instances in your project hierarchy that use it (controls, indicators, arrays, subVIs, diagram constants, etc.) will follow automatically. Your current approach is equivalent to herding cats!)

0 Kudos
Message 71 of 84
(997 Views)

@dannn2020 wrote:

Also what does the in place element structure function do.


Have you tried right-click...help? 😮

 

What do you think it does? Should be obvious by just looking at it here.

 

 

0 Kudos
Message 72 of 84
(993 Views)

Thank you very much for your help, I just have one question and im done. Im trying now to extract time at the end and put it into its own array. Im trying something like this in the attached VI, but since i use index array i only get the first element of the array, so is there a way to extract time and put it into its own array.

( im doing this so i can then use the mean function to get the average time.)

0 Kudos
Message 73 of 84
(979 Views)

It is bloody obvious that you lack any and all LabVIEW skills and I really doubt that you did any core1/core2 training at all.

 

To get the average of a certain cluster array elements, all you need is a FOR loop.

 

altenbach_0-1646319749004.png

 

If this is giving you any conceptual problems, it is time to start again with the learning resources available. 

 

Your "time" is still blue and your time still continues to change in the last array, you are still subtracting zero. You haven't done any of the suggested changes.

 

Why are you still use the architecture that makes changes hard? I offered you a significantly better way long ago. Both styles require basic knowledge of LabVIEW!

 

You've been working on this with little progress for over a week! Spend one day on the learning resources and the rest will fall into place in minutes! Seriously!

 

0 Kudos
Message 74 of 84
(969 Views)

The VI I last sent was not the VI with the final adjustments, In my actual VI i included the subVI and when the elements get to the last array the counter stops and i get a whole number, i just sent this VI to ask about the average. ( and as i mentioned before I changed the representation of time into DBL from the front panel but its still blue but works fine and gives me the correct time). 

 

Im still using this architecture because its the one i understand most ( I understand every part of it now).

 

And for my question, how can I use unbundle by name when the clusters are still in an array, so how can I give the unbundle by name a cluster input and not a 1D array data type.

 

And I really did do both core 1 and core 2 but i usually have trouble understanding from reading and just following instructions, your help with this project actually did teach me more than both core 1 and 2.

 

Also I still need to know how to extract a cluster element into its own array, because other than the average of the time, i need to get expectancy into its own array, because i need to subtract those elements from the elapsed time.

0 Kudos
Message 75 of 84
(956 Views)

@dannn2020 wrote:

Also I still need to know how to extract a cluster element into its own array, because other than the average of the time, i need to get expectancy into its own array, because i need to subtract those elements from the elapsed time.


Have you looked at my image in my previous posts? It extracts one element from a cluster into its own array. You can easily subtract whatever you need to do right there.

0 Kudos
Message 76 of 84
(953 Views)

Ok thank you I figured out a way to do it, but one of the things I do is expectancy minus time, but for some reason when the answer should be either zero or less, I get 1.84467E+19. It never goes below that. Why could that be

0 Kudos
Message 77 of 84
(942 Views)

@dannn2020 wrote:

Ok thank you I figured out a way to do it, but one of the things I do is expectancy minus time, but for some reason when the answer should be either zero or less, I get 1.84467E+19. It never goes below that. Why could that be


A verbal description is insufficient for us to debug your problem. Maybe show us "how you do it" so we can tell what you are doing wrong. We are not clairvoyant!

 

It seems you are operating on relative seconds instead of elapsed time.

0 Kudos
Message 78 of 84
(924 Views)

thats my code. After placing many elements and the expectancy minus time should be negative i get the wrong number

Download All
0 Kudos
Message 79 of 84
(917 Views)

Your "life expectancy" is U64 (for no obvious reason!!!) and it dominates the subtraction resulting in a U64 value. (U64 does not have negative numbers so it rolls over according to integer math principles!)

 

You time element is still blue instead of orange.

Make the life expectancy a signed integer type (e.g. I32) and things will fall into place.

 

(Since you still have not used a typedef, this means that you need to make changes in all clusters of your VI. Very tedious!)

 

 

Note: whenever yo see a red coercion dot, you need to make sure to fully understand why! The diagram is trying to tell you something!

 

altenbach_0-1646424751847.png

 

0 Kudos
Message 80 of 84
(913 Views)