From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

Instrument Control (GPIB, Serial, VISA, IVI)

cancel
Showing results for 
Search instead for 
Did you mean: 

Interfacing AVR with Labview Serially

Hello TO all !!
I am a new user to LabView 7 and plan to use it primariy for the GUI of my Microcontroller Programs ( I use 89C51/52 and AVR's ). I searched the above question bud cud not find any satisfactory results... 😞
I was hoping somebody could guide me to communicating via serial ports with my controllers. Simply;
" How can i send data (strings, dec no's HEX) from LabVIEW to the controller ? "
" And how can i display in a linear graph, the data that i send from the uC ? (this might seem a lame question coz it has been asked ("How to read and display a signal from my PIC Microcontroller onto Labview") but i cant make anything out of it ......"
Hope to see a reply soon ......

Nem|s|s 🐵
0 Kudos
Message 1 of 5
(11,496 Views)
Nem|s|s,

LabVIEW uses VISA for serial communication. LabVIEW strings are like Pascal Strings, containing the length of the string as a sub-variable of the string. So there's no need to differentiate between binary and other content (0x00 is not considered a string termination).
Search for examples for serial communications!
Basically you need to open a serial port, configure it and enter a While loop:
While not 'End' do
case there are data to send, send it with 'VISA write.vi'.
check 'Bytes at serial Port.vi'.
case data availabel, read it with 'VISA read.vi'.
append the read data to the string read in earlier loopings.
check for complete datagrams.
case datagrams availabel, remove 'em from the string, convert it to displayabel data and display it.
Whend
close serial port.

For the check for complete datagrams and the transformation, this depends on _your_ data format.
Greetings from Germany!
--
Uwe
0 Kudos
Message 2 of 5
(11,491 Views)
Nem,

1. Serial RS232 connection: I assume that is established (voltage levels, baudrate, handshake, data/stop bits)
2. The VISA vis will handle the data (depending on your protocol bytes of any value in any order) as strings, but you can easily convert them to an array of bytes (or for sending from a byte array to a string).
3. The meaning of that bytes depends on your software (plain ASCII text or raw AD values (8bit or grouped 16/32bit with or without sign))
4. There are so many ways to read (RS232) data, to interpret and to display them, impossible to answer your question. LabVIEW makes it very easy to quickly realize your needs, however thousands of LV programmers solve these tasks daily in different ways.

I spend 8min to write a simple reader (including launch of LV 🙂 and even some comments :-0
maybe I could have been faster by using express vis and assistants... just not used to them
Greetings from Germany
Henrik

LV since v3.1

“ground” is a convenient fantasy

'˙˙˙˙uıɐƃɐ lɐıp puɐ °06 ǝuoɥd ɹnoʎ uɹnʇ ǝsɐǝld 'ʎɹɐuıƃɐɯı sı pǝlɐıp ǝʌɐɥ noʎ ɹǝqɯnu ǝɥʇ'


0 Kudos
Message 3 of 5
(11,467 Views)

hi 

im using atmega 32 (8bit microcontroller AVR) to control the servo motors of my robot, i designed the graphic user with labview but my program has some error to connect to my robot.

is any one can help me i can send my program. the program can't find the com of the pc, can't read it.

 

0 Kudos
Message 4 of 5
(8,770 Views)

very good it was very usefull for me thanks alot

 

0 Kudos
Message 5 of 5
(5,844 Views)