Multifunction DAQ

cancel
Showing results for 
Search instead for 
Did you mean: 

Digital Waveform into Byte Array

I am reading a digital waveform in from a GPIO. The waveform comes in 835 samples and is displayed on a graph. I would like to take this data and convert it into a single byte. (U8)

Basically this is my MISO line on my SPI bus. I am using PCI6229 and oversampleing clock of 10Mhz. Therfore each byte is approx. 835 samples.

I know that the middle of my clock signal appears at 50/150/250 etc..

What I am trying to do is read the MISO line everytime the sample is one of these numbers.

I have broken my waveform into subsets, and I can see the data for each waveform, but I am having a tough time getting this into a single byte. Even if I convert the waveform into a binary array, I still get 835 bits. This needs to be "filtered" down to 8 bits. 

I may be going about this all wrong, so I am open to any other suggestions.

Thanks

Jamie

0 Kudos
Message 1 of 3
(3,330 Views)

Hi Jamie,

 

It may help if you send a screenshot or piece of code to explain a little more about the application.  However, I will try to give a suggestion to see if it helps solve this issue. 

 

Since you are oversampling your signal I assume you currently have an array of data values that is 835 samples long.  What you can do is manipulate this array of the 835 values and extract the desired values at 50/150/250 etc.  I believe this is what you want because in the array of 835 samples, you will have multiple samples that are the same value.  The correct function to use would be the Index Array.vi to remove the specified elements.  You can remove the desired 8 samples that would represent the 8 bit integer. 

 

Hope this helps!  If this is not what you are looking for please let me know. 

 

 

Regards,
Jordan F
National Instruments
0 Kudos
Message 2 of 3
(3,309 Views)

You are exactly right, this is what I am trying to do.

I am going down the same path that you suggest here.

Since I am so new to LabVIEW I just wanted to make sure that I was going down the right path and to make sure that there was not a simple solution that I missed.

 

Thanks

Jamie

0 Kudos
Message 3 of 3
(3,307 Views)