From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Problem with intensity graph

Hey,

I'm new to labview and am currently working on making an interface for a scanner. This scanner will at every xy coordinate, obtain a z values and I would like to put these three values into an intensity graph. I have successfully done this up to 101x101 values but at big scanned areas like  201x201 values, the intensity graph will show suddenly show a blank graph halfway thorugh the scan.

For my setup, I used an initialized array where I placed a 2D array and connect it to a replace array subset in a for loop. I connected the XY coordinates into the indexes and connected the z values into the new element / subset. I then connect the output array into the intensity graph.

Can anyone help me with this? Is this a problem due to insufficient memory?

0 Kudos
Message 1 of 7
(2,772 Views)

No, you must be doing something wrong, but it is hard to tell without seeing code.

 

(An intensity graph is never "blank". What if you also place a 2D array indicator (with scrollbars) next to it to see how the data actually looks like? Do you autoscale the Z axis? Maybe there is a point that is way off scale, drowning out all other points? What is the datatype of the graph? What does the z data represent (U8 greysscale? U32 RGB? DBL?)

 

When the graph turns "blank", can you stop the VI, right-click the graph and "data operations...make current value default", save the VI under a new name, and attach it here?

0 Kudos
Message 2 of 7
(2,761 Views)

Thank you for your reply

 

An intensity graph is never "blank".

I thought of that to be impossible also until I saw it with my very own eyes. You will see attached a picture of the intensity graph where it is now blank. The X and Y indicator in the top right conner represents the current X and Y axis and you can see that the intensity graph is currently blank eventhough there was an intensity graph just moments ago.image.png

 

What if you also place a 2D array indicator (with scrollbars) next to it to see how the data actually looks like?

In the picture, the data array represents the data that is sent to the intensity graph and when the intensity graph is blank, there is no data being sent to the intensity graph.

 

Do you autoscale the Z axis? Maybe there is a point that is way off scale, drowning out all other points?

The z scale is autoscaled and I dont think that they are any abnormal points in these data.

 

What is the datatype of the graph? What does the z data represent (U8 greysscale? U32 RGB? DBL?)

The z values actually represent around 100 values of data that it receives, each value being a distance of a layer that the scanner detects in reference  to the scanner. So for each xy coordinate, it will receive a number of z values. In the intensity graph, only the last value of this z array will be used.

 

When the graph turns "blank", can you stop the VI, right-click the graph and "data operations...make current value default", save the VI under a new name, and attach it here?

 

I will save a VI of all the important components as the whole VI is a bit complicated. In this VI, I have done as you have said, making the current values the default. I am sorry that I cannot attach the whole program here but please do not hesitate to ask if there are things that you od not understand in the program.

0 Kudos
Message 3 of 7
(2,742 Views)

There is a difference between "blank" and black".

 

So let's first look at the code:

  • The upper FOR loop can be removed and you can use string to byte array to replace the entire thing (or cast to an array of U8)
  • You have plenty of race conditions due to overuse of local variables, but it's hard to tell, because you apparently chopped up the real VI so we can't really tell. For example the "data array" gets initiaized while you read from a local variable elsewhere. There is no way to tell what happens first, but the result will depend on the order.. You are using x and y for both the current scan position and for the size determination.
  • In the second loop, you are replacing the same element position over and over until you run out of element on the blue array and when the loop stops, all you get is the last replacement Shoudn't you have a new xy for each element? Of you are replacing an entire row (or column), you would only need one index and no loop.
  • Are the x and y values in units of pixels?

Sorry, it is completely unclear what you are doing, but it does not look right at all. All you need is a feedback node globally initialized with the full sized array, they you would do a replacement for each xyz set. No need for local variables.

 

Maybe this recent post can give you some ideas.

0 Kudos
Message 4 of 7
(2,733 Views)

I am very sorry if I was not clear. I called the intensity graph blank as it gave me the same intensity graph before starting the program and thus I called it blank.

 

There is a program which will change the X and Y values every time for each element in a certain order in accordance to the mpvement of the scanner. I placed the local variables as the actual varaibles are actually very far apart from this part of the program and connecting them by a line would make the whole program very messy and confusing. 

 

The X and Y units are in mm.

 

Does this help? I will take a look at the link that placed!

 

0 Kudos
Message 5 of 7
(2,731 Views)

I actually did the same things that you have posted in the link with the shift registers but changed it as someone recommended that I use a local variable so I changed my program. It still gave me the same result when dealing with big values. 

0 Kudos
Message 6 of 7
(2,726 Views)

@jellybean324 wrote:

The X and Y units are in mm.

 


So you need to convert mm to "array index", depending how many points per mm you acquire and where the origin is.

0 Kudos
Message 7 of 7
(2,715 Views)