10-29-2013 04:40 AM
Hi.
I need help to convert hex string (0-9) directly to decimal. Lux meter TES 1339R send via rs232 value of measurement in hex string. This is easy to display but I need value.
For example :
- Measured value is 453,3 Lm -> 45 33 hex ( display hex)
- Measured value is 236,8 Lm -> 23 68 hex ( display hex)
Maybe some one know better method then index table with all corresponding values.
Additionally maybe someone have experience with TES devices and know how to handle query. Device which I have only reply transmit values.
10-29-2013 05:12 AM
This is ONE way to split the numbers (maybe not the best). Though it works.
Then you just have to convert it to hex
10-29-2013 06:18 AM
converting it to hex makes it like this, just incase
10-29-2013 06:48 AM
10-29-2013 08:53 AM
10-29-2013 10:29 AM
Bern I guess you are right.
You can simply reverse the steps from my post, I already did it for you though just incase.
10-29-2013 10:33 AM
10-29-2013 10:51 AM - edited 10-29-2013 11:07 AM
@Milus wrote:
I need help to convert hex string (0-9) directly to decimal. Lux meter TES 1339R send via rs232 value of measurement in hex string. This is easy to display but I need value.
For example :
- Measured value is 453,3 Lm -> 45 33 hex ( display hex)
- Measured value is 236,8 Lm -> 23 68 hex ( display hex)
Maybe some one know better method then index table with all corresponding values.
Hexadecimally formated numbers are 0..F, not 0..9, and I thus have no idea what you are actually talking about. Please explain!
The two example conversions you are showing are just a multiplication by 10 (or division by 10, depending on the direction). If you want to display number in hex, use example data that includes characters A..F for less special cases.
What is the question about tables? In LabVIEW, a "table" is just a 2D array of strings with a special indicator. Indexing is to get values out, not to do anything with "corresponding values", whatever that means.
Please attach a small example VI that contains a few typical raw strings as recevied by the instrument as diagram constant. Then explan what kind of output you want from them.
Also include an example table (make current value default before saving) and explain to us what you want to do with it.
We definitely need more information, there are too many conflicting statements in your original post. Thanks!.
10-30-2013 03:56 AM
Hi
The device I'm using send measured value as hex in range 0-9.
see attachment . Measured value 354,9 lm
I try proposal of GerdW and this works!!!
I checked whole range and I don't find any problem.
Thanks a lot GerdW
10-30-2013 03:57 AM - edited 10-30-2013 03:58 AM