LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

loading binary data to graph

Hello, I have a VI that uses an XY-Graph to graph 2 plots and after my buffer exceeds a certain limit it writes that data into a binary file and saves it on my computer.  Now I'm trying to make a VI that can open that binary file and display it on an XY-Graph.  But i'm having trouble, I keep getting an error... I'm using the LabVIEW Example VI "Read Binary File" to do this.  My data is a cluster of 2 2D arrays, each array contains the X and Y values needed for the plot.

 

I guess passing the data isn't as stragith forward as I assumed, does anyone know what I may be doing wrong? Here's a screen shot of the error.

 

Thanks!

 

DataTypeError.JPG

0 Kudos
Message 1 of 4
(3,716 Views)

Without the actual code to debug, I can only make a few guesses/observations.

 

1.   No need to read the file size, just set the count of Read from Binary File to -1 and read the whole thing.  Your calculation is incorrect, count is the number of 'elements' to read, not necessarily equal to the number of bytes.  For example, if you set the datatype to I32, you will read 4*count bytes.

 

2.  That datatype does not seem like the proper one for a multiple XY graph.  You should have an array of clusters containing 2 1D arrays.   Basically an array of what is called 'output cluster' in your screenshot.  To be honest, I am a little flumoxed as to why XY Graph seems to like that datatype.

 

 

Right-click on XY Graph and choose Create Constant and see what you get.

Message Edited by Darin.K on 12-07-2009 01:26 PM
0 Kudos
Message 2 of 4
(3,701 Views)

Hi monse,

  Actually a XY Graph takes input as cluster of two 1-d arrays,one array is x-array and another array is Y-array.If two plots are needed,then you should build an array of two (cluster of two 1-d arrays).But in the program you have wired wrongly i.e array of cluster of one array..Please try to modify the program.If already you got the solution,please paste the solution to the forum .

 

 

Thanks and regards,

srikrishnaNF

Regards,
Srikrishna


0 Kudos
Message 3 of 4
(3,680 Views)

ok there was actually two things I did that got this thing working, the first was to wire the -1 to the "Read From Binary File" vi, thanks Darin.  And the 2nd was to change the datatype to a cluster of 2 1D arrays (I mistyped in my initial post I meant that I had an array of 2 clusters, each cluster containing 2 1D arrays).  The output of "Read from Binary File" happens to be the input but in an array... so my output ended up being a 1D array of Clusters that contain 2 1D arrays... so it all works now.  Here's what it look likes.

 

DataTypeError.JPG

Thanks!

 

 

0 Kudos
Message 4 of 4
(3,657 Views)