08-05-2023 10:59 AM
Hi everyone ,
I convert number to hexadecimal string, the conversion in ok .I get what I want it(I place indicator which show me that value) . but when I send it serially its different.
I would greatly appreciate someone take a look at the attached screenshot .
thank you.
08-05-2023 05:33 PM - edited 08-05-2023 07:14 PM
We cannot tell from a picture what you are doing, especially since you don't show the display style, datatype of constants, or radix.
What's in the U16 array? What are all elements of the string array? What's the point of the typecast? What size string do you expect after the FOR loop? What is a "hex integer string"? What's the logic behind the code? Why is there a coercion dot?
Please attach your VI. Also give a link to the manual for the device.
@lal_00 wrote:
but when I send it serially its different.
I am sure you are aware that there a millions of ways to be "different". What's the difference???? Explain in detail!
08-05-2023 11:45 PM - edited 08-05-2023 11:53 PM
Its I part of another code. but I attached the screenshot which shows who I used it.
and I also attached vi.
I am sending it through Ebyte e32.
https://www.ebyte.com/en/product-view-news.aspx?id=108
thank you for your response.
08-06-2023 12:40 AM
So what would be typical values and array size for the I64 input array. (And why would it be I64???)
You code seems wrong in so many places! With each iteration, you cast a 1byte string to U8, add it to a I16 number in a shift register, thus coercing it to I16 (why???), then display it in a I64 indicator (why???). What length do you expect the output string to be?
That index array and typecast could be replaced by simple math.
Do you have an example for an input array and correct result?
08-06-2023 09:41 AM
Form a wild guess, your input array contains the position of bits to set in an U8 numeric. So if it contains the number 1..8, we get 255 (FF) that can be cast to a binary string with one element or formatted into a hex string (two characters, each 0..F exclusively).
Here are both possibilities. You need to see what you instrument really wants: