LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Writing binary representation of hex to serial port


@stephenb2 wrote:

I did reverse the binary array before conversion so that the MSB came first (not shown in the trimmed code sample).


My code will create a string with exactly 5 bytes.

 

Use the middle code (note that I had to reverse the array first because you apparently reversed it earlier).

 

Have you tried? Does it work?

0 Kudos
Message 11 of 14
(1,149 Views)

@altenbach wrote:

@stephenb2 wrote:

I did reverse the binary array before conversion so that the MSB came first (not shown in the trimmed code sample).


My code will create a string with exactly 5 bytes.

 

Use the middle code (note that I had to reverse the array first because you apparently reversed it earlier).

 

Have you tried? Does it work?


I hope to try the solutions with the hardware this morning.

 

I've attached your middle solution as a standalone. Did I get that right? Why a string subset with offset of 3?

 

hex test.png

 

0 Kudos
Message 12 of 14
(1,122 Views)

@stephenb2 wrote:
I've attached your middle solution as a standalone. Did I get that right? Why a string subset with offset of 3?

Because converting to U64 will get you 8 bytes. You only need five of them.

 

You don't need any hardware to test. Does it otherwise look right currently?

Message 13 of 14
(1,117 Views)

@altenbach wrote:

Because converting to U64 will get you 8 bytes. You only need five of them.

 

You don't need any hardware to test. Does it otherwise look right currently?



I understand now, thanks. Both solutions produce the same result and seem valid.

 

hex test.png

 

 

0 Kudos
Message 14 of 14
(1,106 Views)