ni.com is currently undergoing scheduled maintenance.

Some services may be unavailable at this time. Please contact us for help or try again later.

Measurement Studio for .NET Languages

cancel
Showing results for 
Search instead for 
Did you mean: 

IntensityGraph with 2D array of Point3D

Solved!
Go to solution

Hey there,

 

I am trying to implement an Intensity graph which has a 2D-Array of Point3D as DataSource (as mentioned for example here). It works to set the DataSource, but it seems that my X-values are not used.

My Array is initialized like this:

Point3D[,] pdData = new Point3D[resolutionX,resolutionY];

I then iterate through the whole array multiple times and increment the Z-value depending on my input data. Debugging lets me see that the 3D-points have the values as I want them (this has been reduced to 4x4, later this would be much bigger, but shows the same behaviour):

pdData.PNG

My intensity graph then looks like this:

IntensityGraph.PNG

From the Scale I can see that only the values from the first row are plotted (pdData[0,:]). What am I missing here?

 

Thanks in advance

0 Kudos
Message 1 of 3
(2,991 Views)
Solution
Accepted by mrpip

I have not had a chance to debug this locally yet, but I expect the problem is that you are sending a 2D array of 3D data, and the graph is not interpreting the added structure correctly.

 

Instead of using Point3D[,] pdData = new Point3D[resolutionX, resolutionY] for your data, try Point3D[] pdData = new Point3D[resolutionX * resolutionY]. (You could also try assigning graph.Data[0] = Point3D[,] directly, which would avoid the interpretation logic performed by DataSource.)

~ Paul H
Message 2 of 3
(2,975 Views)

As usual, thank you so much Paul! 🙂

0 Kudos
Message 3 of 3
(2,952 Views)