LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to communicate with PC via USB

Hi,

 

I'm a beginner with LABVIEW, So please help.

In my application, I need to communicate between PC and a microcontroller (STM32) by USB and then send/get command to/from LABVIEW via USB PC port.

Could you help me please, I hope that someone can share with me a VI which allows read/write to/from USB port.

 

Thanks for your help

HJe 

0 Kudos
Message 1 of 7
(5,259 Views)

Hi,

 

Wha
There are several solutions :
1) You know how it communicates (maybe it simulate a com port, and you can use VISA Vi's)

2) There may be drivers developped by users that you can find on NI web site. (just search STM32 on NI web site...)

Best regards,

V-F
0 Kudos
Message 2 of 7
(5,257 Views)

Your question is complicated because you have not specified what kind of USB class the USB device is. USB communication isn't like serial, unless the USB device's firmware is written such that something like the FTDI drivers can be used, which basically provide a simulated serial port to your applications. I would strongly suggest you read the USB nuggets by Intaris. The first one: Nugget: 1 of n : GEtting started with USB communication via VISA - LabVIEW - NI Discussion Forums

0 Kudos
Message 3 of 7
(5,235 Views)

Hi smercurio,

 

your link in not working. Could you please give me the right link.

I'm using USB virtual COM port class.

 

Thanks,

HJe

0 Kudos
Message 4 of 7
(5,217 Views)
0 Kudos
Message 5 of 7
(5,213 Views)

@HJe wrote:

Hi smercurio,

 

your link in not working. Could you please give me the right link.

I'm using USB virtual COM port class.

 

Thanks,

HJe


If you are using the USB virtual COM port class then it's much easier. As I indicate, your device should show up as a serial port on your computer. Then you'll be able to talk to it like any serial device, and there are examples that ship with LabVIEW on how to do serial communication.

 

Have you verified that your computer's device manager recognized the micro as a serial device?

0 Kudos
Message 7 of 7
(5,208 Views)