Jump to content

Join of two bytes


Recommended Posts

QUOTE (d_nikolaos @ Oct 13 2008, 07:51 AM)

Hi,

I want to join 2 bytes that I take them from the serial port. Is that possible?

Except for that, I want to have somethink like start and stop.

I want to sent from a PIC through the RS232 some numbers in dec form like ('#19*')

# = start byte

* = stop byte

Is that possible?

Everything is possible, but what kind of inputs and outputs are you looking for?

Check out "Concatenate String", "Format Into String", the String/Number Conversion palette, and possibly the Data Manipulation palette.

It would also help if you post some code (or a block diagram screen capture) of what you are trying to do.

Link to comment

My input will be 12 bits. But with the RS232 protocol I have to split these 12 bits to 8 and 4 bits.

So finaly my input will be 8bits the first time and 4 bits the second.

Then I want to join them with some way and then I will convert this number to a decemical form.

So my input is somethink like this 00001101 and 0010 and my output 525.

Link to comment

QUOTE (d_nikolaos @ Oct 14 2008, 08:32 AM)

My input will be 12 bits. But with the RS232 protocol I have to split these 12 bits to 8 and 4 bits.

So finaly my input will be 8bits the first time and 4 bits the second...

As jdunham said, it would really help if you could post some code.

To combine two 8 bit numbers into one 16bit number, you can use the "Join Numbers" primitive in LabVIEW.

I don't know if you transfer the data in network byte order, or intel byte order, but you can handle either case with the "Join Numbers"

/J

Link to comment

QUOTE (d_nikolaos @ Oct 14 2008, 10:13 AM)

...how I can make this function to understand that the first 8 bits is hi and the other 8 bits is lo.

Second how I can convert this 16bit to number...

The output is a 16bit number.

To change the order of the Hi and Low bytes, just wire the node in different order.

Use the LabVIEW contextual help to display how a function is used.

/J

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.