LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How can i write a sign string in VISA Write?

Hello everybody.

I would like someone to help me. I have an array, which is transformed (by Byte Array to String) in a string that reaches the VISA Write Serial Port. My problem is that when making the transformation with Byte Array to String, i  lose all the bytes with sign (negative).
What can I do? I don't want to  lose the sign bytes and be able to send them to VISA Write Serial Port.

Thank you very much.
0 Kudos
Message 1 of 3
(2,660 Views)
It sounds like you have a typecasting problem.  First, why do some of your bytes have a sign?  I assume they are I8.  Strings are based on U8 because they are just a series of ASCII characters vs. values.  The ASCII character table goes from 0 to 255.
 
What happens on the other end of the VISA communication string?
 
One thing you could do is to typecast your bytes to a U8.  Though I think the coercion dot of an I8 byte array going into the byte array to string is doing this automatically.
0 Kudos
Message 2 of 3
(2,648 Views)
Hi,


This was already answered in another post with the same title in spanish.You can find it here:

http://forums.ni.com/ni/board/message?board.id=6170&message.id=7257&query.id=21551#M7257

In short and going beyond of the meaning of a negative byte, you can do it with the one of the functions in the Palette of String/to Number Conversion.

Best.


0 Kudos
Message 3 of 3
(2,630 Views)