LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

sending binairy value rs232

hello,

I've got a problem, i try to send the binairy value, and not ascii code...

When you send you must send a string, so I convert a binairy number to a string, but if the value is above 10 he converts it to 10.. But i want that he doesn't convert that to asci but to binairy,,, so 63 is 111111 and not A...

Who can help me?
0 Kudos
Message 1 of 9
(3,296 Views)
See the attached example. As you can verify, 63 is not an "A" indeed, it's a "?" character. The "A" character is a 65.
Paolo
-------------------
LV 7.1, 2011, 2017, 2019, 2021
0 Kudos
Message 2 of 9
(3,279 Views)
Thank you it works partly,

What i'm trying to do is:

send a value from 0 - 255 to my PIC accros the RS232..

If the value is not ascii he doesn't send a value, for example 128 is ..  (With NI spy VISA Write ("COM1", ".."))

Now is my question, how can i send a decimal value 0-255 to the PIC as a String. The value needs to be one character, so he can store it in just one register... (binairy value 255 is 11111111)


Message Edited by marten on 05-30-2007 06:23 AM

0 Kudos
Message 3 of 9
(3,237 Views)
This does not correspond to my experience. I set 255 into my U8 constant (see the ByteToString.vi example), then i wire my string to a VISA Write.
NI Spy does report an FF output to the serial port, as expected.
Paolo
-------------------
LV 7.1, 2011, 2017, 2019, 2021
0 Kudos
Message 4 of 9
(3,229 Views)
Hi marten,

conversion from U8 to string can also be done without using typecasting:

Message Edited by GerdW on 05-30-2007 02:45 PM

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 5 of 9
(3,216 Views)
yes, that wasn't the problem (sorry Smiley Sad)

I'am sending the value 255 to the PIC, when I do this in Hyperterminal the memory is 255 x FF but when I do this in Labview he got 'holes' in his memory...

With the advanced VI it's working properly, but with my program not....

It seems to be that he sends more then one char each time... but i can't find it
0 Kudos
Message 6 of 9
(3,209 Views)
yes, that wasn't the problem (sorry Smiley Sad)

I'am sending the value 255 to the PIC, when I do this in Hyperterminal the memory is 255 x FF but when I do this in Labview he got 'holes' in his memory...

With the advanced VI it's working properly, but with my program not....

It seems to be that he sends more then one char each time... but i can't find it
0 Kudos
Message 7 of 9
(3,208 Views)
Hi marten,

sounds like you configured the termination characters wrong.
Maybe you can post your vi?
Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 8 of 9
(3,204 Views)
Can you post your program or a part of it? Preferably for version 8.0.1 or earlier.
Paolo
-------------------
LV 7.1, 2011, 2017, 2019, 2021
0 Kudos
Message 9 of 9
(3,201 Views)