LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Make "free" profiles from an array

Hi Diego,

 


@diego_gonza wrote:


So the input "Puntos en X" is 5 and you get an array with 11 elements?

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 11 of 21
(1,102 Views)

I dont know why appear these 0s, we use "puntos en X" for the iterations.

0 Kudos
Message 12 of 21
(1,096 Views)

Hi Diego,

 

because you initialize an array containing some zeros and then you insert your other values!

 

(From my experience InsertIntoArray most often is the wrong function to use…)

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 13 of 21
(1,092 Views)

And what function is the best for change the valors of arrays?

0 Kudos
Message 14 of 21
(1,090 Views)

Hi Diego,

 


@diego_gonza wrote:

And what function is the best for change the valors of arrays?


When you want to change an element of an array then you want to replace its value: use ReplaceArraySubset!

 

When all you need is an array with increasing numbers like "1, 2, 3, 4…" then you just need a FOR loop and have "i" autoindexed into an output array. Then "+1" after the loop:

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 15 of 21
(1,084 Views)

Ok thanks, now it works fine. 

I have another problem, the scale of x in the XYGraph stop earlier than the number that i impose, i mean if i chose 1000, in the graph appear less depend the number of pixels ("puntos en x"), the first and last level of the profile appear cut in half.

Download All
0 Kudos
Message 16 of 21
(1,083 Views)

We cannot run your last VI because of missing subVIs (Maybe you included them earlier, but I don't have them).

 

You also have glaring race conditions, for example the "profile" local variable most likely gets read before the "profile" indicator gets updated. There is no need for any local variables here!!!

 

Your intensity graph goes from 0 to 900 (1000 is fake because of this problem). You can easily adjust the x-scale of the xy graph programmatically to pad with sufficient range to see whatever you want to see.

0 Kudos
Message 17 of 21
(1,054 Views)

Thanks!  

And how or where can i change it or ghange the program to fit the scale?

Sorry if its so easy but im starting and i dont know how do it 😥

0 Kudos
Message 18 of 21
(1,040 Views)

@diego_gonza wrote:

And how or where can i change it or ghange the program to fit the scale?

Sorry if its so easy but im starting and i dont know how do it 😥


Currently, your x-scale is set to autoscale. You can turn that off and instead set the min and max via a property node according to the data.

0 Kudos
Message 19 of 21
(1,029 Views)

Thanks, we finally got it,

For end it, i can convert the array (intensity graph) to a image but i dont know how to do it with the cursor (the line of the profile for this case) included, i mean i want the finished image with the cursor in it. 

0 Kudos
Message 20 of 21
(966 Views)