LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

serial communication

hi
now i am using VISA in labview to communicate with MCU via serial port.
VISA write uses ASCII code,but i feel some unconvenience to use ASCII code.
can i use binary directly rather than ASCII to write several bytes to
serial port? this means the MCU receives the binary data directly.
0 Kudos
Message 1 of 3
(2,748 Views)
"liu" wrote in
news:pdKFc.6876$LT3.268952@news.xtra.co.nz:

> hi
> now i am using VISA in labview to communicate with MCU via serial port.
> VISA write uses ASCII code,but i feel some unconvenience to use ASCII
> code.
> can i use binary directly rather than ASCII to write several bytes to
> serial port? this means the MCU receives the binary data directly.

For me the difference of a string (collection of characters) and a U8 byte
array isnt' so big.


In LabVIEW you have the "Byte Array To String" function

Function Palette->String->String/Array/Path Conversion->Byte Array To
String

--
Rolf
Message 2 of 3
(2,748 Views)
VISA write uses ASCII code
--- Not quite correct. VISA WRITE uses a STRING as the data it sends, but you control what is in the string.

The string can be composed of ASCII text, or binary data, anything you like. You can FLATTEN any structure you want to a string. You can convert an array of bytes to s atring. You can cast anything to a string.

The string can have NULLs in it without problems.
Steve Bird
Culverson Software - Elegant software that is a pleasure to use.
Culverson.com


LinkedIn

Blog for (mostly LabVIEW) programmers: Tips And Tricks

Message 3 of 3
(2,748 Views)