LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Reading 16 & 22 bit signed integers using Scan From String

Last week it was suggested to use Scan from String which is a new tool for me and worked well to be able to read in ans parse strings. After parsing the string, I'm having trouble converting the numbers into signed integers. The magnitude of some of the the outputs are unreasonably high then flip to near 0 then back up again. Sample String (With spaces added) $ 00 FCCE 00F6 3FFA93 0BFE 0C89 0DDB Message Format: Bytes 3-6 FCCE Heave acceleration bits 15-0 15-bit data, sign extended to 16 bits LSB : 0.001261g Sign “+” when accelerating upward Bytes 11-16 3FFA93 FOG Gyro 1 bits 21-0 Bits 22-23 are always zero 22-bit signed data LSB = 97.275 µ˚/s Sign corresponds to MEMS axis Sample Data File: $00FCCE00F13FFD78100910A811FA $00FCDF00F13FFCD3141614C71619 $00FCD600F33FFD20182118E61A39 $00FCDA00F73FFB3E1C2D1D051E58 $00FCDD00F73FFC32203921242278 $00FCDD00EF3FFDDC244525442697 The vi and a longer sample data file are uploaded to the ni ftp site. The zip file is named: IMU (9-15-08).zip. (Can't attach files to this message for some reason) Any help appreciated. Thanks, Chris
0 Kudos
Message 1 of 4
(2,819 Views)

Unfortunately, I had trouble understanding what you're referring to in terms of what the bytes mean. Are you saying that FCCE is supposed to be 0.001261? But in your second statement you said that you're looking to get signed integers. 0.001261 is not an integer.

 


The vi and a longer sample data file are uploaded to the ni ftp site
Errr... where?

 

Message 2 of 4
(2,812 Views)
I don't know why the text of my post became all crammed together after carefully spacing out the information. It's almost impossible to read. Ignore the .001261 this is my scale factor for the LSB. I should have left it out of the post. Sorry. I uploaded the files to: ftp://ftp.ni.com/incoming/IMU (9-15-08).zip They should be there, I see them on the site but last week an NI tech support eng could see other files I posted. When I click on Add Attachments to this post the screen flashes but no brower appears. Thanks, Chris
0 Kudos
Message 3 of 4
(2,798 Views)

Files uploaded to the "incoming" directory cannot be downloaded. That folder is intended to be used for submitting code to NI to investigate bugs and such things, not for forum posts.

 

What are you expecting FCCE to be? If the string is made of the characters "F", followed by the character "C", etc. (as opposed to the hex value of F, followed by the hex value of C, etc), then you can simply use Hexadecimal String to Number. Otherwise you need to use Type Cast.

Message 4 of 4
(2,791 Views)