LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Communicating via USB instead of Serial

Looking for some example code for writing to and reading from a USB port instead of rs232 serial.
0 Kudos
Message 1 of 6
(3,947 Views)
Couldn't find any decent examples, but I did find an app note on it. See if it helps:

Using NI-VISA 3.0 to Control Your USB Device
0 Kudos
Message 2 of 6
(3,936 Views)
If you have a USB to serial converter, it should appear in the system as a com port and you treat it exactly the same as any rs232 port. VISA Read and Write to "com whatever".
0 Kudos
Message 3 of 6
(3,919 Views)
Thank You both for the valuable info. I think I will try the second approach though because that is a much simpler solution.
0 Kudos
Message 4 of 6
(3,894 Views)


@astrobuck wrote:
Looking for some example code for writing to and reading from a USB port instead of rs232 serial.



I have a USB data acquisition module (Dataq p/n DI-148) and a RS-232 compass (PNI p/n TCM2) that I'd like to connect to using Labview 7.1. Unfortunatly, no drivers exist for these devises. I am a first time user of Labview and have looked through the tutorial and help files for a step by step instructions but have turned up empty handed. If anyone can help me along or point me in the right direction I would appreciate the help.

ref:
http://www.dataq.com/products/startkit/di148.htm
http://www.pnicorp.com/productDetail?nodeId=c35

Thanks,
Chris
0 Kudos
Message 5 of 6
(3,795 Views)


@Chris Dundorf wrote:


@astrobuck wrote:
Looking for some example code for writing to and reading from a USB port instead of rs232 serial.



I have a USB data acquisition module (Dataq p/n DI-148) and a RS-232 compass (PNI p/n TCM2) that I'd like to connect to using Labview 7.1. Unfortunatly, no drivers exist for these devises. I am a first time user of Labview and have looked through the tutorial and help files for a step by step instructions but have turned up empty handed. If anyone can help me along or point me in the right direction I would appreciate the help.

ref:
http://www.dataq.com/products/startkit/di148.htm
http://www.pnicorp.com/productDetail?nodeId=c35

Thanks,
Chris




The Dataq device, while it could theoretically be accessed through VISA USB interface, should come with some sort of driver. USB is only the transport interface similar to Ethernet being the transport interface for network communication. The type of protocol used to transport data over this interface is the real important thing and for data acquisition devices which need to have some useful data transfer rate there is no standard predefined protocol which every manufacturer might use, so everybody has to define his own protocol. This means you would need the actual documentation for the Dataq device about its device endpoints and the individual stream protocols for each of those endpoints in order to implement that protocol using the VISA USB interface. It is very unlikely that a data acquisition manufacturer releases this information to anyone without a strict NDA.
But an USB interface without a ready made driver is basically useless for most users and a sure way for a manufacturer to go out of business sooner or later. Dataq may not provide a LabVIEW driver for it but they for sure provide a Windows driver with a DLL interface. You can then use the LabVIEW Call Library Node to access the Dataq DLL.

For the RS-232 device, the most difficult part may be actually to get it hooked up to your serial port. After you can communicate with it through for instance Hyperterminal it is a quite easy task to actually write a simple LabVIEW driver using the VISA functions to communicate with the device.

Rolf Kalbermatter
Rolf Kalbermatter  My Blog
DEMO, Electronic and Mechanical Support department, room 36.LB00.390
Message 6 of 6
(3,782 Views)