05-08-2010 03:25 AM
Bonjour,
Je dois lire un octet d'une valeur supérieur à 127, Labview me retourne 27.
Dans l'aide j'ai vus que Labview ne donne une description ASCII que pour des valeurs allant jusqu'à 127.
Comment doisje m'y prendre ?
Labview 6.1
Windows XP
Hello,
I want read an byte with a value up to 127, but Labiew reurn a value arround 27
How I must do ?
Solved! Go to Solution.
05-08-2010 11:06 AM
Rather than the loop you can use the String to Byte Array function. That returns a U8 array, but you can use the To Byte Integer conversion function (To I8) to get an I8 array.
As for the values themselves, I would suggest placing an indicator on the string and setting the string to show in hex display mode. At least you can see if you have the correct string.
05-08-2010 11:43 AM
Thank for your help. I do change lyke I understood (my english is quiet poor...)
I have an other programme who comunicate with the instrument. I know that the 6° byte must be higher than 18 (upper than 7F in fact).
But with Labview I have only 18.
05-08-2010 11:53 AM
More clearly.
The other programme do a calculation and show only the result obtain with the 6° byte.
So I don't no the excat value of the byte, but I know the calculation, and so I know that this byte it'is more heigher than 18 (maybe FF).
05-08-2010 12:02 PM
05-08-2010 02:25 PM
Rigide wrote:Thank for your help. I do change lyke I understood (my english is quiet poor...)
I have an other programme who comunicate with the instrument. I know that the 6° byte must be higher than 18 (upper than 7F in fact).
But with Labview I have only 18.
While it might be higher than x18, an I8 is signed, and therefore it cannot be higher than x7F - it has a range of -128 to 127. A U8 is unsigned and therefore it has a range of 0 to xFF. However, x18 is the same value whether you treat it as signed or unsigned. I don't see how LabVIEW could be reading a wrong value over the serial port. Are you sure you are looking at the correct byte? Your code shows that you are splitting the string twice. Are you sure you are doing that correctly?
Since you are running on Windows you can double-check the received string by using PortMon. This allows you to see what is actually being received by the serial port driver of Windows.
P.S. I was actually referring to the To Byte Integer function.
05-08-2010 04:02 PM
Yes I'm sure to get the right part of the string : the first 5 bytes are OK, and the 7 last are too.
I will test PortMon tomorow.
05-09-2010 01:02 AM
Here is what I get with Portmon :
What's mean error ring ?
05-09-2010 09:25 AM
05-09-2010 11:21 AM
Thank a lot for your help.
With Portmon I understood better what happens. So I think I have find what was wrong : some subtility if the value is greather than x7F
It seem I find it, I will confirm with the fabricant tomorrow.
Best regards