LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

2D intensity chart append in y direction instead of x direction

Solved!
Go to solution

Hi

 

I have a 2D intensity chart in a for loop that appends data on the X axis after each loop. This is normal but i was wondering if it would be possible for data to be appended in the Y direction rather than X direction? 

 

In the attached image i have three plots .. the plot at the top is a intensity graph that gets plotted via tunnel mode after the for loop ends...

 

I would like to have a intensity chart within the for loop to plot this graph per iteration so it builds the image.

 

The two figures below within the image are intensity charts within the for loop. One figure shows by plotting the data per loop the data gets appending in the X direction but i need it to be in the Y direction.

 

I found by transposing the intensity chart, it plots correctly by appending in the X direction by the image is rotated by 90 degrees is it possible to rotate the display by 90 degrees as it is getting plotted? or alternatively append data in the Y direction?

 

Thanks 

 

 

 

0 Kudos
Message 1 of 8
(1,321 Views)

Hi zak,

 


@zak9001 wrote:

I have a 2D intensity chart in a for loop that appends data on the X axis after each loop. This is normal but i was wondering if it would be possible for data to be appended in the Y direction rather than X direction? 


Use an intensity graph inside the loop with a predefined 2D array hold in a shift register.

With each iteration you just need to replace a row (or column) inside that array to get your display fill along the Y axis…

Best regards,
GerdW


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

Hi GerdW

 

Thanks for you suggestion. 

 

I tried your suggestion. please see the figure in the attachement. 

 

I predefined a 2D array of zeros of a certain size within the loop with a intensity graph and used the replace subset array command to replace zeros per row as the loop iterates with a shift register but how do i hold the data per loop in the 2d array . at the moment it seems to overwrite the previous row back to zeros ...

 

 

0 Kudos
Message 3 of 8
(1,307 Views)
Solution
Accepted by topic author zak9001

Hi zak,

 


@zak9001 wrote:

I tried your suggestion. please see the figure in the attachement. 

I predefined a 2D array of zeros of a certain size within the loop with a intensity graph and used the replace subset array command to replace zeros per row as the loop iterates with a shift register but how do i hold the data per loop in the 2d array . at the moment it seems to overwrite the previous row back to zeros ...


I repeat the suggestion from my previous message:


Use an intensity graph inside the loop with a predefined 2D array hold in a shift register.

I marked the part where you failed in following the suggestion…

This is basic LabVIEW knowledge: to keep values in a loop for the next iteration you should use shift registers!

Best regards,
GerdW


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

While you are solving your problem, feel free to vote for this old idea.  😄

0 Kudos
Message 5 of 8
(1,225 Views)

Thanks it was simpler than expected , see attachment for solution

0 Kudos
Message 6 of 8
(1,214 Views)

Using a Build Array is certainly simple, but you will grow the array indefinitely. This will eventually overflow memory and crash your program.

 

You need to follow the recommendations of the others and pre-initialize the 2D buffer array and replace rows. Trim the buffered array before appending the new row of data to keep the size under control. In the case of appending, you would need to delete the first row of the buffer before appending the new row to the end.

 

2D Buffer by Row.png

 

This will keep the 2D buffer array to the maximum size and keep your image from becoming squashed over time. You'll also end up stretching your image when you have less than a full data set. This is the only way to keep your aspect ratio consistent.

_______________________________________________________________
"Computers are useless. They can only give you answers." - Pablo Picasso
0 Kudos
Message 7 of 8
(1,205 Views)

Thanks for you suggestion , i updated my code.

0 Kudos
Message 8 of 8
(1,181 Views)