LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

how to connect mcu and pc using rs232,through the matlabview7.1

being a beginner of labview,i am not very sure how to use the rs-232 vi in labview.i have to connect
mcu and pc, my Q is whether i should write a programme specifically for the mcu part? or just doing
the part total in the labview platform  is ok?
0 Kudos
Message 1 of 4
(2,825 Views)
Hi soleil2006,

I assume you mean labview instead of matlab.
If I understand your quenstion correctly, you want to establish connection between a PC and a µC-Unit via serial RS232.

You have to implement serial communication on both sides.
In labview you can simply use the serial VIs found on the functions-pallette under "instruments-I/O". In order to be able to access the interface you have to install the VISA-driver from the driver-CD. Examples can be found in the labview folder under "labview\examples\instr\smplserl.llb" library.
Maybe the available serial ports appear as "ASRL..." and correspond to the COMs (ASRL10 ist the parallelport).
On the other side you have to implement serial interface on the mcu. How to do this, depends on the mcu-type and should be described in the mcu datasheet and programmers-handbook.
Also you'll have to define the transferprotocoll, -speed and the instructions you want to use.

Lorand
Message 2 of 4
(2,809 Views)

thank you very much, lorand.

now i get to know i have to do the programme in labview for PCpart and in C language for mcs-51.

but  my labview 7 only show VISA in serial function palette, i don't think VISA equal to rs232,should

i download RS232 .vi or create it on the basis of VISA? and how to find it ,it's a driver .vi or module?

it's quite confusing.

0 Kudos
Message 3 of 4
(2,795 Views)
VISA is used for RS-232, GPIB, VXI, USB, Ethnet, etc. That's the advantage of VISA - one API for all of these different interfaces. Open Help>Find Examples and go to the search tab. Enter serial and you will find Basic Serial Write and Read and Advanced Serial Write and Read. Opne either one to see how they work with VISA.
0 Kudos
Message 4 of 4
(2,789 Views)