08-04-2005 04:24 PM
Hello Sir, I have a problem using the Write to SGL VI. When I am trying to write the captured data using DAQ board to a SGL file, I am unable to store the data as desired. There might be some problem with the VI which I am using to write the data to SGL file. I am not able to figure out the minor problem I am facing. I am attaching a zip file which contains five files.
1) Acquire_Current_Binary_Exp.vi -> This is the VI which I used to store my data using Write to SGL file.
2) Retrive_BINARY_Data.vi -> This is the VI which I used to Read from SGL file and plot it
3) Binary_Capture -> This is the captured data using (1) which can be plotted using (2) and what I observed is the plot is different and also the time scare is not as expected.
4) Unexpected_Graph.png is the unexpected graph when I am using Write to SGL and Read from SGL to store and retrieve the data.
5) Expected_Graph.png -> This is the expected data format I supposed to get. I have obtained this plot when I have used write to LVM and read from LVM file to store and retrieve the data.
I tried a lot modifying the sub VI’s but it doesn’t work for me. What I think is I am doing some mistake while I am writing the data to SGL and Reading the data from SGL. Also, I don’t know the reason why my graph is not like (5) rather I am getting something like its in (4). Its totally different. You can also observe the difference between the time scale of (4) and (5).
Have a Good Day
Regards,
Krishna
08-05-2005 05:04 PM
I would try comparing your data directly using the comparison VI's in LabVIEW. Compare what you are writing to the binary file and what you are retrieving. Provided you have already converted the data to singles, they should be identical.
You could be corrupting the data by providing an inconsistent number of channels with your acquisition. I replaced the daq part of your code with random numbers and ran the analysis mentioned above and obtained two completely identical arrays. The number of samples to read from the binary file (the number of rows) in each channel must be greater than or equal to the number of samples you write, or else the data will be misinterpreted.
If we can obtain identical arrays, then we can narrow down our search to the representation of the data.
08-05-2005 07:36 PM
As already discussed a while ago, your binary data does not contain timing information. You need to tell it the scan rate so it can reconstruct the time axis correcty.
From the data, it seems the sample file was recorded at 0.5MHz. Take the inverse and set the time increment. Voila!
Your sample file is two column data with one colum all zero. You need to set the number of columns to two, to only get the good data in channel 1.
Your acquisition program contains unecessary FOR loops, you can remove the inner loops without change in result.
It makes no sense to convert to SGL if you initialize the shift registers with an empty DBL array. You need to initialize with an empty SGL array.
(The code could be simplified quite a bit more, but this should give you some directions).
The attached zip shows some ideas (LabVIEW 7.1).
08-17-2005 06:36 PM
Hello Sir, After going through your message, I have tried using Comparision VI which will compare the data acquired and the data that I plot. The result is 1 and hence is true which means both the data points are similar. Its confusing but at the same time, it looks like there is some serious problem while data collection and wrting the same in to a binary file using Write to SGL because, when it can give the values in LabVIEW measurement file, whay can't it do the same thing when I ise Write to SGL. I hope you understood the problem. I was trying to figure out if there is any way so that I can acquire the data points with respect to the time rather than number of samples and then plot them on a graph. I am attaching the VI which I have used for comparision.
08-19-2005 03:27 PM