取消
显示结果 
搜索替代 
您的意思是: 

Hex Conversion

Hi anyone,
 
How to convert FF01 (2bytes) to 111111111 (binary format)???
 
regards,
Simon
0 项奖励
1 条消息(共 8 条)
3,931 次查看
Simon,
The conversion is done with the Display Format property (right-click on the control or indicator and choose Display Format...).



0xFF01 in binary would be 1111111100000001. See my other screenshot.

Message Edited by Bill@NGC on 09-16-2007 09:27 PM

下载全部
0 项奖励
2 条消息(共 8 条)
3,917 次查看
Ok, I posted the wrong Display Format screenshot showing the Hex format. Here's the one for binary.
3 条消息(共 8 条)
3,911 次查看

FF01 (=2 bytes) cannot be "converted" into 11111111 (=1 byte) without loss in information. Seems you want to keep only the first byte, so if the FF01 is a 16bit numeric, you can use "split number" and only take the high order byte as U8.

If FF01 is a 2 byte binary string, use "string subset" to get the first byte.

How it is formatted for human consumption on the front panel is irrelevant for the underlying data. FF and 11111111 are the same. If you want it displayed differently, use Bill's advice above.

If you could explain in a bit more detail what you actually want, we can offer more specific advice. 🙂

4 条消息(共 8 条)
3,905 次查看

Hi guys,

Thx for the response. What i doing now is monitor each bit being set high or low when the device return back hex data through com port. If received FF01, then i know all 9 bit set high (111111111), same for 0000, then all bit set low(000000000). Attach with my test.vi.

regards,

0 项奖励
5 条消息(共 8 条)
3,896 次查看
Sorry, I did not count right, thought you only had 8 bits. 🙂
 
Anyway, it seems your data is probably little endian. If you use unflatten with the little endian option, you don't need to split the number. Just format with %09b and you get the binary pattern (reverse the string if desired). I assume that you can never have an input corresponding to more that 9 bits.
 

Message Edited by altenbach on 09-17-2007 12:01 AM

下载全部
6 条消息(共 8 条)
3,885 次查看
Hi altenbach
This's the one that i'm looking for. Thanks for the help.
 
Thx and Regards,
Simon
0 项奖励
7 条消息(共 8 条)
3,875 次查看
8 条消息(共 8 条)
3,858 次查看