I'm trying to read data from a transmitter via RS232 and DasyLab V9.00.01. The transmitter sends only HEX-values. I have got a conversion formula
to achieve the final result from this HEX-value. Therefore I'd like to work with the pure HEX-Values in DasyLab.
The HEX-String looks like this:
2C 01 81 16 F7
With the help of a format string I get the interesting HEX-values:
81 61 F7
Now I could calculate my final result, but DasyLab converts it to ASCII. So I only get:
Which is equal to "0" as output value.
Is there any way to work with the HEX-Value alone and ignore the useless ASCII code?
Hopefully someone can help me with that.
what format string are you using?
or b, to just read the binary value of the character?
No matter which format you use, DASYLab will convert the incoming string to a floating point number.
If you use the a, then it will interpret the number literally.
If you use the ah, then it should take each character, and convert it.
2C 01 81 16 F7
should be interpreted by ah as
should interpret it as
Once inside DASYLab, you can then operate on these numbers using the bit logic module or the formula module to do the Hex math that you need.
if you need the values all at once, then set up additional channels to read each character, so that the module will have 5 or 10 outputs. The formula works better that way.
You can visualize the interpreted data in the Digital Meter, by changing the display to Hex.
Thanks for your fast response!
Am I supposed to enter the format of the data at any other point than at the format string?
As I sad, my format string is:
Therefore I should already use the right format, at least I hope so. I tried also ah and 2ah as you suggested, but the interpretation (RS232 Monitor) is always:
2C 00 04 27 30 , - - ' 0
When I control the connection between the RS232 modul and my digital meter the value transferred is always "0".
Also little HEX values can't be used because they always yield a value of "-".
I'm really helpless at the moment.
Does this work?
5 channels are set to read "b" or byte
Display the value (0-255) on the list, and display the Hex value on the Digital Meter.
You should then be able to use the bit logic modules and the formula module to process your decoding.