LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Convert real array to bits

Hello,

with a DMM i execute a highspeed measurement of an DUT that represent bits.

Attached a file with the data.

Now i want to convert this into 0 and 1s.

The binary string should be in this case 001000100. At the 1 there the sinus is longer in the upper area.

How can this be done?

 

Thanks for help

0 Kudos
Message 1 of 6
(3,678 Views)

@OnlyOne wrote:

...

How can this be done?

 


DMM_to_BitStream.png

 

You have bogus info at the begining and the end that I tossed.

It looks like a "high" is greter that 11.3.

Then guessing the data is over-sampled by a factor of 4 I reshaped the array and averaged goups of four samples and then compared to see it was greater than 0.8.

 

A lot a fudging but the answer is correct.

Not very useful but I enjoyed the riddle.

 

Ben

 

 

Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
Message 2 of 6
(3,651 Views)

Hi Ben,

thank you for the code.

Meanwhile i modified my example and have now two types of sourcedata where different bits are set to 1.

In the code the are two array controls and and a boolean slider to select between the two arrays. After this your code is coming.

 

A description of the arrays says::

0 = array goes low -> high

1 = array goes low -> high -> high

Which means the

Data_U should return 0100100

Data_L should return 0010100

 

Is there a way to modify your code to get these results?

 

Thanks for the help again

BR

T

 

0 Kudos
Message 3 of 6
(3,602 Views)

...or is it perhaps saver to measure the pulse-durations to get the binary result?

 

Attached a new file with data as my previous upload contained two times the same values in the array 😞

0 Kudos
Message 4 of 6
(3,589 Views)

Hi OnlyOne,

 

What I posted was just a quick hack. If you want to follow-up on this effort, rather than re-invent the wheel I suggest you do some searching and research on the theory behind serial interfaces. The last time I tokk a "deep dive" into that subject ( ti was the tech manual for a FastCom ESCC-PCI Asycronous serial interface) it over-sampled the dat by a factor of 10. Additionally you will need a way to properly "frame the data" which is the term used to describe the logic required to determine where in a signal a byte starts and stops. In serial lingo that is the "Start Bit". In my example I just eye-balled the data and tossed the data at the front end and the back end to 'frame the data". The next concept that enters is what is called "bit cell time". It speaks of the portion of a signal that contains a data bit. Durring a "bit cell time, we have to deal with the possibility that the data line is transistioning OR could could remain in the same state as the previous bit cell time.

 

To this end...

 

I seem to recall that NI offered some examples for FPGA to handle serial data tha MAY help you with your cause.

 

And before I go anywhere else, I would be neglegent if I did not point out that monitoring a serial data line with a multimeter is highly unorthodox at best.

 

Can you share why a digital interface is is not being used?

 

Trying to help you as best i can,

 

Ben

Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
Message 5 of 6
(3,570 Views)

Hi Ben,

my problem is solved by using the PulseWidth to get the 1 and 0s.

Thanks a lot for your description and help.

The data in the arrays are measured in a time of ~3ms. My system only has the DMM so i have no choice to use something else.

I know the startbit as this is a trigger level for the DMM.

BR

T

Message 6 of 6
(3,562 Views)