Jump to content

How to convert a 8 bits signal in 16 bits signal


Recommended Posts

How can I concatenate these 2 parts of 8 bits and plot them in a chart?

Is there a function that do this for me?

Look in Numeric>>Data Manipulation to find Join Numbers and Split Number. Join Numbers will take two U8s and turn them into a U16. Split Number will do the opposite. If you are dealing with arrays of your 16bit data, you may want to also look at the Decimate 1D Array and Interleave 1D Arrays.

post-11268-008772500 1277147493_thumb.pn

Link to comment

Look in Numeric>>Data Manipulation to find Join Numbers and Split Number. Join Numbers will take two U8s and turn them into a U16. Split Number will do the opposite. If you are dealing with arrays of your 16bit data, you may want to also look at the Decimate 1D Array and Interleave 1D Arrays.

post-11268-008772500 1277147493_thumb.pn

Thanks for the answer Croos rulzs, but i how i will I able to "save my first incoming 8 bits from serial port .

My full problem is that a DSP is sending a 16 bit data information ( its send fist the MSB to the LSB), but i'm using a serial port which transfer 8 bits at time.

How will I be able to save the first 8 bits ( first part of data) and after that join this number with the second part of data , using the function JOIN NUMBERS which you spoke of..

Thanks.

Edited by leonardovieira
Link to comment

Look at Croos rulz diagram again and

you will see that all you need to do is make 2 unsigned 8 bit numbers from the serial data you are getting from the instrument.

Use the string conversion functions to convert your string representation into a numeric one.

Once you have both numbers available plug em into the Solution shown above (with some minor modifications of course)

As to the actual serial communications part I can't answer that because there is not enough information.

Link to comment

Aquisição 16 bits with error.viAquisição 16 bits sem case.viTG and CROSS thanks for the help. I'm very new and labview so i'm having my dificulties.

I'm ataching to of my VI's first of them uses only one part of the Cross Rulz diagram.

But if I use teh full of Cross Rulz diagram it doeesnt work because the type of data is diferente. Look.

It seem to be a very easy thing to do and I'm complicating it. If you may help me. What I'm doing wrong?

Aquisição 16 bits sem case.vi

Thank you guys.

Link to comment

Look in Numeric>>Data Manipulation to find Join Numbers and Split Number. Join Numbers will take two U8s and turn them into a U16. Split Number will do the opposite. If you are dealing with arrays of your 16bit data, you may want to also look at the Decimate 1D Array and Interleave 1D Arrays.

post-11268-008772500 1277147493_thumb.pn

The type cast function is a much cleaner way to do this. I suspect significantly faster as well.

~Jon

Link to comment

Sorry I do not have code capture tool installed properly yet. SHame on me.

Why not first get the complete response from the instrument then you can make some code to test for proper conversion

of the strings without having to worry doing it all at once so soon.

Look for any termination character or

if you know for sure that it is exactly 8 bytes at a time then get the entire response in 2 stages and get the two 8 byte response strings.

Once you have the exact response then you can figure out how to convert it to unsigned integer etc..

Make sure instrument is not sending extra termination character or filter it out with string function to remove whitespace.

Look at the two strings the instrument returns then work from them

(off line so to speak) until you can get the string converted properly to the unsigned integer

You can use LabVIEWS display utiliy to see exactly what the instrument returns.

(Right click on string ind and select '\' codes display so that you can see all the characters that are returned from the instrument.

This way you know exactly what you are working with.

Link to comment

Sorry I do not have code capture tool installed properly yet. SHame on me.

Why not first get the complete response from the instrument then you can make some code to test for proper conversion

of the strings without having to worry doing it all at once so soon.

Look for any termination character or

if you know for sure that it is exactly 8 bytes at a time then get the entire response in 2 stages and get the two 8 byte response strings.

Once you have the exact response then you can figure out how to convert it to unsigned integer etc..

Make sure instrument is not sending extra termination character or filter it out with string function to remove whitespace.

Look at the two strings the instrument returns then work from them

(off line so to speak) until you can get the string converted properly to the unsigned integer

You can use LabVIEWS display utiliy to see exactly what the instrument returns.

(Right click on string ind and select '\' codes display so that you can see all the characters that are returned from the instrument.

This way you know exactly what you are working with.

Guys Thanks for all the answers. I've managed to convet the signall.

Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.