Instrument Control (GPIB, Serial, VISA, IVI)

cancel
Showing results for 
Search instead for 
Did you mean: 

USB-RS485 460.8k baud rate problem

Hi,

We have a problem with 1 channel USB-RS485 module.

According to data sheet, the module supports up to 460.8kbps.

We wrote a short C# code which is attached.

There appears an exception saying " The maximum baud rate for this device is 131072" (this exception is also attached)

 

How can we use this module with C# at 460.8 kbps?

Thanks.

 

 

Download All
0 Kudos
Message 1 of 5
(5,034 Views)

It looks like you have identified a bug in our USB serial driver. There are two ways an application can determine if a given baud rate will be supported by a serial port. They can ask the driver what the max rate is, or they can just try setting the desired baud rate and see if it returns an error.

 

Most applications just try to use the baud rate, and never ask the driver for the maximum value. The reason for this is that drivers can only return up to 128K (131072), or a special value meaning "other." In the "other" case, you have to try setting the baud rate anyway. It appears that the C# class actually queries the maximum baud rate first, and our driver is incorrectly returning 128K (131072), instead of "other".

 

I have recorded the issue to be resolved in a future driver release, but I cannot currently estimate when that will happen. I have two ideas you could try, to attempt to get around the limitation for now:

 

1. Try opening the port with a baud rate of 115200, then change the BaudRate property to 460800. It is possible that the check is performed in the constructor, rather than in the property, so it is worth trying.

 

2. NI-VISA is certainly able to use 460800 with this hardware, so you could opt to use NI-VISA for your serial communication in C#, rather than the SerialPort class. Please let us know if #1 works, and if #2 may be an option for your application.

 

-Jason S.

0 Kudos
Message 2 of 5
(5,020 Views)

Hi Jason,

 

We tried #1 but it didn't work.

 

For #2, the baudrate of the module can be changed from NI -VISA but the functions that we need are in SerialPort Class.

 

Therefore, we need the new NI-Serial driver.

0 Kudos
Message 3 of 5
(4,989 Views)
What version of Windows are you using?
0 Kudos
Message 4 of 5
(4,985 Views)

We use both XP and 7

0 Kudos
Message 5 of 5
(4,982 Views)