Instrument Control (GPIB, Serial, VISA, IVI)

cancel
Showing results for 
Search instead for 
Did you mean: 

Using USB port on cDAQ-9135 for Serial Input

Hello,

 

How can I configure one of the USB ports on the cDAQ-9135 to receive serial input? I'm already using the RS-232 serial port. 

 

I added a new serial device under "Devices and Interfaces" in NI-MAX named COM2 but I'm not sure how to bind that to the USB port. 

 

When I plug in the serial stream to the USB port, the cDAQ freezes so I'm guessing it's interpreting the serial stream as bogus instructions or trying to interpret it as a mouse/keyboard input. 

 

Any help/insight would be greatly appreciated!

 

 

0 Kudos
Message 1 of 6
(2,868 Views)

Hello  sdol16,

 

What device do you currently have connected to your USB port?  Is it showing up in NI MAX in Windows? First of all, the device should be recognized in your computer, and then a COM# will be automatically assigned to it. One does not normally assign this COM port numbers manually, but it still is something you can do. 

 

For you to be able to start communicating with your device via USB, at least have the NI-VISA driver installed. Do you currently have it installed? There are some tutorials and examples for this driver. I believe this link would be helpful for you: http://www.ni.com/product-documentation/3702/en/

0 Kudos
Message 2 of 6
(2,844 Views)

Hi MoacirF,

 

I have serial input 3 of the Dynon SkyVIEW HDX display wired to a USB cable. When the cDAQ is running and I plug the USB cable in, NI-MAX loses connection with the cDAQ but the SkyVIEW is not recognized by the computer or showing up in NI-MAX. 

 

I have NI-VISA 18.0 and NI-VISA Runtime 18.0 installed on the cDAQ.

 

 

0 Kudos
Message 3 of 6
(2,842 Views)

Hi sdol16,

 

You will need to make sure that the device itself first shows up in the Windows Device Manager as a recognized device with a COM# assigned to it; you will need to install its drivers for this purpose. Once you have been able to recognize this device in Windows, you could move into the next layer -> communication from LabVIEW.  

It sounds like you are trying to manually wire one of your device's output to a USB cable, and the cable into the cDAQ chassis. What's the output type of your device? How are you connecting it into the cDAQ's USB port? Have you installed its drivers yet?

 

 

0 Kudos
Message 4 of 6
(2,834 Views)

Hi MoacirF,

 

Thanks for pointing that out - I wasn't checking if the device was even being recognized in Windows (which it isn't).

 

The output of the serial device is just a stream of ASCII characters. I've wired the serial output to a USB cable in the following configuration:

TX (serial) wired to D- (USB)
RX (serial) wired to D+ (USB)
GRND (serial) wired to GRND (USB)
The V+ of the USB is unwired

 

I then just plug the USB into one of the slots on the cDAQ, but it's not recognized by Windows. I've searched for device drivers and tried a USB-Serial one without success. 

 

Seems like I'll have to switch over to a Windows forum since this issue traces back before NI/LabVIEW at the moment.  

0 Kudos
Message 5 of 6
(2,771 Views)

That sounds as if your device has an RS-232 or 'UART' type serial port. This is fundamentally different to USB, both electrically and in the protocol by which data is sent and received! You cannot just wire one to the other, and it's possible that you've already damaged one or both ports by doing so...

 

There are USB-serial adapters which plug into a USB host port and provide one or more serial ports. You may be able to use one of these to add serial ports to your cDAQ controller if the OS running on the controller supports the adapter, or if you can install a driver to add that support. I'm sure people with more experience of the cDAQ-9135 can help you choose and set up a suitable one.

 

You'll need to know whether your device uses RS-232 voltage levels (nominally +/- 12 V, where a positive voltage is 'space' and a negative voltage is 'mark') or 'TTL' levels where 0 V is 'space' and a positive voltage is 'mark', usually either +5 V or +3.3 V.

 

If you have a 'real' RS-232 port available I would suggest demonstrating communication using that port first, before moving on to using the USB-serial adapter.

0 Kudos
Message 6 of 6
(2,749 Views)