LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

byte operations

Solved!
Go to solution

hi everybody 

I have   established  a comunication with serial port ..it sends strings in hex ..my problem is how to convert string in hex( 2 bytes) to perform this opeartion in order to extract numbers ( the string is composed by 2 bytes AxL and AxH)

acc=((axH<<8)|axL)/32768*16

Thanks for help 

0 Kudos
Message 1 of 3
(1,167 Views)

Use string-to-byte array function.

Santhosh
Soliton Technologies

New to the forum? Please read community guidelines and how to ask smart questions

Only two ways to appreciate someone who spent their free time to reply/answer your question - give them Kudos or mark their reply as the answer/solution.

Finding it hard to source NI hardware? Try NI Trading Post
0 Kudos
Message 2 of 3
(1,145 Views)
Solution
Accepted by topic author skisim

Hi skisim,

 

one (of many) possible solution:

I convert to I16 because of that scaling factor of 32768, which hints for signed 16 bit data…

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 3 of 3
(1,139 Views)