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.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Communication Via USB

Bonjour,

 

Je souhaite envoyer des commandes de type chaînes de caractères à un appareil par l'intermédiaire d'un port USB de mon pc.

 

Le schéma de câblage est le suivant:

 

Appareil->RS-232->USB->PC

 

J'ai regardé les exemples fournis avec LV mais je n'ai pas réussi à envoyer/recevoir des données.

 

L'appareil n'était à la base pas reconnu par windows, j'ai donc suivi ce tuto : http://zone.ni.com/devzone/cda/tut/p/id/8523  pour l'installer en USB RAW.

 

J'ai ensuite utilisé les fonctions VISA Open, VISA Close,  VISA Read et VISA Write mais rien ne semble fonctionner.

 

Merci de m'indiquer s'il existe des précautions particulière à prendre pour la communication par USB.

 

Cordialement,

 

Teka_22

___________
Labview 8.2 version étudiante
Sound & Vibration Toolkit
0 Kudos
Message 1 of 4
(2,378 Views)

English c/o Google Translate:

 

 


Hello,

I want to send commands to type string to a device via a USB port on my pc.
The wiring diagram is as follows:

Device-> RS-232-> USB-> PC

I looked at the examples in LV but I was not able to send / receive data.
The aircraft was the basis not recognized by Windows, so I followed this tutorial: http://zone.ni.com/devzone/cda/tut/p/id/8523 to install a USB RAW .
I then used the VISA functions Open, Close VISA, VISA Read and VISA Write, but nothing seems to work.

Thank you to indicate whether there are special precautions for communication via USB.

 

Step 1: Undo EVERYTHING you did regarding creating a USB RAW device.If you are using a USB<-->RS-232 converter then you will have virtual COM ports. To your application they will appear as "regular" serial (COM) ports.

Step 2: Treat the device as an RS-232 device. Communicate with it using the virtual COM port. Verify that you can communicate with it by using a communication program like HyperTerminal (if you're on Windows) and open a connection to the COM port to which your device is connected. Send some commands (check the documentation of your device). Then, take a look at the serial examples that ship with LabVIEW. Open the Example Finder (Help -> Find Examples) and search for "serial". The key thing to set is whether or not VISA Read should stop reading when a certain character is sent by the device. This is known as the termination character. You will need to check the device's programming manual for this information.

 

You should also spend some time here: http://zone.ni.com/devzone/cda/tut/p/id/4359

Message 2 of 4
(2,362 Views)

 


@smercurio_fc wrote:

English c/o Google Translate:

 

 


Hello,

I want to send commands to type string to a device via a USB port on my pc.
The wiring diagram is as follows:

Device-> RS-232-> USB-> PC

I looked at the examples in LV but I was not able to send / receive data.
The aircraft was the basis not recognized by Windows, so I followed this tutorial: http://zone.ni.com/devzone/cda/tut/p/id/8523 to install a USB RAW .
I then used the VISA functions Open, Close VISA, VISA Read and VISA Write, but nothing seems to work.

Thank you to indicate whether there are special precautions for communication via USB.

 

Step 1: Undo EVERYTHING you did regarding creating a USB RAW device.If you are using a USB<-->RS-232 converter then you will have virtual COM ports. To your application they will appear as "regular" serial (COM) ports.

 

Step 1.5: Read the instruction for the USB>Ser adaptor and install the Virtual COM port driver IAW the manufacturer's instructions.

 

Step 2: Treat the device as an RS-232 device. Communicate with it using the virtual COM port. Verify that you can communicate with it by using a communication program like HyperTerminal (if you're on Windows) and open a connection to the COM port to which your device is connected. Send some commands (check the documentation of your device). Then, take a look at the serial examples that ship with LabVIEW. Open the Example Finder (Help -> Find Examples) and search for "serial". The key thing to set is whether or not VISA Read should stop reading when a certain character is sent by the device. This is known as the termination character. You will need to check the device's programming manual for this information.

 

You should also spend some time here: http://zone.ni.com/devzone/cda/tut/p/id/4359


 

 


"Should be" isn't "Is" -Jay
0 Kudos
Message 3 of 4
(2,349 Views)

Thanks for your help, it's works!

 

Teka

___________
Labview 8.2 version étudiante
Sound & Vibration Toolkit
Message 4 of 4
(2,326 Views)