Simulink: Bitstring extraction from 64bit output of measurement device
5 visualizzazioni (ultimi 30 giorni)
Mostra commenti meno recenti
Alexander
il 22 Lug 2015
Modificato: Sainath Varikuti
il 24 Lug 2015
Hi
I have a device, that outputs several measurements via serial port. Each sample is a 64bit string, which I currently interpret as a double, but the actual values are represented by substrings in this 64bit string. Therefore, I would like to extract e.g. 10 bits from the 42th bit to the 51st bit, so I get a value between 0 and 1023, which is then converted according to some formula.
How should I go about this extracting?
0 Commenti
Risposta accettata
Sainath Varikuti
il 24 Lug 2015
Modificato: Sainath Varikuti
il 24 Lug 2015
One approach is to get the 'uint8' representation of the string and extract the 6th and 7th Byte. Then using the 'Bitwise AND' block along 'Integer to Bit Converter Block' in Simulink, you can extract the bits from 42 to 51.
Refer to the documentation page for more information.
0 Commenti
Più risposte (0)
Vedere anche
Categorie
Scopri di più su Data Converters in Help Center e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!