LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

merging consecutive bytes

Solved!
Go to solution
0 Kudos
Message 11 of 17
(1,220 Views)

That is the Feedback Node that has been right clicked on and had "Change Direction" selected. The top one has had its properties changed to have a delay of 2 (default, is 1). It is similar to Steve's suggestion of using a shift register (which would have the advantage of giving you your loop to get each of the bytes).

 

Rob

0 Kudos
Message 12 of 17
(1,211 Views)

@baseball07 wrote:

The data is being sent from a microchip microprocessor, using the internal 8-bit USART transmitter which goes to a bluetooth transmitter.  I first send the 8-bit header, then the data of interest which is split into two bytes.  Since the transmitter is only able to send one byte at a time, I had to divide it into 3 parts and send separate, rather than a single 3-byte transmission.  My program needs to find the header and delete, then combine the next 2 bytes that follow which is the data, and repeat.   




 

You don't need to delete the header, simply ignore it and process the next two bytes.  Use the header as a trigger.  Scan the incoming string using a loop.  Load the data bytes 1 and 2 after your header is received.

-----------------------------------------------------------------------------------------
Reese, (former CLAD, future CLD)

Some people call me the Space Cowboy!
Some call me the gangster of love.
Some people call me MoReese!
...I'm right here baby, right here, right here, right here at home
0 Kudos
Message 13 of 17
(1,199 Views)
Solution
Accepted by baseball07

@baseball07 wrote:

The data is being sent from a microchip microprocessor, using the internal 8-bit USART transmitter which goes to a bluetooth transmitter.  I first send the 8-bit header, then the data of interest which is split into two bytes.  Since the transmitter is only able to send one byte at a time, I had to divide it into 3 parts and send separate, rather than a single 3-byte transmission.  My program needs to find the header and delete, then combine the next 2 bytes that follow which is the data, and repeat.   




 

You don't need to delete the header, simply ignore it and process the next two bytes.  Use the header as a trigger.  Scan the incoming string using a loop.  Load the data bytes 1 and 2 after your header is received.

-----------------------------------------------------------------------------------------
Reese, (former CLAD, future CLD)

Some people call me the Space Cowboy!
Some call me the gangster of love.
Some people call me MoReese!
...I'm right here baby, right here, right here, right here at home
0 Kudos
Message 14 of 17
(1,199 Views)

Thanks everyone, I took your suggestions and the program runs very good!

0 Kudos
Message 15 of 17
(1,180 Views)

A couple tips:

 

1.  Don't split the array wire and use two different Index Array functions.  Use a single index array.  Drag the bottom border downward and you'll have two outputs.  By default, they'll be indices 0 and 1, so you won't even have to wire up constants to the index input.

 

2.  Your byte manipulation is a Rube Goldberg.  To convert the integers to string Hex characters, concatenating them, then converting the hex characters back to an integer is just not necessary.  There is a Join Numbers function that will convert two U8 integers to a single U16 integer.

 

3.  Also since you are just getting a single byte from the Read function, I would convert that to a U8 array, then indexing the array there to get a single element before putting it into the right hand shift register.  That way you don't need to do all the Index Array functions for the data coming out of the left hand shift registers.  They will already be a scalar integer.

Message 16 of 17
(1,178 Views)

Ah, Rube Goldberg.  I get it now.  I've seen this name mentioned many times on the forum but did not have a clue as to walk folks were talking about.  Thanks for the link to the thread.

-----------------------------------------------------------------------------------------
Reese, (former CLAD, future CLD)

Some people call me the Space Cowboy!
Some call me the gangster of love.
Some people call me MoReese!
...I'm right here baby, right here, right here, right here at home
0 Kudos
Message 17 of 17
(1,163 Views)