LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Byte Array to Byte

I'm having trouble converting a byte array to a hex byte that I can feed into a Serial Read Vi. The count byte indicates the number of bytes that follow in the message and need to be read. See the bad wiring between the Count array and the Boolean Array To Number converter.
0 Kudos
Message 1 of 4
(3,259 Views)
Schmir1,
Replace the 'Boolean Array to Number' function with a 'Array size' function in the diagram.

Pravin
0 Kudos
Message 2 of 4
(3,258 Views)
Hi schmir1

Let me see if I have got this right:
You want to get a byte in a string and convert it to an U8?

If so then there is a couple ways of doing this:
- You can use the string to byte array and then index the first element in the array.
- Or you can cast the string to an U8

Tim

P.S. your example didn't include the Serial Read.VI, to do this create a 'development library' from 'save
with options' menu item.
But I sorted out what you wanted to do from what was there.


schmir1 wrote:

> I'm having trouble converting a byte array to a hex byte that I can
> feed into a Serial Read Vi. The count byte indicates the number of
> bytes that follow in the message and need to be read. See the bad
> wiring between the Count array and the Boolean Array To Number
> c
onverter.
>
> ------------------------------------------------------------------------
> Name: Research_TelB.vi
> Research_TelB.vi Type: LabVIEW Instrument (application/x-unknown-content-type-LabVIEWInstrument)
> Encoding: base64
> Description: Read message based on count
0 Kudos
Message 3 of 4
(3,258 Views)
Cast to String didn't work for me but got me to look around. I found that Unflatten From String function was what I needed.

Thanks
>>> Bob <<<
0 Kudos
Message 4 of 4
(3,258 Views)