01-18-2008 10:18 AM
Hello,
I posted a problem before Christmas regarding data acquisition and accessing the hardware buffer on a 6562 card. I managed to figure out that problem but now I'm stuck when I try manipulating the data I obtain. (The original problem can be seen here: http://forums.ni.com/ni/board/message?board.id=70&thread.id=7926)
Briefly, my application is clocking and synchronising an ADC board and then looking at the raw ADC data that comes back from the board. To provide synchronisation I am sending a sync pattern on one data line and using a second line to send a "start of frame" indicator, a '1' bit when I know that the board is synchronised. This line otherwise only sends ‘0’s. This cable is wired back into the NI card and LabView. All data sent uses the NI-SHDIO Generation Express VI and I'm using the Acquisition Express VI in parallel with the Generation VI to capture the raw ADC data when it comes off the ADC board. Since I am acquiring both the ADC data and the frame indication data (which I am looping by connecting that output DIO to an input DIO), the digital waveform essentially contains 2 arrays and I can view these from a graph indicator within LabView.
No problems so far. In order to manipulate the data and look at individual frames I am writing the ADC data to file. To extract the digital data from the digital waveform I am using the following
-Get Waveform Components
-Get Digital Data Components
-Write to Binary File
To view and manipulate the data I read it into Matlab and this is where I can tell that something's not right. When I read the file into a variable in Matlab, the variable becomes a 1D double array of 40,008 elements. This seems very odd, considering the Acquisition VI only takes 20,000 samples. When I look at the 1D array more closely it looks like the two arrays have been cross added in some fashion. The 1D array certainly doesn't match either of the two arrays visible in the graph indicator inside LabView. I can understand if the file is reading one array after the other (20,000 + 20,000 almost equals 40,008 after all) but that doesn't appear to be the case.
I would greatly appreciate some help on how I can extract the two data lines either using Matlab or LabView. Currently it looks like LabView is making a hash of things whenever I try to manipulate or extract the two arrays from the digital waveform. I have tried a multitude of different
The most straight forward way would be using the "Converting Digital Waveform to Binary VI" but it can't handle two arrays within the same waveform. (The result looks like the two arrays exclusively OR’d together). To combat this I tried running two Acquisition Express VIs in parallel (one for ADC data, the other for the frame info) but got an error message referring to invalid handles. I presumed this meant that I can't run two acquisition
Sorry for the long post but I feel that I needed to fully explain the problem. I'm attaching my LabView code.
Thank you for reading,
Christian
PS. GenAcq2.vi is my code. Waveform_GenAcq2_Cfg.hws is sent by the first Generation VI; Waveform_GenAcq2_shorter_frame_indicators.hws by the second Generation VI.
01-18-2008 10:41 AM
01-18-2008 05:26 PM - edited 01-18-2008 05:26 PM
fid = fopen('c:\temp\digData.bin','r');
F=fread(fid, [256,8], 'uchar');
01-18-2008 05:28 PM
01-18-2008 05:33 PM
fid = fopen('c:\temp\digData.bin','r');The array "A" should then look the same as the 2D array in LabVIEW.
F=fread(fid, [8,256], 'uchar');
A=F';
01-29-2008 04:24 AM
04-13-2010 07:00 PM
Could anyone tell me how to convert 1D array of waveform(DBL) to digital data?
04-13-2010 07:39 PM
07-13-2011 02:35 PM
01-16-2012 02:03 AM
I dont know how to convert "1-D array digital waveform" can some one help?